diff options
author | Rok Garbas <rok@garbas.si> | 2014-10-23 12:07:07 +0200 |
---|---|---|
committer | Rok Garbas <rok@garbas.si> | 2014-10-24 10:44:15 +0200 |
commit | c44c00d56c0536a7b75ba78df5ad3fb1def7c681 (patch) | |
tree | 28df57f7954c33b9f2e736ca8bb0e9f15753051d | |
parent | 2c0cc6cedc2bbcaa273facc2251f147050ab4d9c (diff) | |
download | nixlib-c44c00d56c0536a7b75ba78df5ad3fb1def7c681.tar nixlib-c44c00d56c0536a7b75ba78df5ad3fb1def7c681.tar.gz nixlib-c44c00d56c0536a7b75ba78df5ad3fb1def7c681.tar.bz2 nixlib-c44c00d56c0536a7b75ba78df5ad3fb1def7c681.tar.lz nixlib-c44c00d56c0536a7b75ba78df5ad3fb1def7c681.tar.xz nixlib-c44c00d56c0536a7b75ba78df5ad3fb1def7c681.tar.zst nixlib-c44c00d56c0536a7b75ba78df5ad3fb1def7c681.zip |
python: adding test/test_support.py module in all python versions
- test/test_support.py module is used by many libraries which backport python 3.0 functionality to 2.6/2.7 - enable subprocess32 tests (now passing for python 2.6/2.7)
-rw-r--r-- | pkgs/development/interpreters/python/2.6/default.nix | 9 | ||||
-rw-r--r-- | pkgs/development/interpreters/python/2.7/default.nix | 11 | ||||
-rw-r--r-- | pkgs/development/interpreters/python/3.2/default.nix | 12 | ||||
-rw-r--r-- | pkgs/development/interpreters/python/3.3/default.nix | 12 | ||||
-rw-r--r-- | pkgs/development/interpreters/python/3.4/default.nix | 13 | ||||
-rw-r--r-- | pkgs/top-level/python-packages.nix | 16 |
6 files changed, 65 insertions, 8 deletions
diff --git a/pkgs/development/interpreters/python/2.6/default.nix b/pkgs/development/interpreters/python/2.6/default.nix index 97c96133aa5c..c151db8ea18f 100644 --- a/pkgs/development/interpreters/python/2.6/default.nix +++ b/pkgs/development/interpreters/python/2.6/default.nix @@ -67,7 +67,14 @@ let postInstall = '' - rm -rf "$out/lib/python${majorVersion}/test" + # needed for some packages, especially packages that backport + # functionality to 2.x from 3.x + for item in $out/lib/python${majorVersion}/test/*; do + if [[ "$item" != */test_support.py* ]]; then + rm -rf "$item" + fi + done + touch $out/lib/python${majorVersion}/test/__init__.py ln -s $out/lib/python${majorVersion}/pdb.py $out/bin/pdb ln -s $out/lib/python${majorVersion}/pdb.py $out/bin/pdb${majorVersion} mv $out/share/man/man1/{python.1,python2.6.1} diff --git a/pkgs/development/interpreters/python/2.7/default.nix b/pkgs/development/interpreters/python/2.7/default.nix index f9c7b4fb26ab..7ebc9d3e3566 100644 --- a/pkgs/development/interpreters/python/2.7/default.nix +++ b/pkgs/development/interpreters/python/2.7/default.nix @@ -73,7 +73,16 @@ let postInstall = '' - rm -rf "$out/lib/python${majorVersion}/test" + # needed for some packages, especially packages that backport + # functionality to 2.x from 3.x + for item in $out/lib/python${majorVersion}/test/*; do + if [[ "$item" != */test_support.py* ]]; then + rm -rf "$item" + else + echo $item + fi + done + touch $out/lib/python${majorVersion}/test/__init__.py ln -s $out/lib/python${majorVersion}/pdb.py $out/bin/pdb ln -s $out/lib/python${majorVersion}/pdb.py $out/bin/pdb${majorVersion} ln -s $out/share/man/man1/{python2.7.1.gz,python.1.gz} diff --git a/pkgs/development/interpreters/python/3.2/default.nix b/pkgs/development/interpreters/python/3.2/default.nix index dcc90ea5519c..c684266f8225 100644 --- a/pkgs/development/interpreters/python/3.2/default.nix +++ b/pkgs/development/interpreters/python/3.2/default.nix @@ -58,8 +58,18 @@ stdenv.mkDerivation { setupHook = ./setup-hook.sh; postInstall = '' - rm -rf "$out/lib/python${majorVersion}/test" + # needed for some packages, especially packages that backport functionality + # to 2.x from 3.x + for item in $out/lib/python${majorVersion}/test/*; do + if [[ "$item" != */test_support.py* ]]; then + rm -rf "$item" + else + echo $item + fi + done + touch $out/lib/python${majorVersion}/test/__init__.py ln -s "$out/include/python${majorVersion}m" "$out/include/python${majorVersion}" + paxmark E $out/bin/python${majorVersion} ''; passthru = rec { diff --git a/pkgs/development/interpreters/python/3.3/default.nix b/pkgs/development/interpreters/python/3.3/default.nix index 450abfa772bc..b9ab82316135 100644 --- a/pkgs/development/interpreters/python/3.3/default.nix +++ b/pkgs/development/interpreters/python/3.3/default.nix @@ -53,9 +53,17 @@ stdenv.mkDerivation { setupHook = ./setup-hook.sh; postInstall = '' - rm -rf "$out/lib/python${majorVersion}/test" + # needed for some packages, especially packages that backport functionality + # to 2.x from 3.x + for item in $out/lib/python${majorVersion}/test/*; do + if [[ "$item" != */test_support.py* ]]; then + rm -rf "$item" + else + echo $item + fi + done + touch $out/lib/python${majorVersion}/test/__init__.py ln -s "$out/include/python${majorVersion}m" "$out/include/python${majorVersion}" - paxmark E $out/bin/python${majorVersion} ''; diff --git a/pkgs/development/interpreters/python/3.4/default.nix b/pkgs/development/interpreters/python/3.4/default.nix index b76b00047ba6..e585c6c148dd 100644 --- a/pkgs/development/interpreters/python/3.4/default.nix +++ b/pkgs/development/interpreters/python/3.4/default.nix @@ -54,9 +54,18 @@ stdenv.mkDerivation { setupHook = ./setup-hook.sh; postInstall = '' - rm -rf "$out/lib/python${majorVersion}/test" - ln -s "$out/include/python${majorVersion}m" "$out/include/python${majorVersion}" + # needed for some packages, especially packages that backport functionality + # to 2.x from 3.x + for item in $out/lib/python${majorVersion}/test/*; do + if [[ "$item" != */test_support.py* ]]; then + rm -rf "$item" + else + echo $item + fi + done + touch $out/lib/python${majorVersion}/test/__init__.py + ln -s "$out/include/python${majorVersion}m" "$out/include/python${majorVersion}" paxmark E $out/bin/python${majorVersion} ''; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a416a93af651..809e648e9101 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8608,7 +8608,21 @@ let md5 = "754c5ab9f533e764f931136974b618f1"; }; - doCheck = false; + buildInputs = [ pkgs.bash ]; + + preConfigure = '' + substituteInPlace test_subprocess32.py \ + --replace '/usr/' '${pkgs.bash}/' + ''; + + checkPhase = '' + TMP_PREFIX=`pwd`/tmp/$name + TMP_INSTALL_DIR=$TMP_PREFIX/lib/${pythonPackages.python.libPrefix}/site-packages + PYTHONPATH="$TMP_INSTALL_DIR:$PYTHONPATH" + mkdir -p $TMP_INSTALL_DIR + python setup.py develop --prefix $TMP_PREFIX + python test_subprocess32.py + ''; meta = { homepage = "https://pypi.python.org/pypi/subprocess32"; |