2017-12-30 12:36:54 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, setuptools_scm
|
2019-07-21 10:23:00 +01:00
|
|
|
, isPy3k
|
|
|
|
, pytest
|
2019-12-20 17:30:23 +00:00
|
|
|
, pytest-black
|
|
|
|
, pytest-flake8
|
|
|
|
, pytestcov
|
2017-12-30 12:36:54 +00:00
|
|
|
}:
|
|
|
|
|
2019-07-21 10:23:00 +01:00
|
|
|
buildPythonPackage rec {
|
2017-12-30 12:36:54 +00:00
|
|
|
pname = "backports.functools_lru_cache";
|
2021-03-24 09:28:09 +00:00
|
|
|
version = "1.6.3";
|
2017-12-30 12:36:54 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-03-24 09:28:09 +00:00
|
|
|
sha256 = "d84e126e2a29e4fde8931ff8131240bbf30a0e7dbcc3897a8dbd8ea5ac11419c";
|
2017-12-30 12:36:54 +00:00
|
|
|
};
|
|
|
|
|
2019-12-20 17:30:23 +00:00
|
|
|
nativeBuildInputs = [ setuptools_scm ];
|
2019-07-21 10:23:00 +01:00
|
|
|
|
2019-12-20 17:30:23 +00:00
|
|
|
checkInputs = [ pytest pytest-flake8 pytest-black pytestcov ];
|
|
|
|
# ironically, they fail a linting test, and pytest.ini forces that test suite
|
2019-07-21 10:23:00 +01:00
|
|
|
checkPhase = ''
|
2019-12-20 17:30:23 +00:00
|
|
|
rm backports/functools_lru_cache.py
|
|
|
|
pytest -k 'not format'
|
2019-07-21 10:23:00 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
# Test fail on Python 2
|
|
|
|
doCheck = isPy3k;
|
2017-12-30 12:36:54 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Backport of functools.lru_cache";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/jaraco/backports.functools_lru_cache";
|
2017-12-30 12:36:54 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
};
|
2019-12-20 17:30:23 +00:00
|
|
|
}
|