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

67 lines
1.2 KiB
Nix

{ lib
, aiohttp
, aresponses
, buildPythonPackage
, fetchFromGitHub
, mashumaro
, orjson
, poetry-core
, pytest-asyncio
, pytestCheckHook
, pythonOlder
, syrupy
, yarl
}:
buildPythonPackage rec {
pname = "vehicle";
version = "2.2.1";
format = "pyproject";
disabled = pythonOlder "3.11";
src = fetchFromGitHub {
owner = "frenck";
repo = "python-vehicle";
rev = "refs/tags/v${version}";
hash = "sha256-mu30v4iZoOYfQZc1P45UZaor6hf+i+gOvGcVGcQYzTo=";
};
postPatch = ''
# Upstream doesn't set a version for the pyproject.toml
substituteInPlace pyproject.toml \
--replace "0.0.0" "${version}" \
--replace "--cov" ""
'';
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
aiohttp
mashumaro
orjson
yarl
];
nativeCheckInputs = [
aresponses
pytest-asyncio
pytestCheckHook
syrupy
];
pythonImportsCheck = [
"vehicle"
];
meta = with lib; {
description = "Python client providing RDW vehicle information";
homepage = "https://github.com/frenck/python-vehicle";
changelog = "https://github.com/frenck/python-vehicle/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ fab ];
};
}