depot/third_party/nixpkgs/pkgs/development/python-modules/python-bsblan/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

72 lines
1.5 KiB
Nix

{
lib,
aiohttp,
aresponses,
backoff,
buildPythonPackage,
fetchFromGitHub,
packaging,
poetry-core,
pydantic,
pytest-asyncio,
pytest-mock,
pytestCheckHook,
pythonOlder,
yarl,
}:
buildPythonPackage rec {
pname = "python-bsblan";
version = "0.5.18";
format = "pyproject";
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "liudger";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-SJUIJhsVn4LZiUx9h3Q2uWoeaQiKoIRrijTfPgCHnAA=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace 'version = "0.0.0"' 'version = "${version}"' \
--replace "--cov" ""
sed -i "/covdefaults/d" pyproject.toml
sed -i "/ruff/d" pyproject.toml
'';
nativeBuildInputs = [ poetry-core ];
propagatedBuildInputs = [
aiohttp
backoff
packaging
pydantic
yarl
];
nativeCheckInputs = [
aresponses
pytest-asyncio
pytest-mock
pytestCheckHook
];
disabledTests = lib.optionals (lib.versionAtLeast aiohttp.version "3.9.0") [
# https://github.com/liudger/python-bsblan/issues/808
"test_http_error400"
"test_not_authorized_401_response"
];
pythonImportsCheck = [ "bsblan" ];
meta = with lib; {
description = "Module to control and monitor an BSBLan device programmatically";
homepage = "https://github.com/liudger/python-bsblan";
changelog = "https://github.com/liudger/python-bsblan/releases/tag/v${version}";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}