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)
This commit is contained in:
		
							parent
							
								
									2c0cc6cedc
								
							
						
					
					
						commit
						c44c00d56c
					
				@ -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}
 | 
			
		||||
 | 
			
		||||
@ -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}
 | 
			
		||||
 | 
			
		||||
@ -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 {
 | 
			
		||||
 | 
			
		||||
@ -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}
 | 
			
		||||
  '';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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}
 | 
			
		||||
  '';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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";
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user