1{ lib
2, buildPythonPackage
3, fetchpatch
4, fetchPypi
5, flake8
6, mock
7, pep8
8, pytestCheckHook
9}:
10
11buildPythonPackage rec {
12 pname = "flake8-polyfill";
13 version = "1.0.2";
14
15 src = fetchPypi {
16 inherit pname version;
17 sha256 = "1nlf1mkqw856vi6782qcglqhaacb23khk9wkcgn55npnjxshhjz4";
18 };
19
20 propagatedBuildInputs = [
21 flake8
22 ];
23
24 checkInputs = [
25 mock
26 pep8
27 pytestCheckHook
28 ];
29
30 patches = [
31 # Skip unnecessary tests on Flake8, https://github.com/PyCQA/pep8-naming/pull/181
32 (fetchpatch {
33 name = "skip-tests.patch";
34 url = "https://github.com/PyCQA/flake8-polyfill/commit/3cf414350e82ceb835ca2edbd5d5967d33e9ff35.patch";
35 sha256 = "mElZafodq8dF3wLO/LOqwFb7eLMsPLlEjNSu5AWqets=";
36 })
37 ];
38
39 postPatch = ''
40 # Failed: [pytest] section in setup.cfg files is no longer supported, change to [tool:pytest] instead.
41 substituteInPlace setup.cfg \
42 --replace pytest 'tool:pytest'
43 '';
44
45 pythonImportsCheck = [
46 "flake8_polyfill"
47 ];
48
49 meta = with lib; {
50 homepage = "https://gitlab.com/pycqa/flake8-polyfill";
51 description = "Polyfill package for Flake8 plugins";
52 license = licenses.mit;
53 maintainers = with maintainers; [ eadwu ];
54 };
55}