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