1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 requests,
6 uritemplate,
7 python-dateutil,
8 pyjwt,
9 pytest-xdist,
10 pytestCheckHook,
11 betamax,
12 betamax-matchers,
13 hatchling,
14 fetchpatch,
15}:
16
17buildPythonPackage rec {
18 pname = "github3-py";
19 version = "4.0.1";
20 pyproject = true;
21
22 src = fetchPypi {
23 pname = "github3.py";
24 inherit version;
25 hash = "sha256-MNVxB2dT78OJ7cf5qu8zik/LJLVNiWjV85sTQvRd3TY=";
26 };
27
28 patches = [
29 (fetchpatch {
30 # disable tests with "AttributeError: 'MockHTTPResponse' object has no attribute 'close'", due to betamax
31 url = "https://github.com/sigmavirus24/github3.py/commit/9d6124c09b0997b5e83579549bcf22b3e901d7e5.patch";
32 hash = "sha256-8Z4vN7iKl/sOcEJptsH5jsqijZgvL6jS7kymZ8+m6bY=";
33 })
34 ];
35
36 build-system = [ hatchling ];
37
38 dependencies = [
39 pyjwt
40 python-dateutil
41 requests
42 uritemplate
43 ]
44 ++ pyjwt.optional-dependencies.crypto;
45
46 pythonImportsCheck = [ "github3" ];
47
48 nativeCheckInputs = [
49 pytest-xdist
50 pytestCheckHook
51 betamax
52 betamax-matchers
53 ];
54
55 meta = {
56 homepage = "https://github3py.readthedocs.org/en/master/";
57 description = "Wrapper for the GitHub API written in python";
58 changelog = "https://github.com/sigmavirus24/github3.py/blob/${version}/docs/source/release-notes/${version}.rst";
59 license = lib.licenses.bsd3;
60 maintainers = with lib.maintainers; [ pSub ];
61 };
62}