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

61 lines
1.3 KiB
Nix

{
lib,
aiohttp,
aresponses,
buildPythonPackage,
fetchFromGitHub,
poetry-core,
pytest-asyncio,
pytestCheckHook,
pythonOlder,
pytz,
yarl,
}:
buildPythonPackage rec {
pname = "eiswarnung";
version = "2.0.0";
format = "pyproject";
disabled = pythonOlder "3.11";
src = fetchFromGitHub {
owner = "klaasnicolaas";
repo = "python-eiswarnung";
rev = "refs/tags/v${version}";
hash = "sha256-/61qrRfD7/gaEcvFot34HYXOVLWwTDi/fvcgHDTv9u0=";
};
__darwinAllowLocalNetworking = true;
postPatch = ''
substituteInPlace pyproject.toml \
--replace '"0.0.0"' '"${version}"' \
--replace 'addopts = "--cov"' "" \
--replace 'pytz = ">=2022.7.1,<2024.0.0"' 'pytz = "*"'
'';
nativeBuildInputs = [ poetry-core ];
propagatedBuildInputs = [
aiohttp
pytz
yarl
];
nativeCheckInputs = [
aresponses
pytest-asyncio
pytestCheckHook
];
pythonImportsCheck = [ "eiswarnung" ];
meta = with lib; {
description = "Module for getting Eiswarning API forecasts";
homepage = "https://github.com/klaasnicolaas/python-eiswarnung";
changelog = "https://github.com/klaasnicolaas/python-eiswarnung/releases/tag/v${version}";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}