depot/third_party/nixpkgs/pkgs/development/python-modules/us/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

51 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
jellyfish,
pytestCheckHook,
pythonOlder,
pytz,
}:
buildPythonPackage rec {
pname = "us";
version = "3.1.1";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchPypi {
inherit pname version;
hash = "sha256-40eWPo0kocp0N69EP6aFkXdoR7UMhlDY7w61NILnBcI=";
};
postPatch = ''
# Upstream spins jellyfish
substituteInPlace setup.py \
--replace "jellyfish==" "jellyfish>="
'';
propagatedBuildInputs = [ jellyfish ];
nativeCheckInputs = [
pytestCheckHook
pytz
];
pythonImportsCheck = [ "us" ];
meta = with lib; {
description = "Package for easily working with US and state metadata";
mainProgram = "states";
longDescription = ''
All US states and territories, postal abbreviations, Associated Press style
abbreviations, FIPS codes, capitals, years of statehood, time zones, phonetic
state name lookup, is contiguous or continental, URLs to shapefiles for state,
census, congressional districts, counties, and census tracts.
'';
homepage = "https://github.com/unitedstates/python-us/";
license = licenses.bsd3;
maintainers = with maintainers; [ ];
};
}