2023-01-11 07:51:40 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, click
|
|
|
|
, defusedxml
|
|
|
|
, fetchFromGitHub
|
|
|
|
, httpx
|
|
|
|
, poetry-core
|
|
|
|
, pydantic
|
|
|
|
, pytest-asyncio
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, respx
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "sfrbox-api";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "0.0.9";
|
|
|
|
pyproject = true;
|
2023-01-11 07:51:40 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hacf-fr";
|
2024-01-25 14:12:00 +00:00
|
|
|
repo = "sfrbox-api";
|
2023-01-11 07:51:40 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-rMfX9vA8IuWxXvVs4WYNHO6neeoie/3gABwhXyJoAF8=";
|
2023-01-11 07:51:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'pydantic = ">=1.10.2"' 'pydantic = "*"'
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
defusedxml
|
|
|
|
httpx
|
|
|
|
pydantic
|
|
|
|
];
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
cli = [
|
|
|
|
click
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-01-11 07:51:40 +00:00
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
respx
|
2024-01-25 14:12:00 +00:00
|
|
|
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
|
2023-01-11 07:51:40 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"sfrbox_api"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Module for the SFR Box API";
|
|
|
|
homepage = "https://github.com/hacf-fr/sfrbox-api";
|
|
|
|
changelog = "https://github.com/hacf-fr/sfrbox-api/releases/tag/v${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|