summary refs log tree commit diff
path: root/pkgs/development/python-modules/backports_functools_lru_cache/default.nix
blob: 586176300b7dde98d77cbd125219aaea706b8097 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ lib
, buildPythonPackage
, fetchPypi
, setuptools-scm
, isPy3k
, pytest
, pytest-black
, pytest-flake8
, pytestcov
}:

buildPythonPackage rec {
  pname = "backports.functools_lru_cache";
  version = "1.6.4";

  src = fetchPypi {
    inherit pname version;
    sha256 = "d5ed2169378b67d3c545e5600d363a923b09c456dab1593914935a68ad478271";
  };

  nativeBuildInputs = [ setuptools-scm ];

  checkInputs = [ pytest pytest-flake8 pytest-black pytestcov ];
  # ironically, they fail a linting test, and pytest.ini forces that test suite
  checkPhase = ''
    rm backports/functools_lru_cache.py
    pytest -k 'not format'
  '';

  # Test fail on Python 2
  doCheck = isPy3k;

  meta = {
    description = "Backport of functools.lru_cache";
    homepage = "https://github.com/jaraco/backports.functools_lru_cache";
    license = lib.licenses.mit;
  };
}