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.
This commit is contained in:
Frederik Rietdijk 2018-01-20 13:31:14 +01:00
parent b4d9aaabda
commit 1623c8371c
11 changed files with 10 additions and 46 deletions

View File

@ -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 = {

View File

@ -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
'';

View File

@ -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; {

View File

@ -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
'';

View File

@ -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 = ''

View File

@ -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

View File

@ -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
'';

View File

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

View File

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

View File

@ -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/;

View File

@ -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;