1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 jellyfish,
6 pytestCheckHook,
7 pythonOlder,
8 pytz,
9}:
10
11buildPythonPackage rec {
12 pname = "us";
13 version = "3.1.1";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.6";
17
18 src = fetchPypi {
19 inherit pname version;
20 hash = "sha256-40eWPo0kocp0N69EP6aFkXdoR7UMhlDY7w61NILnBcI=";
21 };
22
23 postPatch = ''
24 # Upstream spins jellyfish
25 substituteInPlace setup.py \
26 --replace "jellyfish==" "jellyfish>="
27 '';
28
29 propagatedBuildInputs = [ jellyfish ];
30
31 nativeCheckInputs = [
32 pytestCheckHook
33 pytz
34 ];
35
36 pythonImportsCheck = [ "us" ];
37
38 meta = with lib; {
39 description = "A package for easily working with US and state metadata";
40 mainProgram = "states";
41 longDescription = ''
42 All US states and territories, postal abbreviations, Associated Press style
43 abbreviations, FIPS codes, capitals, years of statehood, time zones, phonetic
44 state name lookup, is contiguous or continental, URLs to shapefiles for state,
45 census, congressional districts, counties, and census tracts.
46 '';
47 homepage = "https://github.com/unitedstates/python-us/";
48 license = licenses.bsd3;
49 maintainers = with maintainers; [ ];
50 };
51}