diff --git a/pkgs/development/python-modules/cssselect2/default.nix b/pkgs/development/python-modules/cssselect2/default.nix index 381c114b44e..45a9920dbe2 100644 --- a/pkgs/development/python-modules/cssselect2/default.nix +++ b/pkgs/development/python-modules/cssselect2/default.nix @@ -1,4 +1,4 @@ -{ lib, buildPythonPackage, fetchPypi, tinycss2, pytest, pytestrunner, pytestcov, pytest-flake8, pytest-isort, glibcLocales }: +{ lib, buildPythonPackage, fetchPypi, tinycss2, pytest, pytestrunner }: buildPythonPackage rec { pname = "cssselect2"; @@ -9,11 +9,21 @@ buildPythonPackage rec { sha256 = "505d2ce3d3a1d390ddb52f7d0864b7efeb115a5b852a91861b498b92424503ab"; }; + # We're not interested in code quality tests + postPatch = '' + substituteInPlace setup.py \ + --replace "pytest-cov" "" \ + --replace "pytest-flake8" "" \ + --replace "pytest-isort" "" + substituteInPlace setup.cfg \ + --replace "--cov=cssselect2" "" \ + --replace "--flake8" "" \ + --replace "--isort" "" + ''; + propagatedBuildInputs = [ tinycss2 ]; - checkInputs = [ pytest pytestrunner pytestcov pytest-flake8 pytest-isort glibcLocales ]; - - LC_ALL = "en_US.UTF-8"; + checkInputs = [ pytest pytestrunner ]; meta = with lib; { description = "CSS selectors for Python ElementTree"; diff --git a/pkgs/development/python-modules/isort/default.nix b/pkgs/development/python-modules/isort/default.nix index 5a7e50d4332..bb9958a6fef 100644 --- a/pkgs/development/python-modules/isort/default.nix +++ b/pkgs/development/python-modules/isort/default.nix @@ -1,22 +1,24 @@ -{ lib, buildPythonPackage, fetchPypi, isPy27, futures, mock, pytest }: +{ lib, buildPythonPackage, fetchPypi, isPy27, futures, backports_functools_lru_cache, mock, pytest }: -buildPythonPackage rec { +let + skipTests = lib.optional isPy27 "test_standard_library_deprecates_user_issue_778"; + testOpts = lib.concatMapStringsSep " " (t: "--deselect test_isort.py::${t}") skipTests; +in buildPythonPackage rec { pname = "isort"; - version = "4.3.4"; + version = "4.3.16"; # Note 4.x is the last version that supports Python2 src = fetchPypi { inherit pname version; - sha256 = "1y0yfv56cqyh9wyg7kxxv9y5wmfgcq18n7a49mp7xmzka2bhxi5r"; + sha256 = "1v6lapqhc33rxr9698lqjyb49fis27i42p3ymngrw95py3qf7y08"; }; - propagatedBuildInputs = lib.optional isPy27 futures; + propagatedBuildInputs = lib.optionals isPy27 [ futures backports_functools_lru_cache ]; checkInputs = [ mock pytest ]; + # isort excludes paths that contain /build/, so test fixtures don't work with TMPDIR=/build/ checkPhase = '' - py.test test_isort.py -k "not test_long_line_comments \ - and not test_import_case_produces_inconsistent_results_issue_472 \ - and not test_no_extra_lines_issue_557" + PATH=$out/bin:$PATH TMPDIR=/tmp/ pytest ${testOpts} ''; meta = with lib; {