1{lib, buildPythonPackage, fetchPypi, fetchpatch, pytest, flake8}:
2
3buildPythonPackage rec {
4 name = "${pname}-${version}";
5 pname = "pytest-flake8";
6 version = "0.8.1";
7
8 # although pytest is a runtime dependency, do not add it as
9 # propagatedBuildInputs in order to allow packages depend on another version
10 # of pytest more easily
11 buildInputs = [ pytest ];
12 propagatedBuildInputs = [ flake8 ];
13
14 src = fetchPypi {
15 inherit pname version;
16 sha256 = "1za5i09gz127yraigmcl443w6149714l279rmlfxg1bl2kdsc45a";
17 };
18
19 patches = [
20 # Fix pytest strict mode (pull request #24)
21 # https://github.com/tholo/pytest-flake8/pull/24
22 (fetchpatch {
23 name = "fix-compatibility-with-pytest-strict-mode.patch";
24 url = "https://github.com/tholo/pytest-flake8/commit/434e1b07b4b77bfe1ddb9b2b54470c6c3815bb1a.patch";
25 sha256 = "0idwgkwwysx2cibnykd81yxrgqzkpf42j99jmpnanqzi99qnc3wx";
26 })
27 ];
28
29 checkPhase = ''
30 pytest --ignore=nix_run_setup.py .
31 '';
32
33 meta = {
34 description = "py.test plugin for efficiently checking PEP8 compliance";
35 homepage = https://github.com/tholo/pytest-flake8;
36 maintainers = with lib.maintainers; [ jluttine ];
37 license = lib.licenses.bsd2;
38 };
39}