about summary refs log tree commit diff
path: root/pkgs/development/python-modules/nats-python/default.nix
blob: f93b2feab69c94ac6ec5ea61ac87f3fddebc2d66 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  poetry-core,
  pythonOlder,
  setuptools,
}:

buildPythonPackage rec {
  pname = "nats-python";
  version = "0.8.0";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "Gr1N";
    repo = "nats-python";
    rev = "refs/tags/${version}";
    hash = "sha256-7/AGQfPEuSeoRGUXeyDZNbLhapfQa7vhrSPHRruf+sg=";
  };

  patches = [
    # Switch to poetry-core, https://github.com/Gr1N/nats-python/pull/19
    (fetchpatch {
      name = "use-poetry-core.patch";
      url = "https://github.com/Gr1N/nats-python/commit/71b25b324212dccd7fc06ba3914491adba22e83f.patch";
      hash = "sha256-9AUd/anWCAhuD0VdxRm6Ydlst8nttjwfPmqK+S8ON7o=";
    })
  ];

  build-system = [ poetry-core ];

  dependencies = [ setuptools ];

  # Tests require a running NATS server
  doCheck = false;

  pythonImportsCheck = [ "pynats" ];

  meta = with lib; {
    description = "Python client for NATS messaging system";
    homepage = "https://github.com/Gr1N/nats-python";
    changelog = "https://github.com/Gr1N/nats-python/releases/tag/${version}";
    license = with licenses; [ mit ];
    maintainers = with maintainers; [ fab ];
  };
}