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