1{ lib
2, buildPythonPackage
3, fetchPypi
4, setuptools_scm
5, isPy3k
6, pytest
7, pytest-black
8, pytest-flake8
9, pytestcov
10}:
11
12buildPythonPackage rec {
13 pname = "backports.functools_lru_cache";
14 version = "1.6.3";
15
16 src = fetchPypi {
17 inherit pname version;
18 sha256 = "d84e126e2a29e4fde8931ff8131240bbf30a0e7dbcc3897a8dbd8ea5ac11419c";
19 };
20
21 nativeBuildInputs = [ setuptools_scm ];
22
23 checkInputs = [ pytest pytest-flake8 pytest-black pytestcov ];
24 # ironically, they fail a linting test, and pytest.ini forces that test suite
25 checkPhase = ''
26 rm backports/functools_lru_cache.py
27 pytest -k 'not format'
28 '';
29
30 # Test fail on Python 2
31 doCheck = isPy3k;
32
33 meta = {
34 description = "Backport of functools.lru_cache";
35 homepage = "https://github.com/jaraco/backports.functools_lru_cache";
36 license = lib.licenses.mit;
37 };
38}