This treewide change targets Python packages that specifies pytest flags with pytestFlagsArray, and whose flags cannot be consructed by other pytestCheckHook-honoured arguments. Use the __structuredAttrs-agnostic argument pytestFlags instead of the deprecated pytestFlagsArray. For flags with option arguments, join each flag and their option argument into a single command-line argument following POSIX Utility Argument Syntax[1] for easier overriding (remove/replace). Examples: * [ "-W" "ignore:message:WarningClass" ] -> [ "-Wignore:message:WarningClass" ] * [ "--reruns" "3" ] -> [ "--reruns=3" ] [1]: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html
77 lines
1.6 KiB
Nix
77 lines
1.6 KiB
Nix
{
|
|
lib,
|
|
aiohttp,
|
|
aresponses,
|
|
async-timeout,
|
|
backoff,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
poetry-core,
|
|
pytest-asyncio,
|
|
pytestCheckHook,
|
|
pythonOlder,
|
|
sigstore,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "aiogithubapi";
|
|
version = "25.5.0";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ludeeus";
|
|
repo = "aiogithubapi";
|
|
tag = version;
|
|
hash = "sha256-zl9QpFpkvSTs0BUDMBmwTeLY1YvNRSqbkIZ5LDUP3zw=";
|
|
};
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
pythonRelaxDeps = [ "async-timeout" ];
|
|
|
|
postPatch = ''
|
|
# Upstream is releasing with the help of a CI to PyPI, GitHub releases
|
|
# are not in their focus
|
|
substituteInPlace pyproject.toml \
|
|
--replace-fail 'version = "0"' 'version = "${version}"'
|
|
'';
|
|
|
|
build-system = [ poetry-core ];
|
|
|
|
dependencies = [
|
|
aiohttp
|
|
async-timeout
|
|
backoff
|
|
];
|
|
|
|
# Optional dependencies for deprecated-verify are not added
|
|
# Only sigstore < 2 is supported
|
|
|
|
nativeCheckInputs = [
|
|
aresponses
|
|
pytest-asyncio
|
|
pytestCheckHook
|
|
];
|
|
|
|
pytestFlags = [ "--asyncio-mode=auto" ];
|
|
|
|
preCheck = ''
|
|
export HOME=$(mktemp -d)
|
|
|
|
# Need sigstore is an optional dependencies and need <2
|
|
rm -rf tests/test_helper.py
|
|
'';
|
|
|
|
pythonImportsCheck = [ "aiogithubapi" ];
|
|
|
|
meta = {
|
|
description = "Python client for the GitHub API";
|
|
homepage = "https://github.com/ludeeus/aiogithubapi";
|
|
changelog = "https://github.com/ludeeus/aiogithubapi/releases/tag/${version}";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ fab ];
|
|
};
|
|
}
|