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

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