summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/github3-py/default.nix
blob: 80fda5cc7ee1657aa9889d0f1bacde6a8bd62505 (plain)
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
51
52
53
54
55
56
57
58
59
60
61
62
{
  lib,
  buildPythonPackage,
  fetchPypi,
  requests,
  uritemplate,
  python-dateutil,
  pyjwt,
  pytest-xdist,
  pytestCheckHook,
  betamax,
  betamax-matchers,
  hatchling,
  fetchpatch,
}:

buildPythonPackage rec {
  pname = "github3-py";
  version = "4.0.1";
  pyproject = true;

  src = fetchPypi {
    pname = "github3.py";
    inherit version;
    hash = "sha256-MNVxB2dT78OJ7cf5qu8zik/LJLVNiWjV85sTQvRd3TY=";
  };

  patches = [
    (fetchpatch {
      # disable tests with "AttributeError: 'MockHTTPResponse' object has no attribute 'close'", due to betamax
      url = "https://github.com/sigmavirus24/github3.py/commit/9d6124c09b0997b5e83579549bcf22b3e901d7e5.patch";
      hash = "sha256-8Z4vN7iKl/sOcEJptsH5jsqijZgvL6jS7kymZ8+m6bY=";
    })
  ];

  build-system = [ hatchling ];

  dependencies = [
    pyjwt
    python-dateutil
    requests
    uritemplate
  ]
  ++ pyjwt.optional-dependencies.crypto;

  pythonImportsCheck = [ "github3" ];

  nativeCheckInputs = [
    pytest-xdist
    pytestCheckHook
    betamax
    betamax-matchers
  ];

  meta = {
    homepage = "https://github3py.readthedocs.org/en/master/";
    description = "Wrapper for the GitHub API written in python";
    changelog = "https://github.com/sigmavirus24/github3.py/blob/${version}/docs/source/release-notes/${version}.rst";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ pSub ];
  };
}