Browse Source

buildPythonPackage: rename nix_run_setup.py to nix_run_setup

If the extension is .py it tends to be picked up by tools, breaking for
example tests.
nixos-19.03
Frederik Rietdijk 4 years ago
parent
commit
1623c8371c
  1. 2
      pkgs/applications/version-management/nbstripout/default.nix
  2. 8
      pkgs/development/interpreters/python/build-python-package-setuptools.nix
  3. 2
      pkgs/development/python-modules/django_guardian/default.nix
  4. 4
      pkgs/development/python-modules/intervaltree/default.nix
  5. 4
      pkgs/development/python-modules/natsort/default.nix
  6. 20
      pkgs/development/python-modules/natsort/setup.patch
  7. 2
      pkgs/development/python-modules/progressbar2/default.nix
  8. 2
      pkgs/development/python-modules/pytest-flake8/default.nix
  9. 1
      pkgs/development/python-modules/python-utils/default.nix
  10. 3
      pkgs/tools/backup/borg/default.nix
  11. 8
      pkgs/top-level/python-packages.nix

2
pkgs/applications/version-management/nbstripout/default.nix

@ -25,7 +25,7 @@ buildPythonApplication rec {
# ignore flake8 tests for the nix wrapped setup.py
checkPhase = ''
PATH=$PATH:$out/bin:${mercurial}/bin pytest --ignore=nix_run_setup.py .
PATH=$PATH:$out/bin:${mercurial}/bin pytest .
'';
meta = {

8
pkgs/development/interpreters/python/build-python-package-setuptools.nix

@ -21,18 +21,18 @@ let
setuppy = ./run_setup.py;
in attrs // {
# we copy nix_run_setup.py over so it's executed relative to the root of the source
# we copy nix_run_setup over so it's executed relative to the root of the source
# many project make that assumption
buildPhase = attrs.buildPhase or ''
runHook preBuild
cp ${setuppy} nix_run_setup.py
${python.interpreter} nix_run_setup.py ${lib.optionalString (setupPyBuildFlags != []) ("build_ext " + (lib.concatStringsSep " " setupPyBuildFlags))} bdist_wheel
cp ${setuppy} nix_run_setup
${python.interpreter} nix_run_setup ${lib.optionalString (setupPyBuildFlags != []) ("build_ext " + (lib.concatStringsSep " " setupPyBuildFlags))} bdist_wheel
runHook postBuild
'';
installCheckPhase = attrs.checkPhase or ''
runHook preCheck
${python.interpreter} nix_run_setup.py test
${python.interpreter} nix_run_setup test
runHook postCheck
'';

2
pkgs/development/python-modules/django_guardian/default.nix

@ -16,7 +16,7 @@ buildPythonPackage rec {
propagatedBuildInputs = [ django six ];
checkPhase = ''
${python.interpreter} nix_run_setup.py test --addopts="--ignore build"
${python.interpreter} nix_run_setup test --addopts="--ignore build"
'';
meta = with stdenv.lib; {

4
pkgs/development/python-modules/intervaltree/default.nix

@ -17,10 +17,8 @@ buildPythonPackage rec {
checkPhase = ''
runHook preCheck
# pytest will try to run tests for nix_run_setup.py / files in build/lib which fails
mv nix_run_setup.py run_setup
rm build -rf
${python.interpreter} run_setup test
${python.interpreter} nix_run_setup test
runHook postCheck
'';

4
pkgs/development/python-modules/natsort/default.nix

@ -39,9 +39,7 @@ buildPythonPackage rec {
sha256 = "9ffbfb74bf3fc3905be1b9b052ed865675651e38fcd972ed1ed5c64a02f93cbd";
};
# do not run checks on nix_run_setup.py
patches = lib.singleton ./setup.patch
++ lib.optional (isPy35 || isPy36) ./python-3.6.3-test-failures.patch;
patches = lib.optional (isPy35 || isPy36) ./python-3.6.3-test-failures.patch;
# testing based on project's tox.ini
checkPhase = ''

20
pkgs/development/python-modules/natsort/setup.patch

@ -1,20 +0,0 @@
diff --git a/setup.cfg b/setup.cfg
index 604994d..e38c3ec 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -6,6 +6,7 @@ formats = gztar
[tool:pytest]
flakes-ignore =
+ nix_run_setup.py ALL
natsort/compat/py23.py UndefinedName
natsort/__init__.py UnusedImport
natsort/compat/* UnusedImport
@@ -14,6 +15,7 @@ flakes-ignore =
test_natsort/test_locale_help.py UnusedImport RedefinedWhileUnused
test_natsort/compat/* UnusedImport
pep8ignore =
+ nix_run_setup.py ALL
natsort/ns_enum.py E126 E241 E123 E221
test_natsort/test_*.py E501 E241 E221
test_natsort/test_natsort_keygen.py E501 E241 E221 E701

2
pkgs/development/python-modules/progressbar2/default.nix

@ -37,7 +37,7 @@ buildPythonPackage rec {
# ignore tests on the nix wrapped setup.py and don't flake .eggs directory
checkPhase = ''
runHook preCheck
${python.interpreter} setup.py test --addopts "--ignore=nix_run_setup.py --ignore=.eggs"
${python.interpreter} setup.py test --addopts "--ignore=.eggs"
runHook postCheck
'';

2
pkgs/development/python-modules/pytest-flake8/default.nix

@ -17,7 +17,7 @@ buildPythonPackage rec {
};
checkPhase = ''
pytest --ignore=nix_run_setup.py .
pytest .
'';
meta = {

1
pkgs/development/python-modules/python-utils/default.nix

@ -23,7 +23,6 @@ buildPythonPackage rec {
doCheck = false;
checkPhase = ''
rm nix_run_setup.py
py.test
'';

3
pkgs/tools/backup/borg/default.nix

@ -41,9 +41,6 @@ python3Packages.buildPythonApplication rec {
cp -R docs/_build/man $out/share/man/man1
'';
# tests fail due to missing test command in nix_run_setup.py
doCheck = false;
meta = with stdenv.lib; {
description = "A deduplicating backup program (attic fork)";
homepage = https://borgbackup.github.io/;

8
pkgs/top-level/python-packages.nix

@ -10767,14 +10767,6 @@ in {
];
LC_ALL = "en_US.UTF-8";
# Remove test that fails due to missing encoding in nix_run_setup.py, a
# file that buildPythonPackage copies to source trees at build time.
# PR with fix: https://github.com/NixOS/nixpkgs/pull/17430
# ("python: add file encoding to run_setup.py")
preBuild = ''
rm tests/test_encoding.py
'';
meta = {
description = "Python multimedia tagging library";
homepage = http://code.google.com/p/mutagen;

Loading…
Cancel
Save