From 139db136bc56f811fd28d9d0430a61ffe624450d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 29 Aug 2023 08:26:41 +0200 Subject: [PATCH] python310Packages.us: enable tests - add pythonImportsCheck --- .../development/python-modules/us/default.nix | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/us/default.nix b/pkgs/development/python-modules/us/default.nix index 9dbc28c8c363..e489879bd502 100644 --- a/pkgs/development/python-modules/us/default.nix +++ b/pkgs/development/python-modules/us/default.nix @@ -2,6 +2,9 @@ , buildPythonPackage , fetchPypi , jellyfish +, pytestCheckHook +, pythonOlder +, pytz }: buildPythonPackage rec { @@ -16,8 +19,8 @@ buildPythonPackage rec { hash = "sha256-40eWPo0kocp0N69EP6aFkXdoR7UMhlDY7w61NILnBcI="; }; - # Upstream spins jellyfish postPatch = '' + # Upstream spins jellyfish substituteInPlace setup.py \ --replace "jellyfish==" "jellyfish>=" ''; @@ -26,16 +29,22 @@ buildPythonPackage rec { jellyfish ]; + nativeCheckInputs = [ + pytestCheckHook + pytz + ]; - doCheck = false; # pypi version doesn't include tests + pythonImportsCheck = [ + "us" + ]; meta = with lib; { description = "A package for easily working with US and state metadata"; 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 + 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;