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 = "python-opensky";
16 version = "0.0.10";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.10";
20
21 src = fetchFromGitHub {
22 owner = "joostlek";
23 repo = "python-opensky";
24 rev = "refs/tags/v${version}";
25 hash = "sha256-QhcnbFp37gj1/37OlRxnQnIhgyNi/D19PXRh5hagHvE=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace 'version = "0.0.0"' 'version = "${version}"' \
31 --replace "--cov" ""
32 substituteInPlace src/python_opensky/opensky.py \
33 --replace ".joinpath(uri)" "/ uri"
34 '';
35
36 nativeBuildInputs = [
37 poetry-core
38 ];
39
40 propagatedBuildInputs = [
41 aiohttp
42 pydantic
43 yarl
44 ];
45
46 nativeCheckInputs = [
47 aresponses
48 pytest-asyncio
49 pytestCheckHook
50 ];
51
52 pythonImportsCheck = [
53 "python_opensky"
54 ];
55
56 meta = with lib; {
57 description = "Asynchronous Python client for the OpenSky API";
58 homepage = "https://github.com/joostlek/python-opensky";
59 changelog = "https://github.com/joostlek/python-opensky/releases/tag/v${version}";
60 license = licenses.mit;
61 maintainers = with maintainers; [ fab ];
62 };
63}