diff --git a/pkgs/development/python-modules/censys/default.nix b/pkgs/development/python-modules/censys/default.nix index 23c883a48a4c..b3d152efab16 100644 --- a/pkgs/development/python-modules/censys/default.nix +++ b/pkgs/development/python-modules/censys/default.nix @@ -2,49 +2,62 @@ , backoff , buildPythonPackage , fetchFromGitHub -, pytestCheckHook -, requests -, pytestcov -, requests-mock , parameterized +, pytestCheckHook +, pythonOlder +, requests +, requests-mock +, responses +, rich +, types-requests }: buildPythonPackage rec { pname = "censys"; - version = "1.1.1"; + version = "2.0.3"; + disabled = pythonOlder "3.6"; src = fetchFromGitHub { owner = "censys"; repo = "censys-python"; - rev = version; - sha256 = "06jwk0ps80fjzbsy24qn5bsggfpgn4ccjzjz65cdh0ap1mfvh5jf"; + rev = "v${version}"; + sha256 = "0ga5f6xv6rylfvalnl3cflr0w30r771gb05n5cjhxisb8an0qcb6"; }; propagatedBuildInputs = [ backoff requests + rich + types-requests ]; checkInputs = [ - pytestcov + parameterized pytestCheckHook requests-mock - parameterized + responses ]; + postPatch = '' + substituteInPlace setup.py \ + --replace "rich==10.3.0" "rich" \ + --replace "types-requests==0.1.11" "types-requests" + substituteInPlace pytest.ini --replace \ + " --cov -rs -p no:warnings" "" + ''; + # The tests want to write a configuration file preCheck = '' export HOME=$(mktemp -d) mkdir -p $HOME - ''; - # All other tests require an API key - pytestFlagsArray = [ "tests/test_config.py" ]; + ''; + pythonImportsCheck = [ "censys" ]; meta = with lib; { description = "Python API wrapper for the Censys Search Engine (censys.io)"; homepage = "https://github.com/censys/censys-python"; license = with licenses; [ asl20 ]; - maintainers = [ maintainers.fab ]; + maintainers = with maintainers; [ fab ]; }; }