2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2023-07-15 17:15:38 +00:00
|
|
|
, argcomplete
|
2021-02-05 17:12:51 +00:00
|
|
|
, backoff
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2021-08-25 08:27:29 +00:00
|
|
|
, importlib-metadata
|
2021-07-14 22:03:04 +00:00
|
|
|
, parameterized
|
2021-08-25 08:27:29 +00:00
|
|
|
, poetry-core
|
2022-07-14 12:49:19 +00:00
|
|
|
, pytest-mock
|
2021-02-05 17:12:51 +00:00
|
|
|
, pytestCheckHook
|
2021-07-14 22:03:04 +00:00
|
|
|
, pythonOlder
|
2022-07-14 12:49:19 +00:00
|
|
|
, pythonRelaxDepsHook
|
2021-02-05 17:12:51 +00:00
|
|
|
, requests
|
|
|
|
, requests-mock
|
2021-07-14 22:03:04 +00:00
|
|
|
, responses
|
|
|
|
, rich
|
2021-02-05 17:12:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "censys";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "2.2.10";
|
|
|
|
pyproject = true;
|
2021-08-25 08:27:29 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "censys";
|
|
|
|
repo = "censys-python";
|
2022-10-30 15:09:59 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-rjLTEaHSBB6igffNGt4qJZeSyIn1Cc1ZGEGfEoMj7OQ=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
2021-08-25 08:27:29 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
2022-07-14 12:49:19 +00:00
|
|
|
pythonRelaxDepsHook
|
2021-08-25 08:27:29 +00:00
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
propagatedBuildInputs = [
|
2023-07-15 17:15:38 +00:00
|
|
|
argcomplete
|
2021-02-05 17:12:51 +00:00
|
|
|
backoff
|
|
|
|
requests
|
2021-07-14 22:03:04 +00:00
|
|
|
rich
|
2021-08-25 08:27:29 +00:00
|
|
|
importlib-metadata
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-07-14 22:03:04 +00:00
|
|
|
parameterized
|
2022-07-14 12:49:19 +00:00
|
|
|
pytest-mock
|
2021-02-05 17:12:51 +00:00
|
|
|
pytestCheckHook
|
|
|
|
requests-mock
|
2021-07-14 22:03:04 +00:00
|
|
|
responses
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
"backoff"
|
|
|
|
"requests"
|
|
|
|
"rich"
|
|
|
|
];
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
postPatch = ''
|
2021-08-27 14:25:00 +00:00
|
|
|
substituteInPlace pytest.ini \
|
|
|
|
--replace "--cov" ""
|
2021-07-14 22:03:04 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
# The tests want to write a configuration file
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
mkdir -p $HOME
|
2021-07-14 22:03:04 +00:00
|
|
|
'';
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"censys"
|
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python API wrapper for the Censys Search Engine (censys.io)";
|
|
|
|
homepage = "https://github.com/censys/censys-python";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/censys/censys-python/releases/tag/v${version}";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = with licenses; [ asl20 ];
|
2021-07-14 22:03:04 +00:00
|
|
|
maintainers = with maintainers; [ fab ];
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
}
|