1{
2 lib,
3 aiohttp,
4 aresponses,
5 buildPythonPackage,
6 fetchFromGitHub,
7 poetry-core,
8 pythonOlder,
9 pytest-asyncio,
10 pytestCheckHook,
11 pytz,
12 syrupy,
13}:
14
15buildPythonPackage rec {
16 pname = "odp-amsterdam";
17 version = "6.1.2";
18 pyproject = true;
19
20 disabled = pythonOlder "3.11";
21
22 src = fetchFromGitHub {
23 owner = "klaasnicolaas";
24 repo = "python-odp-amsterdam";
25 tag = "v${version}";
26 hash = "sha256-vamWelyEcwvYI5I9wmKk8kKc7j0OMer/BKgC0pbN4g0=";
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml \
31 --replace-fail '"0.0.0"' '"${version}"'
32 sed -i '/addopts/d' pyproject.toml
33 '';
34
35 build-system = [
36 poetry-core
37 ];
38
39 pythonRelaxDeps = [ "pytz" ];
40
41 dependencies = [
42 aiohttp
43 pytz
44 ];
45
46 nativeCheckInputs = [
47 aresponses
48 pytest-asyncio
49 pytestCheckHook
50 syrupy
51 ];
52
53 pythonImportsCheck = [ "odp_amsterdam" ];
54
55 meta = with lib; {
56 description = "Python client for getting garage occupancy in Amsterdam";
57 homepage = "https://github.com/klaasnicolaas/python-odp-amsterdam";
58 changelog = "https://github.com/klaasnicolaas/python-odp-amsterdam/releases/tag/${src.tag}";
59 license = licenses.mit;
60 maintainers = with maintainers; [ fab ];
61 };
62}