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