Merge pull request #287965 from fabaff/slowapi-bump

python311Packages.slowapi: 0.1.8 -> 0.1.9
This commit is contained in:
Fabian Affolter 2024-02-13 11:37:50 +01:00 committed by GitHub
commit 77e68f9b88
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 131 additions and 40 deletions

View File

@ -0,0 +1,67 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, grpcio
, protobuf
, pytest-asyncio
, pytest-mock
, pytestCheckHook
, pythonOlder
, setuptools
, setuptools-scm
}:
buildPythonPackage rec {
pname = "aetcd";
version = "1.0.0a4";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "martyanov";
repo = "aetcd";
rev = "refs/tags/v${version}";
hash = "sha256-g49ppfh8dyGpZeu/HdTDX8RAk5VTcZmqENRpNY12qkg=";
};
postPatch = ''
substituteInPlace setup.py \
--replace-fail "setuptools_scm==6.3.2" "setuptools_scm"
substituteInPlace setup.cfg \
--replace-fail "--cov=aetcd" ""
'';
nativeBuildInputs = [
setuptools
setuptools-scm
];
propagatedBuildInputs = [
grpcio
protobuf
];
nativeCheckInputs = [
pytest-asyncio
pytest-mock
pytestCheckHook
];
pythonImportsCheck = [
"aetcd"
];
disabledTestPaths = [
# Tests require a running ectd instance
"tests/integration/"
];
meta = with lib; {
description = "Python asyncio-based client for etcd";
homepage = "https://github.com/martyanov/aetcd";
changelog = "https://github.com/martyanov/aetcd/blob/v${version}/docs/changelog.rst";
license = licenses.asl20;
maintainers = with maintainers; [ fab ];
};
}

View File

@ -1,10 +1,13 @@
{ lib
, aetcd
, buildPythonPackage
, coredis
, deprecated
, fetchFromGitHub
, etcd3
, fetchFromGitHub
, hiro
, importlib-resources
, motor
, packaging
, pymemcache
, pymongo
@ -20,13 +23,13 @@
buildPythonPackage rec {
pname = "limits";
version = "3.7.0";
format = "setuptools";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "alisaifee";
repo = pname;
repo = "limits";
rev = "refs/tags/${version}";
# Upstream uses versioneer, which relies on git attributes substitution.
# This leads to non-reproducible archives on github. Remove the substituted
@ -37,37 +40,66 @@ buildPythonPackage rec {
hash = "sha256-0h3ofungHkjycUvNJ3jf+VB/GSrshgUDECN2YoPGzzg=";
};
propagatedBuildInputs = [
deprecated
importlib-resources
packaging
setuptools
typing-extensions
];
nativeCheckInputs = [
etcd3
hiro
pymemcache
pymongo
pytest-asyncio
pytest-lazy-fixture
pytestCheckHook
redis
];
postPatch = ''
substituteInPlace pytest.ini \
--replace "--cov=limits" "" \
--replace "-K" ""
--replace-fail "--cov=limits" "" \
--replace-fail "-K" ""
substituteInPlace setup.py \
--replace "versioneer.get_version()" "'${version}'"
--replace-fail "versioneer.get_version()" "'${version}'"
# Recreate _version.py, deleted at fetch time due to non-reproducibility.
echo 'def get_versions(): return {"version": "${version}"}' > limits/_version.py
'';
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [
deprecated
importlib-resources
packaging
typing-extensions
];
passthru.optional-dependencies = {
redis = [
redis
];
rediscluster = [
redis
];
memcached = [
pymemcache
];
mongodb = [
pymongo
];
etcd = [
etcd3
];
async-redis = [
coredis
];
# async-memcached = [
# emcache # Missing module
# ];
async-mongodb = [
motor
];
async-etcd = [
aetcd
];
};
nativeCheckInputs = [
hiro
pytest-asyncio
pytest-lazy-fixture
pytestCheckHook
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
pythonImportsCheck = [
"limits"
];
@ -82,6 +114,7 @@ buildPythonPackage rec {
meta = with lib; {
description = "Rate limiting using various strategies and storage backends such as redis & memcached";
homepage = "https://github.com/alisaifee/limits";
changelog = "https://github.com/alisaifee/limits/releases/tag/${version}";
license = licenses.mit;
maintainers = with maintainers; [ ];
};

View File

@ -10,37 +10,26 @@
, pytestCheckHook
, pythonAtLeast
, pythonOlder
, pythonRelaxDepsHook
, redis
, starlette
}:
buildPythonPackage rec {
pname = "slowapi";
version = "0.1.8";
format = "pyproject";
version = "0.1.9";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "laurentS";
repo = pname;
repo = "slowapi";
rev = "refs/tags/v${version}";
hash = "sha256-xgHz8b95SXf/GwzKPfQ/RHbUNJfCx6+7a2HB8+6hjsw=";
hash = "sha256-R/Mr+Qv22AN7HCDGmAUVh4efU8z4gMIyhC0AuKmxgdE=";
};
pythonRelaxDeps = [
"limits"
];
postPatch = ''
substituteInPlace pyproject.toml \
--replace '["redis^3.4.1"]' '["redis"]'
'';
nativeBuildInputs = [
poetry-core
pythonRelaxDepsHook
];
propagatedBuildInputs = [

View File

@ -105,6 +105,8 @@ self: super: with self; {
aesedb = callPackage ../development/python-modules/aesedb { };
aetcd = callPackage ../development/python-modules/aetcd { };
afdko = callPackage ../development/python-modules/afdko { };
affine = callPackage ../development/python-modules/affine { };