1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 poetry-core,
7 pythonOlder,
8 setuptools,
9}:
10
11buildPythonPackage rec {
12 pname = "nats-python";
13 version = "0.8.0";
14 pyproject = true;
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchFromGitHub {
19 owner = "Gr1N";
20 repo = "nats-python";
21 tag = version;
22 hash = "sha256-7/AGQfPEuSeoRGUXeyDZNbLhapfQa7vhrSPHRruf+sg=";
23 };
24
25 patches = [
26 # Switch to poetry-core, https://github.com/Gr1N/nats-python/pull/19
27 (fetchpatch {
28 name = "use-poetry-core.patch";
29 url = "https://github.com/Gr1N/nats-python/commit/71b25b324212dccd7fc06ba3914491adba22e83f.patch";
30 hash = "sha256-9AUd/anWCAhuD0VdxRm6Ydlst8nttjwfPmqK+S8ON7o=";
31 })
32 ];
33
34 build-system = [ poetry-core ];
35
36 dependencies = [ setuptools ];
37
38 # Tests require a running NATS server
39 doCheck = false;
40
41 pythonImportsCheck = [ "pynats" ];
42
43 meta = with lib; {
44 description = "Python client for NATS messaging system";
45 homepage = "https://github.com/Gr1N/nats-python";
46 changelog = "https://github.com/Gr1N/nats-python/releases/tag/${version}";
47 license = with licenses; [ mit ];
48 maintainers = with maintainers; [ fab ];
49 };
50}