Skip to content

Commit

Permalink
Merge pull request #147531 from fabaff/fixflake8-polyfill
Browse files Browse the repository at this point in the history
python3Packages.flake8-polyfill: disable failing tests
  • Loading branch information
fabaff authored Nov 27, 2021
2 parents 821f42f + 8959f7b commit 5614a1a
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 29 deletions.
37 changes: 26 additions & 11 deletions pkgs/development/python-modules/flake8-polyfill/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{ lib, fetchPypi, buildPythonPackage
{ lib
, buildPythonPackage
, fetchpatch
, fetchPypi
, flake8
, mock, pep8, pytest }:
, mock
, pep8
, pytestCheckHook
}:

buildPythonPackage rec {
pname = "flake8-polyfill";
Expand All @@ -11,26 +17,35 @@ buildPythonPackage rec {
sha256 = "1nlf1mkqw856vi6782qcglqhaacb23khk9wkcgn55npnjxshhjz4";
};

postPatch = ''
# Failed: [pytest] section in setup.cfg files is no longer supported, change to [tool:pytest] instead.
substituteInPlace setup.cfg \
--replace pytest 'tool:pytest'
'';

propagatedBuildInputs = [
flake8
];

checkInputs = [
mock
pep8
pytest
pytestCheckHook
];

patches = [
# Skip unnecessary tests on Flake8, https://github.com/PyCQA/pep8-naming/pull/181
(fetchpatch {
name = "skip-tests.patch";
url = "https://github.com/PyCQA/flake8-polyfill/commit/3cf414350e82ceb835ca2edbd5d5967d33e9ff35.patch";
sha256 = "mElZafodq8dF3wLO/LOqwFb7eLMsPLlEjNSu5AWqets=";
})
];

checkPhase = ''
pytest tests
postPatch = ''
# Failed: [pytest] section in setup.cfg files is no longer supported, change to [tool:pytest] instead.
substituteInPlace setup.cfg \
--replace pytest 'tool:pytest'
'';

pythonImportsCheck = [
"flake8_polyfill"
];

meta = with lib; {
homepage = "https://gitlab.com/pycqa/flake8-polyfill";
description = "Polyfill package for Flake8 plugins";
Expand Down
10 changes: 10 additions & 0 deletions pkgs/development/python-modules/pep8-naming/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ lib
, fetchPypi
, fetchpatch
, buildPythonPackage
, flake8
, flake8-polyfill
Expand All @@ -20,6 +21,15 @@ buildPythonPackage rec {
flake8-polyfill
];

patches = [
# Add missing option to get passing tests, https://github.com/PyCQA/pep8-naming/pull/181
(fetchpatch {
name = "add-missing-option.patch";
url = "https://github.com/PyCQA/pep8-naming/commit/03b8f36f6a8bb8bc79dfa5a71ad9be2a0bf8bbf5.patch";
sha256 = "1YTh84Yoj0MqFZoifM362563r1GuzaF+mMmdT/ckC7I=";
})
];

checkPhase = ''
runHook preCheck
${python.interpreter} run_tests.py
Expand Down
41 changes: 23 additions & 18 deletions pkgs/development/python-modules/pylint-django/default.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
{ buildPythonPackage
{ lib
, buildPythonPackage
, coverage
, django
, factory_boy
, fetchFromGitHub
, isPy3k
, lib

# pythonPackages
, django
, pylint-plugin-utils

# pythonPackages for checkInputs
, coverage
, factory_boy
, pytest
, pytestCheckHook
}:

buildPythonPackage rec {
Expand All @@ -30,17 +26,26 @@ buildPythonPackage rec {
pylint-plugin-utils
];

checkInputs = [ coverage factory_boy pytest ];
checkInputs = [
coverage
factory_boy
pytestCheckHook
];

disabledTests = [
# Skip outdated tests and the one with a missing dependency (django_tables2)
"external_django_tables2_noerror_meta_class"
"external_factory_boy_noerror"
"func_noerror_foreign_key_attributes"
"func_noerror_foreign_key_key_cls_unbound"
];

# Check command taken from scripts/test.sh
# Skip test external_django_tables2_noerror_meta_class:
# requires an unpackaged django_tables2
checkPhase = ''
python pylint_django/tests/test_func.py -v -k "not tables2"
'';
pythonImportsCheck = [
"pylint_django"
];

meta = with lib; {
description = "A Pylint plugin to analyze Django applications";
description = "Pylint plugin to analyze Django applications";
homepage = "https://github.com/PyCQA/pylint-django";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ kamadorueda ];
Expand Down

0 comments on commit 5614a1a

Please sign in to comment.