nixpkgs/pkgs/development/python-modules/censys/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

83 lines
1.5 KiB
Nix
Raw Normal View History

2021-01-17 22:32:36 +00:00
{ lib
, argcomplete
2021-01-17 22:32:36 +00:00
, backoff
, buildPythonPackage
, fetchFromGitHub
2021-08-24 21:53:13 +00:00
, importlib-metadata
2021-07-06 15:35:42 +00:00
, parameterized
2021-08-24 21:53:13 +00:00
, poetry-core
, pytest-mock
2021-01-17 22:32:36 +00:00
, pytestCheckHook
2021-07-06 15:35:42 +00:00
, pythonOlder
, pythonRelaxDepsHook
2021-01-17 22:32:36 +00:00
, requests
, requests-mock
2021-07-06 15:35:42 +00:00
, responses
, rich
2021-01-17 22:32:36 +00:00
}:
buildPythonPackage rec {
pname = "censys";
version = "2.2.6";
2021-08-24 21:53:13 +00:00
format = "pyproject";
disabled = pythonOlder "3.7";
2021-01-17 22:32:36 +00:00
src = fetchFromGitHub {
owner = "censys";
repo = "censys-python";
rev = "refs/tags/v${version}";
hash = "sha256-awe/6d6AryihS8vYCRtU8APbLUsqv9aKULBmjjaz3gM=";
2021-01-17 22:32:36 +00:00
};
2021-08-24 21:53:13 +00:00
nativeBuildInputs = [
poetry-core
pythonRelaxDepsHook
2021-08-24 21:53:13 +00:00
];
2021-01-17 22:32:36 +00:00
propagatedBuildInputs = [
argcomplete
2021-01-17 22:32:36 +00:00
backoff
requests
2021-07-06 15:35:42 +00:00
rich
2021-08-24 21:53:13 +00:00
importlib-metadata
2021-01-17 22:32:36 +00:00
];
nativeCheckInputs = [
2021-07-06 15:35:42 +00:00
parameterized
pytest-mock
2021-01-17 22:32:36 +00:00
pytestCheckHook
requests-mock
2021-07-06 15:35:42 +00:00
responses
2021-01-17 22:32:36 +00:00
];
pythonRelaxDeps = [
"backoff"
"requests"
"rich"
];
2021-07-06 15:35:42 +00:00
postPatch = ''
2021-08-25 06:44:44 +00:00
substituteInPlace pytest.ini \
--replace "--cov" ""
2021-07-06 15:35:42 +00:00
'';
2021-01-17 22:32:36 +00:00
# The tests want to write a configuration file
preCheck = ''
export HOME=$(mktemp -d)
mkdir -p $HOME
2021-07-06 15:35:42 +00:00
'';
pythonImportsCheck = [
"censys"
];
2021-01-17 22:32:36 +00:00
meta = with lib; {
description = "Python API wrapper for the Censys Search Engine (censys.io)";
homepage = "https://github.com/censys/censys-python";
changelog = "https://github.com/censys/censys-python/releases/tag/v${version}";
2021-01-17 22:32:36 +00:00
license = with licenses; [ asl20 ];
2021-07-06 15:35:42 +00:00
maintainers = with maintainers; [ fab ];
2021-01-17 22:32:36 +00:00
};
}