1{ lib
2, aiohttp
3, aresponses
4, buildPythonPackage
5, fetchFromGitHub
6, poetry-core
7, pydantic
8, pytest-asyncio
9, pytestCheckHook
10, pythonOlder
11, yarl
12}:
13
14buildPythonPackage rec {
15 pname = "vehicle";
16 version = "1.0.1";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.10";
20
21 src = fetchFromGitHub {
22 owner = "frenck";
23 repo = "python-vehicle";
24 rev = "refs/tags/v${version}";
25 hash = "sha256-nN7efkN59FCCjCk3svYCTGGdvr2RSM5VektuUkHy3Vo=";
26 };
27
28 nativeBuildInputs = [
29 poetry-core
30 ];
31
32 propagatedBuildInputs = [
33 aiohttp
34 pydantic
35 yarl
36 ];
37
38 nativeCheckInputs = [
39 aresponses
40 pytest-asyncio
41 pytestCheckHook
42 ];
43
44 postPatch = ''
45 # Upstream doesn't set a version for the pyproject.toml
46 substituteInPlace pyproject.toml \
47 --replace "0.0.0" "${version}" \
48 --replace "--cov" ""
49 '';
50
51 pythonImportsCheck = [
52 "vehicle"
53 ];
54
55 meta = with lib; {
56 description = "Python client providing RDW vehicle information";
57 homepage = "https://github.com/frenck/python-vehicle";
58 changelog = "https://github.com/frenck/python-vehicle/releases/tag/v${version}";
59 license = licenses.mit;
60 maintainers = with maintainers; [ fab ];
61 };
62}