croc: 10.1.1 -> 10.1.3 (#364662)
[NixPkgs.git] / pkgs / development / python-modules / demetriek / default.nix
blob2a9a466c9ab062827533e7165311769ae6d1ad3e
2   lib,
3   aiohttp,
4   aresponses,
5   awesomeversion,
6   backoff,
7   buildPythonPackage,
8   fetchFromGitHub,
9   fetchpatch,
10   poetry-core,
11   pydantic,
12   pytest-asyncio,
13   pytestCheckHook,
14   pythonOlder,
15   yarl,
18 buildPythonPackage rec {
19   pname = "demetriek";
20   version = "0.4.0";
21   pyproject = true;
23   disabled = pythonOlder "3.9";
25   src = fetchFromGitHub {
26     owner = "frenck";
27     repo = "python-demetriek";
28     rev = "refs/tags/v${version}";
29     hash = "sha256-LCHHBcZgO9gw5jyaJiiS4lKyb0ut+PJvKTylIvIKHhc=";
30   };
32   patches = [
33     # https://github.com/frenck/python-demetriek/pull/531
34     (fetchpatch {
35       name = "pydantic_2-compatibility.patch";
36       url = "https://github.com/frenck/python-demetriek/commit/e677fe5b735b6b28572e3e5fd6aab56fc056f5e6.patch";
37       excludes = [
38         "pyproject.toml"
39         "poetry.lock"
40       ];
41       hash = "sha256-oMVR45KHDhcPId/0X9obJXCPE8s1gk5IgsGsgZesdZw=";
42     })
43   ];
45   postPatch = ''
46     # Upstream doesn't set a version for the pyproject.toml
47     substituteInPlace pyproject.toml \
48       --replace "0.0.0" "${version}" \
49       --replace "--cov" ""
50   '';
52   pythonRelaxDeps = [ "pydantic" ];
54   nativeBuildInputs = [
55     poetry-core
56   ];
58   propagatedBuildInputs = [
59     aiohttp
60     awesomeversion
61     backoff
62     pydantic
63     yarl
64   ];
66   nativeCheckInputs = [
67     aresponses
68     pytest-asyncio
69     pytestCheckHook
70   ];
72   pythonImportsCheck = [ "demetriek" ];
74   __darwinAllowLocalNetworking = true;
76   meta = with lib; {
77     description = "Python client for LaMetric TIME devices";
78     homepage = "https://github.com/frenck/python-demetriek";
79     changelog = "https://github.com/frenck/python-demetriek/releases/tag/v${version}";
80     license = licenses.mit;
81     maintainers = with maintainers; [ fab ];
82   };