mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-06 10:39:29 +03:00
python3Packages.limits: enable tests
This commit is contained in:
parent
de181bc8f1
commit
a14a3f1e3c
1 changed files with 55 additions and 7 deletions
|
@ -1,21 +1,69 @@
|
|||
{ lib, fetchPypi, buildPythonPackage, six }:
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, hiro
|
||||
, pymemcache
|
||||
, pymongo
|
||||
, pytest-asyncio
|
||||
, pytest-lazy-fixture
|
||||
, pytestCheckHook
|
||||
, pythonOlder
|
||||
, redis
|
||||
, setuptools
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "limits";
|
||||
version = "2.4.0";
|
||||
format = "setuptools";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-jiK2PfJjECB6d7db1HRZnwpGE6fZFjZQ7TpCjpzHrjU=";
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "alisaifee";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
hash = "sha256-KSYcIdLQ6TZpimxXyV88/V35GbBJ/9k9+UBM2KTMRR4=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ six ];
|
||||
propagatedBuildInputs = [
|
||||
setuptools
|
||||
redis
|
||||
pymemcache
|
||||
pymongo
|
||||
];
|
||||
|
||||
doCheck = false; # ifilter
|
||||
checkInputs = [
|
||||
hiro
|
||||
pytest-asyncio
|
||||
pytest-lazy-fixture
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace pytest.ini \
|
||||
--replace "--cov=limits" "" \
|
||||
--replace "-K" ""
|
||||
# redis-py-cluster doesn't support redis > 4
|
||||
substituteInPlace tests/conftest.py \
|
||||
--replace "import rediscluster" ""
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [
|
||||
"limits"
|
||||
];
|
||||
|
||||
pytestFlagsArray = [
|
||||
# All other tests require a running Docker instance
|
||||
"tests/test_limits.py"
|
||||
"tests/test_ratelimit_parser.py"
|
||||
"tests/test_limit_granularities.py"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Rate limiting utilities";
|
||||
license = licenses.mit;
|
||||
homepage = "https://limits.readthedocs.org/";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ ];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue