2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-05-18 14:49:53 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
|
|
|
, requests
|
|
|
|
, uritemplate
|
2021-07-04 02:40:35 +00:00
|
|
|
, python-dateutil
|
2022-05-18 14:49:53 +00:00
|
|
|
, pyjwt
|
|
|
|
, pytestCheckHook
|
|
|
|
, betamax
|
|
|
|
, betamax-matchers
|
2024-01-13 08:15:51 +00:00
|
|
|
, hatchling
|
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "github3.py";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "4.0.1";
|
|
|
|
format = "pyproject";
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-MNVxB2dT78OJ7cf5qu8zik/LJLVNiWjV85sTQvRd3TY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
hatchling
|
|
|
|
];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
propagatedBuildInputs = [
|
2024-01-13 08:15:51 +00:00
|
|
|
pyjwt
|
|
|
|
python-dateutil
|
2022-05-18 14:49:53 +00:00
|
|
|
requests
|
|
|
|
uritemplate
|
2022-10-21 18:38:19 +00:00
|
|
|
]
|
|
|
|
++ pyjwt.optional-dependencies.crypto;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-05-18 14:49:53 +00:00
|
|
|
pytestCheckHook
|
|
|
|
betamax
|
|
|
|
betamax-matchers
|
|
|
|
];
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
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=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
# Solves "__main__.py: error: unrecognized arguments: -nauto"
|
|
|
|
preCheck = ''
|
|
|
|
rm tox.ini
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
disabledTests = [
|
|
|
|
# FileNotFoundError: [Errno 2] No such file or directory: 'tests/id_rsa.pub'
|
|
|
|
"test_delete_key"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github3py.readthedocs.org/en/master/";
|
|
|
|
description = "A wrapper for the GitHub API written in python";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ pSub ];
|
|
|
|
};
|
|
|
|
}
|