1{ 2 lib, 3 buildPythonPackage, 4 fetchpatch, 5 fetchPypi, 6 flake8, 7 mock, 8 pep8, 9 pytestCheckHook, 10}: 11 12buildPythonPackage rec { 13 pname = "flake8-polyfill"; 14 version = "1.0.2"; 15 format = "setuptools"; 16 17 src = fetchPypi { 18 inherit pname version; 19 sha256 = "1nlf1mkqw856vi6782qcglqhaacb23khk9wkcgn55npnjxshhjz4"; 20 }; 21 22 propagatedBuildInputs = [ flake8 ]; 23 24 nativeCheckInputs = [ 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 = [ "flake8_polyfill" ]; 46 47 meta = with lib; { 48 homepage = "https://gitlab.com/pycqa/flake8-polyfill"; 49 description = "Polyfill package for Flake8 plugins"; 50 license = licenses.mit; 51 maintainers = with maintainers; [ eadwu ]; 52 }; 53}