2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
anyio,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
hishel,
|
|
|
|
httpx,
|
|
|
|
poetry-core,
|
|
|
|
pydantic,
|
|
|
|
pyjwt,
|
|
|
|
pytest-xdist,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
typing-extensions,
|
2024-01-02 11:29:13 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "githubkit";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.11.4";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "yanyongyu";
|
|
|
|
repo = "githubkit";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-uxXRDavp5c3e1MOZR2B4wUxEHh6K81avTeaIVsOdup8=";
|
2024-01-02 11:29:13 +00:00
|
|
|
};
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace-fail "--cov=githubkit --cov-append --cov-report=term-missing" ""
|
2024-01-25 14:12:00 +00:00
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [ poetry-core ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2024-01-25 14:12:00 +00:00
|
|
|
hishel
|
2024-01-02 11:29:13 +00:00
|
|
|
httpx
|
|
|
|
pydantic
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
all = [
|
|
|
|
anyio
|
|
|
|
pyjwt
|
|
|
|
];
|
2024-04-21 15:54:59 +00:00
|
|
|
jwt = [ pyjwt ];
|
|
|
|
auth-app = [ pyjwt ];
|
|
|
|
auth-oauth-device = [ anyio ];
|
2024-01-25 14:12:00 +00:00
|
|
|
auth = [
|
|
|
|
anyio
|
|
|
|
pyjwt
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
2024-04-21 15:54:59 +00:00
|
|
|
pytest-xdist
|
2024-01-25 14:12:00 +00:00
|
|
|
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonImportsCheck = [ "githubkit" ];
|
2024-01-25 14:12:00 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests require network access
|
|
|
|
"test_graphql"
|
|
|
|
"test_async_graphql"
|
|
|
|
"test_call"
|
|
|
|
"test_async_call"
|
|
|
|
"test_versioned_call"
|
|
|
|
"test_versioned_async_call"
|
|
|
|
];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "GitHub SDK for Python";
|
|
|
|
homepage = "https://github.com/yanyongyu/githubkit";
|
2024-01-25 14:12:00 +00:00
|
|
|
changelog = "https://github.com/yanyongyu/githubkit/releases/tag/v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ kranzes ];
|
|
|
|
};
|
|
|
|
}
|