def install_and_test_cffi(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://pypi.python.org/packages/source/c/cffi/cffi-1.2.1.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "cffi-1.2.1.tar.gz"], cwd=SRC_DIR) CFFI_DIR = os.path.abspath(os.path.join(SRC_DIR, "cffi-1.2.1")) PATCH_FILE = os.path.abspath( os.path.join(os.path.dirname(__file__), "cffi-1.2.1.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=CFFI_DIR) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=CFFI_DIR) # looks like clang 3.5 causes more errors like: 214 != -42 doing casts if os.environ.has_key("CC") and "clang" in os.environ["CC"]: expected = [{ "failed": 20, "passed": 1659, "skipped": 73, "xfailed": 4 }] else: expected = [{ "failed": 11, "passed": 1668, "skipped": 73, "xfailed": 4 }] run_test([PYTEST_EXE], cwd=CFFI_DIR, expected=expected)
def install_and_test_pyicu(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "http://download.icu-project.org/files/icu4c/4.2.1/icu4c-4_2_1-src.tgz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "icu4c-4_2_1-src.tgz"], cwd=SRC_DIR) ICU_DIR = os.path.abspath(os.path.join(SRC_DIR, "icu", "source")) INSTALL_DIR = os.path.join(SRC_DIR, "icu_install") subprocess.check_call(["./runConfigureICU", "Linux", "--prefix=" + INSTALL_DIR], cwd=ICU_DIR) subprocess.check_call(["make", "-j4"], cwd=ICU_DIR) subprocess.check_call(["make", "install"], cwd=ICU_DIR) url = "https://pypi.python.org/packages/source/P/PyICU/PyICU-1.0.1.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "PyICU-1.0.1.tar.gz"], cwd=SRC_DIR) PYICU_DIR = os.path.abspath(os.path.join(SRC_DIR, "PyICU-1.0.1")) PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "pyicu_101.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=PYICU_DIR) print "Applied PyICU patch" env = os.environ INC_DIR = os.path.abspath(os.path.join(INSTALL_DIR, "include")) LIB_DIR = os.path.abspath(os.path.join(INSTALL_DIR, "lib")) env["CFLAGS"] = env["CXXFLAGS"] = " ".join(["-I" + INC_DIR, "-L" + LIB_DIR]) env["LD_LIBRARY_PATH"] = LIB_DIR subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=PYICU_DIR, env=env) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=PYICU_DIR, env=env) expected = [] run_test([PYTHON_EXE, "setup.py", "test"], cwd=PYICU_DIR, expected=expected)
def install_and_test_protobuf(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "http://archive.ubuntu.com/ubuntu/pool/main/p/protobuf/protobuf_2.5.0.orig.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "protobuf_2.5.0.orig.tar.gz"], cwd=SRC_DIR) PROTOBUF_DIR = os.path.abspath(os.path.join(SRC_DIR, "protobuf-2.5.0")) INSTALL_DIR = os.path.join(SRC_DIR, "protobuf_install") subprocess.check_call(["./configure", "--prefix=" + INSTALL_DIR], cwd=PROTOBUF_DIR) subprocess.check_call(["make", "-j4"], cwd=PROTOBUF_DIR) subprocess.check_call(["make", "install"], cwd=PROTOBUF_DIR) PROTOBUF_PY_DIR = os.path.join(PROTOBUF_DIR, "python") env = os.environ env["PATH"] = env["PATH"] + ":" + os.path.join(INSTALL_DIR, "bin") env["LD_LIBRARY_PATH"] = os.path.join(INSTALL_DIR, "lib") subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=PROTOBUF_PY_DIR, env=env) expected = [{"ran": 216}] expected_log_hash = ''' gAAQSBxQEAxCwBwkAAREFCAUCQAAiAsIBggpNIQAAIBBBAAEAAQQAAADDEgABFI9QpcAlQAAgwEi HEAJAESKkAKBGAAlpAAIAMggcAgAQQsQMwCkEgAisDKIAhEhABCMEE4CBAAEQQQAgIAIiIAEJBIy gUBSkjAAIAUAQA8EIAI= ''' run_test([PYTHON_EXE, "setup.py", "test"], cwd=PROTOBUF_PY_DIR, expected=expected, env=env, expected_log_hash=expected_log_hash)
def install_and_test_protobuf(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "http://archive.ubuntu.com/ubuntu/pool/main/p/protobuf/protobuf_2.5.0.orig.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "protobuf_2.5.0.orig.tar.gz"], cwd=SRC_DIR) PROTOBUF_DIR = os.path.abspath(os.path.join(SRC_DIR, "protobuf-2.5.0")) INSTALL_DIR = os.path.join(SRC_DIR, "protobuf_install") subprocess.check_call(["./configure", "--prefix="+INSTALL_DIR], cwd=PROTOBUF_DIR) subprocess.check_call(["make", "-j4"], cwd=PROTOBUF_DIR) subprocess.check_call(["make", "install"], cwd=PROTOBUF_DIR) PROTOBUF_PY_DIR = os.path.join(PROTOBUF_DIR, "python") env = os.environ env["PATH"] = env["PATH"] + ":" + os.path.join(INSTALL_DIR, "bin") env["LD_LIBRARY_PATH"] = os.path.join(INSTALL_DIR, "lib") subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=PROTOBUF_PY_DIR, env=env) expected = [{"ran": 216}] expected_log_hash = ''' gAAQSBxQEAxCwBwkAAREFCAUCQAAiAsIBggpNIQAAIBBBAAEAAQQAAADDEgABFI9QpcAlQAAgwEi HEAJAESKkAKBGAAlpAAIAMggcAgAQQsQMwCkEgAisDKIAhEhABCMEE4CBAAEQQQAgIAIiIAEJBIy gUBSkjAAIAUAQA8EIAI= ''' run_test([PYTHON_EXE, "setup.py", "test"], cwd=PROTOBUF_PY_DIR, expected=expected, env=env, expected_log_hash=expected_log_hash)
def install_and_test_cffi(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://pypi.python.org/packages/83/3c/00b553fd05ae32f27b3637f705c413c4ce71290aa9b4c4764df694e906d9/cffi-1.7.0.tar.gz#md5=34122a545060cee58bab88feab57006d" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "cffi-1.7.0.tar.gz"], cwd=SRC_DIR) CFFI_DIR = os.path.abspath(os.path.join(SRC_DIR, "cffi-1.7.0")) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=CFFI_DIR) # looks like clang 3.5 causes more errors like: 214 != -42 doing casts if os.environ.has_key("CC") and "clang" in os.environ["CC"]: expected = [{'xfailed': 4, 'failed': 3, 'skipped': 10, 'passed': 539}] else: expected = [{'xfailed': 4, 'failed': 2, 'skipped': 10, 'passed': 540}] # Ideally we would run all the tests, but they take ~10min to run. # dir_to_test = "." # I just picked a subdirectory; I don't really know what it's testing. dir_to_test = os.path.join(CFFI_DIR, "testing", "cffi1") expected_log_hash = ''' gBEACAAQEAIAwICAAAAAAABAAAAAAAACAAAAEAAAEAAAAEQEQAAAAKAAARFEEACKAAABAACAAAAA QgAAAEAQBAACgAEAAABAAAAAAAFAAAoAAAAAAACAAAACAAIAAUiAIAAAAAODgAAgEIQBABAACgAC GBACAAAAICEAABAAgQA= ''' run_test([PYTEST_EXE, dir_to_test], cwd=CFFI_DIR, expected=expected, expected_log_hash=expected_log_hash)
def install_and_test_lxml(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "http://cython.org/release/Cython-0.22.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "Cython-0.22.tar.gz"], cwd=SRC_DIR) CYTHON_DIR = os.path.abspath(os.path.join(SRC_DIR, "Cython-0.22")) PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "integration", "Cython-0.22.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=CYTHON_DIR) print "Applied Cython patch" subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=CYTHON_DIR) subprocess.check_call([PYTHON_EXE, "-c", "import Cython"], cwd=CYTHON_DIR) url = "https://pypi.python.org/packages/source/l/lxml/lxml-3.0.1.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "lxml-3.0.1.tar.gz"], cwd=SRC_DIR) LXML_DIR = os.path.abspath(os.path.join(SRC_DIR, "lxml-3.0.1")) PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "lxml_patch.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=LXML_DIR) print "Applied lxml patch" subprocess.check_call([PYTHON_EXE, "setup.py", "build_ext", "-i", "--with-cython"], cwd=LXML_DIR) # We currently don't run the objectify tests because the assume that the python impl use refcounting. expected = [{'ran': 1188, 'failures': 3, 'errors': 1}] run_test([PYTHON_EXE, "test.py", "!.*test_objectify.py"], cwd=LXML_DIR, expected=expected)
def install_and_test_protobuf(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "http://archive.ubuntu.com/ubuntu/pool/main/p/protobuf/protobuf_2.5.0.orig.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "protobuf_2.5.0.orig.tar.gz"], cwd=SRC_DIR) PROTOBUF_DIR = os.path.abspath(os.path.join(SRC_DIR, "protobuf-2.5.0")) INSTALL_DIR = os.path.join(SRC_DIR, "protobuf_install") subprocess.check_call(["./configure", "--prefix=" + INSTALL_DIR], cwd=PROTOBUF_DIR) subprocess.check_call(["make", "-j4"], cwd=PROTOBUF_DIR) subprocess.check_call(["make", "install"], cwd=PROTOBUF_DIR) PROTOBUF_PY_DIR = os.path.join(PROTOBUF_DIR, "python") env = os.environ env["PATH"] = env["PATH"] + ":" + os.path.join(INSTALL_DIR, "bin") env["LD_LIBRARY_PATH"] = os.path.join(INSTALL_DIR, "lib") subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=PROTOBUF_PY_DIR, env=env) expected = [{"failures": 0, "errors": 1}] run_test([PYTHON_EXE, "setup.py", "test"], cwd=PROTOBUF_PY_DIR, expected=expected, env=env)
def install_and_test_pyicu(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "http://download.icu-project.org/files/icu4c/4.2.1/icu4c-4_2_1-src.tgz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "icu4c-4_2_1-src.tgz"], cwd=SRC_DIR) ICU_DIR = os.path.abspath(os.path.join(SRC_DIR, "icu", "source")) INSTALL_DIR = os.path.join(SRC_DIR, "icu_install") subprocess.check_call(["./runConfigureICU", "Linux", "--prefix=" + INSTALL_DIR], cwd=ICU_DIR) subprocess.check_call(["make", "-j4"], cwd=ICU_DIR) subprocess.check_call(["make", "install"], cwd=ICU_DIR) url = "https://pypi.python.org/packages/source/P/PyICU/PyICU-1.0.1.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "PyICU-1.0.1.tar.gz"], cwd=SRC_DIR) PYICU_DIR = os.path.abspath(os.path.join(SRC_DIR, "PyICU-1.0.1")) PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "pyicu_101.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=PYICU_DIR) print "Applied PyICU patch" env = os.environ INC_DIR = os.path.abspath(os.path.join(INSTALL_DIR, "include")) LIB_DIR = os.path.abspath(os.path.join(INSTALL_DIR, "lib")) env["CFLAGS"] = env["CXXFLAGS"] = " ".join(["-I" + INC_DIR, "-L" + LIB_DIR]) env["LD_LIBRARY_PATH"] = LIB_DIR subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=PYICU_DIR, env=env) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=PYICU_DIR, env=env) expected = [{'ran': 17}] run_test([PYTHON_EXE, "setup.py", "test"], cwd=PYICU_DIR, expected=expected)
def install_and_test_lxml(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "http://cython.org/release/Cython-0.22.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "Cython-0.22.tar.gz"], cwd=SRC_DIR) CYTHON_DIR = os.path.abspath(os.path.join(SRC_DIR, "Cython-0.22")) PATCH_FILE = os.path.abspath( os.path.join(os.path.dirname(__file__), "..", "integration", "Cython-0.22.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=CYTHON_DIR) print "Applied Cython patch" subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=CYTHON_DIR) subprocess.check_call([PYTHON_EXE, "-c", "import Cython"], cwd=CYTHON_DIR) url = "https://pypi.python.org/packages/source/l/lxml/lxml-3.0.1.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "lxml-3.0.1.tar.gz"], cwd=SRC_DIR) LXML_DIR = os.path.abspath(os.path.join(SRC_DIR, "lxml-3.0.1")) PATCH_FILE = os.path.abspath( os.path.join(os.path.dirname(__file__), "lxml_patch.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=LXML_DIR) print "Applied lxml patch" subprocess.check_call( [PYTHON_EXE, "setup.py", "build_ext", "-i", "--with-cython"], cwd=LXML_DIR) expected = [{'ran': 1381, 'failures': 1}] run_test([PYTHON_EXE, "test.py"], cwd=LXML_DIR, expected=expected)
def install_and_test_mysqldb(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) subprocess.check_call( ["git", "clone", "https://github.com/farcepest/MySQLdb1.git"], cwd=SRC_DIR) MYSQLDB_DIR = os.path.abspath(os.path.join(SRC_DIR, "MySQLdb1")) subprocess.check_call(["git", "checkout", "MySQLdb-1.2.5"], cwd=MYSQLDB_DIR) nosetests_exe = os.path.abspath(ENV_NAME + "/bin/nosetests") #apply patch PATCH_FILE = os.path.abspath( os.path.join(os.path.dirname(__file__), "mysqldb_0001-Pyston-change-register-types.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=MYSQLDB_DIR) print "Applied mysqldb patch" subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=MYSQLDB_DIR) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=MYSQLDB_DIR) env = os.environ env["TESTDB"] = "travis.cnf" expected = [{"ran": 69}] run_test([nosetests_exe], cwd=MYSQLDB_DIR, expected=expected, env=env)
def install_and_test_cffi(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://pypi.python.org/packages/source/c/cffi/cffi-1.2.1.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "cffi-1.2.1.tar.gz"], cwd=SRC_DIR) CFFI_DIR = os.path.abspath(os.path.join(SRC_DIR, "cffi-1.2.1")) PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "cffi-1.2.1.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=CFFI_DIR) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=CFFI_DIR) # looks like clang 3.5 causes more errors like: 214 != -42 doing casts if os.environ.has_key("CC") and "clang" in os.environ["CC"]: expected = [{ "failed": 20, "passed": 1659, "skipped": 73, "xfailed": 4}] expected_log_hash = ''' oRkAgDIgEgAAwoKiAIQAIABAQAAAAAIKBOAIUABAEAAAIMQFgQCKhKEgERFEMAgAAAIBAAiCCBAC CAIASESQBAQDpAEAAAogAAMBAoVQqkCKABBAAIDgAKECABJAAQiEIAAgAgOigAIwcoQBIAAACoAG 2FIHAAQAJIELIVABgwA= ''' else: expected = [{ "failed": 11, "passed": 1668, "skipped": 73, "xfailed": 4}] expected_log_hash = ''' oRkAwBAg0gAEwoCiQIQgIQBAQAABQEKKBGAZVAhKcAAAAMQFAQAogKggFRFGEIgAAAKABgiGCBCC CAIASEAQHAQSpAEADEugCJEBAoFgIECDBBBEAACgACECAAJKgQicIAAgAAOChBIyUoQBIAAACoAG 2FInAAQQpIEHARAJowE= ''' run_test([PYTEST_EXE], cwd=CFFI_DIR, expected=expected, expected_log_hash=expected_log_hash)
def install_and_test_lxml(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://github.com/cython/cython/archive/0.22.tar.gz" subprocess.check_call(["wget", url, "-O", "Cython-0.22.tar.gz"], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "Cython-0.22.tar.gz"], cwd=SRC_DIR) CYTHON_DIR = os.path.abspath(os.path.join(SRC_DIR, "cython-0.22")) PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "integration", "Cython-0.22.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=CYTHON_DIR) print "Applied Cython patch" subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=CYTHON_DIR) subprocess.check_call([PYTHON_EXE, "-c", "import Cython"], cwd=CYTHON_DIR) url = "https://pypi.python.org/packages/source/l/lxml/lxml-3.0.1.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "lxml-3.0.1.tar.gz"], cwd=SRC_DIR) LXML_DIR = os.path.abspath(os.path.join(SRC_DIR, "lxml-3.0.1")) PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "lxml_patch.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=LXML_DIR) print "Applied lxml patch" subprocess.check_call([PYTHON_EXE, "setup.py", "build_ext", "-i", "--with-cython"], cwd=LXML_DIR) expected = [{'ran': 1381, 'failures': 1}] run_test([PYTHON_EXE, "test.py"], cwd=LXML_DIR, expected=expected)
def install_and_test_lxml(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "http://cython.org/release/Cython-0.22.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "Cython-0.22.tar.gz"], cwd=SRC_DIR) CYTHON_DIR = os.path.abspath(os.path.join(SRC_DIR, "Cython-0.22")) PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "integration", "Cython_0001-Pyston-change-we-don-t-support-custom-traceback-entr.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=CYTHON_DIR) print "Applied Cython patch" subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=CYTHON_DIR) subprocess.check_call([PYTHON_EXE, "-c", "import Cython"], cwd=CYTHON_DIR) url = "https://pypi.python.org/packages/source/l/lxml/lxml-3.0.1.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "lxml-3.0.1.tar.gz"], cwd=SRC_DIR) LXML_DIR = os.path.abspath(os.path.join(SRC_DIR, "lxml-3.0.1")) PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "lxml_patch.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=LXML_DIR) print "Applied lxml patch" subprocess.check_call([PYTHON_EXE, "setup.py", "build_ext", "-i", "--with-cython"], cwd=LXML_DIR) # We currently don't run the objectify tests because the assume that the python impl use refcounting. expected = [{'ran': 1188, 'failures': 3, 'errors': 1}] run_test([PYTHON_EXE, "test.py", "!.*test_objectify.py"], cwd=LXML_DIR, expected=expected)
def install_and_test_lxml(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://github.com/cython/cython" subprocess.check_call(["git", "clone", "--depth", "1", "--branch", "0.24", url], cwd=SRC_DIR) PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "../integration/Cython-0.24.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=CYTHON_DIR) print ">>> Applied Cython patch" subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=CYTHON_DIR) subprocess.check_call([PYTHON_EXE, "-c", "import Cython"], cwd=CYTHON_DIR) url = "https://pypi.python.org/packages/source/l/lxml/lxml-3.0.1.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "lxml-3.0.1.tar.gz"], cwd=SRC_DIR) LXML_DIR = os.path.abspath(os.path.join(SRC_DIR, "lxml-3.0.1")) PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "lxml_patch.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=LXML_DIR) print "Applied lxml patch" subprocess.check_call([PYTHON_EXE, "setup.py", "build_ext", "-i", "--with-cython"], cwd=LXML_DIR) expected = [{'ran': 1381}] expected_log_hash = ''' gAAAAAAAAQAAAAAIAAAAAAAAAAAAgAAAAAAAAABAAACCAEgAAAAAgAIAAAAAAACAAAAAoAAAAAAA ABAAAAAAAAAAAAAigAAAAAAAAAAQAAAwAgAAAAAAAAAAAAAAAAIAAAAEAAAACAAAAAAAAABBAAAA AAAAAAAAAAAAAAAAAAA= ''' run_test([PYTHON_EXE, "test.py"], cwd=LXML_DIR, expected=expected, expected_log_hash=expected_log_hash)
def install_and_test_simplejson(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://pypi.python.org/packages/source/s/simplejson/simplejson-2.6.2.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "simplejson-2.6.2.tar.gz"], cwd=SRC_DIR) SIMPLEJSON_DIR = os.path.abspath(os.path.join(SRC_DIR, "simplejson-2.6.2")) subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=SIMPLEJSON_DIR) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=SIMPLEJSON_DIR) expected = [{'ran': 170}] expected_log_hash = ''' gAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAA AAAAAAAAAAAAAAAAAEAAAAQAAAgAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAIAAAAAAAAAAAAAAAA= ''' run_test([PYTHON_EXE, "setup.py", "test"], cwd=SIMPLEJSON_DIR, expected=expected, expected_log_hash=expected_log_hash)
def install_and_test_lxml(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.21.1.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "M2Crypto-0.21.1.tar.gz"], cwd=SRC_DIR) M2CRYPTO_DIR = os.path.abspath(os.path.join(SRC_DIR, "M2Crypto-0.21.1")) url = "http://archive.ubuntu.com/ubuntu/pool/main/m/m2crypto/m2crypto_0.21.1-3ubuntu5.debian.tar.gz" subprocess.check_call(["wget", url], cwd=M2CRYPTO_DIR) subprocess.check_call( ["tar", "-zxf", "m2crypto_0.21.1-3ubuntu5.debian.tar.gz"], cwd=M2CRYPTO_DIR) debian_patches = ( "0001-Import-inspect-in-urllib-2.patch", "0002-Disable-SSLv2_method-when-disabled-in-OpenSSL-iself-.patch", "0003-Look-for-OpenSSL-headers-in-usr-include-DEB_HOST_MUL.patch", "skip_sslv2_tests.patch", "fix_testsuite_ftbfs.patch", "fix_testsuite_tls1.2.patch", "fix_testsuite_sha256.patch") for patch in debian_patches: PATCH_FILE = os.path.abspath( os.path.join(M2CRYPTO_DIR, "debian", "patches", patch)) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=M2CRYPTO_DIR) PATCH_FILE = os.path.abspath( os.path.join(os.path.dirname(__file__), "M2Crypto_patch.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=M2CRYPTO_DIR) env = os.environ # M2Crypto can't find the opensslconf without this env["DEB_HOST_MULTIARCH"] = "/usr/include/x86_64-linux-gnu" # SWIG does not work with pyston if this define is not set env["CFLAGS"] = "-DSWIG_PYTHON_SLOW_GETSET_THIS" subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=M2CRYPTO_DIR, env=env) expected = [{'ran': 235, 'errors': 5, 'skipped': 2}] expected_log_hash = ''' rAAABwigI04NBogROC1ATTYBiAUIAMhCMKBLQAC1SMALgBCRQIIAgKOpBBGgIaMKAAUAkVgCUJAA ABCMAIwJAQAAwONQATYSBmEYSACDAEUoRABkJKEAhBBEMgYMwQoFABBwCETByQggaAkAqAgUgAAG QBWgAamiIaSEIIIiGjE= ''' run_test([PYTHON_EXE, "setup.py", "test"], cwd=M2CRYPTO_DIR, expected=expected, expected_log_hash=expected_log_hash)
def install_and_test_unidecode(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://pypi.python.org/packages/source/U/Unidecode/Unidecode-0.04.16.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "Unidecode-0.04.16.tar.gz"], cwd=SRC_DIR) UNIDECODE_DIR = os.path.abspath(os.path.join(SRC_DIR, "Unidecode-0.04.16")) subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=UNIDECODE_DIR) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=UNIDECODE_DIR) expected = [{'ran': 8}] run_test([PYTHON_EXE, "setup.py", "test"], cwd=UNIDECODE_DIR, expected=expected)
def install_and_test_simplejson(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://pypi.python.org/packages/source/s/simplejson/simplejson-2.6.2.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "simplejson-2.6.2.tar.gz"], cwd=SRC_DIR) SIMPLEJSON_DIR = os.path.abspath(os.path.join(SRC_DIR, "simplejson-2.6.2")) subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=SIMPLEJSON_DIR) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=SIMPLEJSON_DIR) expected = [{'ran': 170}] run_test([PYTHON_EXE, "setup.py", "test"], cwd=SIMPLEJSON_DIR, expected=expected)
def install_and_test_pylons(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://pypi.python.org/packages/source/P/Pylons/Pylons-0.9.6.2.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "Pylons-0.9.6.2.tar.gz"], cwd=SRC_DIR) PYLONS_DIR = os.path.abspath(os.path.join(SRC_DIR, "Pylons-0.9.6.2")) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=PYLONS_DIR) # most of the errors are because of our coerceUnicodeToStr which raises a TypeError instead of a UnicodeError # but as we don't support the unicode string correctly every where I don't want to change this currently. expected = [{ "ran": 50, "errors": 7}] run_test([NOSE_EXE], cwd=PYLONS_DIR, expected=expected)
def install_and_test_pylons(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://pypi.python.org/packages/source/P/Pylons/Pylons-0.9.6.2.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "Pylons-0.9.6.2.tar.gz"], cwd=SRC_DIR) PYLONS_DIR = os.path.abspath(os.path.join(SRC_DIR, "Pylons-0.9.6.2")) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=PYLONS_DIR) # most of the errors are because of our coerceUnicodeToStr which raises a TypeError instead of a UnicodeError # but as we don't support the unicode string correctly every where I don't want to change this currently. expected = [{"ran": 50, "errors": 7}] run_test([NOSE_EXE], cwd=PYLONS_DIR, expected=expected)
def install_and_test_lxml(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.21.1.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "M2Crypto-0.21.1.tar.gz"], cwd=SRC_DIR) M2CRYPTO_DIR = os.path.abspath(os.path.join(SRC_DIR, "M2Crypto-0.21.1")) url = "http://archive.ubuntu.com/ubuntu/pool/main/m/m2crypto/m2crypto_0.21.1-3ubuntu5.debian.tar.gz" subprocess.check_call(["wget", url], cwd=M2CRYPTO_DIR) subprocess.check_call( ["tar", "-zxf", "m2crypto_0.21.1-3ubuntu5.debian.tar.gz"], cwd=M2CRYPTO_DIR) debian_patches = ( "0001-Import-inspect-in-urllib-2.patch", "0002-Disable-SSLv2_method-when-disabled-in-OpenSSL-iself-.patch", "0003-Look-for-OpenSSL-headers-in-usr-include-DEB_HOST_MUL.patch", "skip_sslv2_tests.patch", "fix_testsuite_ftbfs.patch", "fix_testsuite_tls1.2.patch", "fix_testsuite_sha256.patch") for patch in debian_patches: PATCH_FILE = os.path.abspath( os.path.join(M2CRYPTO_DIR, "debian", "patches", patch)) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=M2CRYPTO_DIR) PATCH_FILE = os.path.abspath( os.path.join(os.path.dirname(__file__), "M2Crypto_patch.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=M2CRYPTO_DIR) env = os.environ # M2Crypto can't find the opensslconf without this env["DEB_HOST_MULTIARCH"] = "/usr/include/x86_64-linux-gnu" # SWIG does not work with pyston if this define is not set env["CFLAGS"] = "-DSWIG_PYTHON_SLOW_GETSET_THIS" subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=M2CRYPTO_DIR, env=env) expected = [{'ran': 235, 'failures': 1, 'errors': 7, 'skipped': 2}] run_test([PYTHON_EXE, "setup.py", "test"], cwd=M2CRYPTO_DIR, expected=expected)
def install_and_test_cffi(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://pypi.python.org/packages/source/c/cffi/cffi-1.2.1.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "cffi-1.2.1.tar.gz"], cwd=SRC_DIR) CFFI_DIR = os.path.abspath(os.path.join(SRC_DIR, "cffi-1.2.1")) PATCH_FILE = os.path.abspath( os.path.join(os.path.dirname(__file__), "cffi-1.2.1.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=CFFI_DIR) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=CFFI_DIR) # looks like clang 3.5 causes more errors like: 214 != -42 doing casts if os.environ.has_key("CC") and "clang" in os.environ["CC"]: expected = [{ "failed": 20, "passed": 1659, "skipped": 73, "xfailed": 4 }] expected_log_hash = ''' oRkAgDIgEgAAwoKiAIQAIABAQAAAAAIKBOAIUABAEAAAIMQFgQCKhKEgERFEMAgAAAIBAAiCCBAC CAIASESQBAQDpAEAAAogAAMBAoVQqkCKABBAAIDgAKECABJAAQiEIAAgAgOigAIwcoQBIAAACoAG 2FIHAAQAJIELIVABgwA= ''' else: expected = [{ "failed": 11, "passed": 1668, "skipped": 73, "xfailed": 4 }] expected_log_hash = ''' oRkAwBAg0gAEwoCiQIQgIQBAQAABQEKKBGAZVAhKcAAAAMQFAQAogKggFRFGEIgAAAKABgiGCBCC CAIASEAQHAQSpAEADEugCJEBAoFgIECDBBBEAACgACECAAJKgQicIAAgAAOChBIyUoQBIAAACoAG 2FInAAQQpIEHARAJowE= ''' run_test([PYTEST_EXE], cwd=CFFI_DIR, expected=expected, expected_log_hash=expected_log_hash)
def install_and_test_lxml(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.21.1.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "M2Crypto-0.21.1.tar.gz"], cwd=SRC_DIR) M2CRYPTO_DIR = os.path.abspath(os.path.join(SRC_DIR, "M2Crypto-0.21.1")) url = "http://archive.ubuntu.com/ubuntu/pool/main/m/m2crypto/m2crypto_0.21.1-3ubuntu5.debian.tar.gz" subprocess.check_call(["wget", url], cwd=M2CRYPTO_DIR) subprocess.check_call(["tar", "-zxf", "m2crypto_0.21.1-3ubuntu5.debian.tar.gz"], cwd=M2CRYPTO_DIR) debian_patches = ("0001-Import-inspect-in-urllib-2.patch", "0002-Disable-SSLv2_method-when-disabled-in-OpenSSL-iself-.patch", "0003-Look-for-OpenSSL-headers-in-usr-include-DEB_HOST_MUL.patch", "skip_sslv2_tests.patch", "fix_testsuite_ftbfs.patch", "fix_testsuite_tls1.2.patch", "fix_testsuite_sha256.patch") for patch in debian_patches: PATCH_FILE = os.path.abspath(os.path.join(M2CRYPTO_DIR, "debian", "patches", patch)) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=M2CRYPTO_DIR) PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "M2Crypto_patch.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=M2CRYPTO_DIR) env = os.environ # M2Crypto can't find the opensslconf without this env["DEB_HOST_MULTIARCH"] = "/usr/include/x86_64-linux-gnu" # SWIG does not work with pyston if this define is not set env["CFLAGS"] = "-DSWIG_PYTHON_SLOW_GETSET_THIS" subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=M2CRYPTO_DIR, env=env) expected = [{'ran': 235, 'errors': 5, 'skipped': 2}] expected_log_hash = ''' rAAABwigI04NBogROC1ATTYBiAUIAMhCMKBLQAC1SMALgBCRQIIAgKOpBBGgIaMKAAUAkVgCUJAA ABCMAIwJAQAAwONQATYSBmEYSACDAEUoRABkJKEAhBBEMgYMwQoFABBwCETByQggaAkAqAgUgAAG QBWgAamiIaSEIIIiGjE= ''' run_test([PYTHON_EXE, "setup.py", "test"], cwd=M2CRYPTO_DIR, expected=expected, expected_log_hash=expected_log_hash)
def install_and_test_pylons(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://pypi.python.org/packages/source/P/Pylons/Pylons-0.9.6.2.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "Pylons-0.9.6.2.tar.gz"], cwd=SRC_DIR) PYLONS_DIR = os.path.abspath(os.path.join(SRC_DIR, "Pylons-0.9.6.2")) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=PYLONS_DIR) # most of the errors are because of our coerceUnicodeToStr which raises a TypeError instead of a UnicodeError # but as we don't support the unicode string correctly every where I don't want to change this currently. expected = [{ "ran": 50, "errors": 7}] expected_log_hash = ''' wLKBAAEAEQAABEAgAAUAYBABtBACiIFIAoAIIAiAYAIUBADgCOIAggAIBACQCAgIgAGBgCAsAIAB FCIAQAAQAQQAmQoAAACEMQAiAaIAFIgAEEAAAUgAAGAIQAEAAEBQQABQAEAAAAAAAiEiIEAAAEIC ECBAiigwIAAABAQIAQE= ''' run_test([NOSE_EXE], cwd=PYLONS_DIR, expected=expected, expected_log_hash=expected_log_hash)
def install_and_test_cffi(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://pypi.python.org/packages/source/c/cffi/cffi-1.2.1.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "cffi-1.2.1.tar.gz"], cwd=SRC_DIR) CFFI_DIR = os.path.abspath(os.path.join(SRC_DIR, "cffi-1.2.1")) PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "cffi-1.2.1.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=CFFI_DIR) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=CFFI_DIR) # looks like clang 3.5 causes more errors like: 214 != -42 doing casts if os.environ.has_key("CC") and "clang" in os.environ["CC"]: expected = [{ "failed": 58, "passed": 1619, "skipped": 70, "xfailed": 4, "error": 5 }] else: expected = [{ "failed": 49, "passed": 1628, "skipped": 70, "xfailed": 4, "error": 5 }] run_test([PYTEST_EXE], cwd=CFFI_DIR, expected=expected)
def install_and_test_protobuf(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "http://archive.ubuntu.com/ubuntu/pool/main/p/protobuf/protobuf_2.5.0.orig.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "protobuf_2.5.0.orig.tar.gz"], cwd=SRC_DIR) PROTOBUF_DIR = os.path.abspath(os.path.join(SRC_DIR, "protobuf-2.5.0")) INSTALL_DIR = os.path.join(SRC_DIR, "protobuf_install") subprocess.check_call(["./configure", "--prefix="+INSTALL_DIR], cwd=PROTOBUF_DIR) subprocess.check_call(["make", "-j4"], cwd=PROTOBUF_DIR) subprocess.check_call(["make", "install"], cwd=PROTOBUF_DIR) PROTOBUF_PY_DIR = os.path.join(PROTOBUF_DIR, "python") env = os.environ env["PATH"] = env["PATH"] + ":" + os.path.join(INSTALL_DIR, "bin") env["LD_LIBRARY_PATH"] = os.path.join(INSTALL_DIR, "lib") subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=PROTOBUF_PY_DIR, env=env) expected = [{"ran": 216}] run_test([PYTHON_EXE, "setup.py", "test"], cwd=PROTOBUF_PY_DIR, expected=expected, env=env)
def install_and_test_lxml(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.21.1.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "M2Crypto-0.21.1.tar.gz"], cwd=SRC_DIR) M2CRYPTO_DIR = os.path.abspath(os.path.join(SRC_DIR, "M2Crypto-0.21.1")) url = "http://archive.ubuntu.com/ubuntu/pool/main/m/m2crypto/m2crypto_0.21.1-3ubuntu5.debian.tar.gz" subprocess.check_call(["wget", url], cwd=M2CRYPTO_DIR) subprocess.check_call(["tar", "-zxf", "m2crypto_0.21.1-3ubuntu5.debian.tar.gz"], cwd=M2CRYPTO_DIR) debian_patches = ( "0001-Import-inspect-in-urllib-2.patch", "0002-Disable-SSLv2_method-when-disabled-in-OpenSSL-iself-.patch", "0003-Look-for-OpenSSL-headers-in-usr-include-DEB_HOST_MUL.patch", "skip_sslv2_tests.patch", "fix_testsuite_ftbfs.patch", "fix_testsuite_tls1.2.patch", "fix_testsuite_sha256.patch", ) for patch in debian_patches: PATCH_FILE = os.path.abspath(os.path.join(M2CRYPTO_DIR, "debian", "patches", patch)) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=M2CRYPTO_DIR) PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "M2Crypto_patch.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=M2CRYPTO_DIR) env = os.environ # M2Crypto can't find the opensslconf without this env["DEB_HOST_MULTIARCH"] = "/usr/include/x86_64-linux-gnu" # SWIG does not work with pyston if this define is not set env["CFLAGS"] = "-DSWIG_PYTHON_SLOW_GETSET_THIS" subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=M2CRYPTO_DIR, env=env) expected = [{"ran": 235, "failures": 1, "errors": 7, "skipped": 2}] run_test([PYTHON_EXE, "setup.py", "test"], cwd=M2CRYPTO_DIR, expected=expected)
def install_and_test_mysqldb(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) subprocess.check_call(["git", "clone", "https://github.com/farcepest/MySQLdb1.git"], cwd=SRC_DIR) MYSQLDB_DIR = os.path.abspath(os.path.join(SRC_DIR, "MySQLdb1")) subprocess.check_call(["git", "checkout", "MySQLdb-1.2.5"], cwd=MYSQLDB_DIR) nosetests_exe = os.path.abspath(ENV_NAME + "/bin/nosetests") #apply patch PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "mysqldb_0001-Pyston-change-register-types.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=MYSQLDB_DIR) print "Applied mysqldb patch" subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=MYSQLDB_DIR) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=MYSQLDB_DIR) env = os.environ env["TESTDB"] = "travis.cnf" expected = [{"ran": 69}] run_test([nosetests_exe], cwd=MYSQLDB_DIR, expected=expected, env=env)
def install_and_test_pylons(): shutil.rmtree(SRC_DIR, ignore_errors=True) os.makedirs(SRC_DIR) url = "https://pypi.python.org/packages/source/P/Pylons/Pylons-0.9.6.2.tar.gz" subprocess.check_call(["wget", url], cwd=SRC_DIR) subprocess.check_call(["tar", "-zxf", "Pylons-0.9.6.2.tar.gz"], cwd=SRC_DIR) PYLONS_DIR = os.path.abspath(os.path.join(SRC_DIR, "Pylons-0.9.6.2")) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=PYLONS_DIR) # most of the errors are because of our coerceUnicodeToStr which raises a TypeError instead of a UnicodeError # but as we don't support the unicode string correctly every where I don't want to change this currently. expected = [{"ran": 50, "errors": 7}] expected_log_hash = ''' wLKBAAEAEQAABEAgAAUAYBABtBACiIFIAoAIIAiAYAIUBADgCOIAggAIBACQCAgIgAGBgCAsAIAB FCIAQAAQAQQAmQoAAACEMQAiAaIAFIgAEEAAAUgAAGAIQAEAAEBQQABQAEAAAAAAAiEiIEAAAEIC ECBAiigwIAAABAQIAQE= ''' run_test([NOSE_EXE], cwd=PYLONS_DIR, expected=expected, expected_log_hash=expected_log_hash)
print ">> " print ">> Setting up paste..." print ">> " subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=PASTE_DIR) print ">> " print ">> Installing paste..." print ">> " subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=PASTE_DIR) print ">> " print ">> Running paste tests..." print ">> " # current cpython also does not pass all tests. (9 failed, 127 passed) # the additional test we fail are because: # - we have str.__iter__ # - no sys.settrace # - no shiftjis encoding # - slightly different error messages expected = [{"failed": 22, "passed": 112}] expected_log_hash = ''' ghA0YC2ZyyvAxlQASAgCMAglIjZ2pwSCB8wuCIgiAYGKAITIQgIQLRgRYwA0e1BchxcHGsShlUij OBXOA0E4AQIkzEKIOCikJYUgRF5hh8YJVAioAI6FDJB8waBqoGC7hEIDCdEZkACMA4IDaLABMFSi n7AogIFoJ4iCeUEEggM= ''' run_test([PYTEST_EXE], cwd=PASTE_TEST_DIR, expected=expected, expected_log_hash=expected_log_hash)
PASTE_DIR = os.path.abspath(os.path.join(ENV_NAME, "Paste-1.7.5")) PASTE_TEST_DIR = os.path.abspath(os.path.join(PASTE_DIR, "tests")) print ">> " print ">> Setting up paste..." print ">> " subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=PASTE_DIR) print ">> " print ">> Installing paste..." print ">> " subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=PASTE_DIR) print ">> " print ">> Running paste tests..." print ">> " # current cpython also does not pass all tests. (9 failed, 127 passed) # the additional test we fail are because: # - we have str.__iter__ # - no sys.settrace # - no shiftjis encoding # - slightly different error messages expected = [{"failed" : 22, "passed" : 112}] expected_log_hash = ''' ghA0YC2ZyyvAxlQASAgCMAglIjZ2pwSCB8wuCIgiAYGKAITIQgIQLRgRYwA0e1BchxcHGsShlUij OBXOA0E4AQIkzEKIOCikJYUgRF5hh8YJVAioAI6FDJB8waBqoGC7hEIDCdEZkACMA4IDaLABMFSi n7AogIFoJ4iCeUEEggM= ''' run_test([PYTEST_EXE], cwd=PASTE_TEST_DIR, expected=expected, expected_log_hash=expected_log_hash)
import os, sys, subprocess sys.path.append(os.path.dirname(__file__) + "/../lib") from test_helper import create_virtenv, run_test ENV_NAME = "babel_test_env_" + os.path.basename(sys.executable) SRC_DIR = os.path.abspath(os.path.join(ENV_NAME, "src")) PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python")) BABEL_DIR = os.path.abspath(os.path.join(ENV_NAME, "src", "babel")) NOSETESTS_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "nosetests")) packages = ["nose==1.3.7", "pytz==2015.4", "-e", "git+http://github.com/mitsuhiko/[email protected]#egg=Babel"] create_virtenv(ENV_NAME, packages, force_create=True) PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "babel.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=BABEL_DIR) subprocess.check_call([PYTHON_EXE, "setup.py", "import_cldr"], cwd=BABEL_DIR) subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=BABEL_DIR) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=BABEL_DIR) expected = [{"ran": 227, "failures": 3, "errors": 3}] run_test([NOSETESTS_EXE], cwd=BABEL_DIR, expected=expected)
import os, sys sys.path.append(os.path.dirname(__file__) + "/../lib") from test_helper import create_virtenv, run_test ENV_NAME = os.path.abspath("cheetah_test_env_" + os.path.basename(sys.executable)) create_virtenv(ENV_NAME, ["cheetah==2.4.4", "Markdown==2.0.1"], force_create=True) cheetah_exe = os.path.join(ENV_NAME, "bin", "cheetah") env = os.environ env["PATH"] = os.path.join(ENV_NAME, "bin") expected = [{ 'ran': 2138, 'errors': 4, 'failures': 1 }, { 'ran': 2138, 'errors': 232, 'failures': 3 }] run_test([cheetah_exe, "test"], cwd=ENV_NAME, expected=expected, env=env)
import os, sys sys.path.append(os.path.dirname(__file__) + "/../lib") from test_helper import create_virtenv, run_test ENV_NAME = os.path.abspath("cheetah_test_env_" + os.path.basename(sys.executable)) create_virtenv(ENV_NAME, ["cheetah==2.4.4", "Markdown==2.0.1"], force_create = True) cheetah_exe = os.path.join(ENV_NAME, "bin", "cheetah") env = os.environ env["PATH"] = os.path.join(ENV_NAME, "bin") expected = [{'ran': 2138}, {'ran': 2138, 'errors': 228, 'failures': 2}] expected_log_hash = ''' jcoCAIUIQTJEDoDiMwAuQFEAKABjEbMAAAACgqAAAAGgGsGAaQQKg3l0AIQWbEAwIKQmkBIAAlOQ IE4kA5AAASAqiGdMCPAAALKLAEwAYAcCEgRHAQCAAhAVJIghShwAUoAAKaEwgk0EaEUkgQAIADgb pKTQYrIACAshhJ6Bwh0= ''' run_test([cheetah_exe, "test"], cwd=ENV_NAME, expected=expected, env=env, expected_log_hash=expected_log_hash)
try: env = os.environ CYTHON_BIN_DIR = os.path.abspath(os.path.join(ENV_NAME + "/bin")) env["PATH"] = CYTHON_BIN_DIR + ":" + env["PATH"] # Should be able to do this: # subprocess.check_call([os.path.join(SRC_DIR, "bin/pip"), "install", NUMPY_DIR]) # but they end up naming f2py "f2py_release"/"f2py_dbg" print_progress_header("Setting up NumPy...") subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=NUMPY_DIR, env=env) print_progress_header("Installing NumPy...") subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=NUMPY_DIR, env=env) except: # TODO: I'm not sure we need to do this: subprocess.check_call(["rm", "-rf", NUMPY_DIR + "/build"]) subprocess.check_call(["rm", "-rf", NUMPY_DIR + "/dist"]) raise test_helper.run_test( ["sh", "-c", ". %s/bin/activate && python %s/numpy/tools/test-installed-numpy.py" % (ENV_DIR, ENV_DIR)], ENV_NAME, [dict(ran=6139, failures=1)], ) print print "PASSED"
create_virtenv(ENV_NAME, packages, force_create=True) # Need the test files in the source url = "https://pypi.python.org/packages/source/P/Paste/Paste-1.7.5.tar.gz" subprocess.check_call(["wget", url], cwd=ENV_NAME) subprocess.check_call(["tar", "-zxf", "Paste-1.7.5.tar.gz"], cwd=ENV_NAME) PASTE_DIR = os.path.abspath(os.path.join(ENV_NAME, "Paste-1.7.5")) PASTE_TEST_DIR = os.path.abspath(os.path.join(PASTE_DIR, "tests")) print ">> " print ">> Setting up paste..." print ">> " subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=PASTE_DIR) print ">> " print ">> Installing paste..." print ">> " subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=PASTE_DIR) print ">> " print ">> Running paste tests..." print ">> " # current cpython also does not pass all tests. (9 failed, 127 passed) # the additional test we fail are because: # - we have str.__iter__ # - no sys.settrace # - no shiftjis encoding # - slightly different error messages expected = [{"failed": 21, "passed": 113}] run_test([PYTEST_EXE], cwd=PASTE_TEST_DIR, expected=expected)
import os, sys, subprocess sys.path.append(os.path.dirname(__file__) + "/../lib") from test_helper import create_virtenv, run_test ENV_NAME = "avro_test_env_" + os.path.basename(sys.executable) PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python")) NOSETESTS_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "nosetests")) AVRO_DIR = os.path.abspath(os.path.join(ENV_NAME, "avro-1.7.7")) packages = ["nose==1.3.7", "avro==1.7.7"] create_virtenv(ENV_NAME, packages, force_create = True) url = "https://pypi.python.org/packages/source/a/avro/avro-1.7.7.tar.gz" subprocess.check_call(["wget", url], cwd=ENV_NAME) subprocess.check_call(["tar", "-zxf", "avro-1.7.7.tar.gz"], cwd=ENV_NAME) env = os.environ env["PYTHONPATH"] = os.path.abspath(os.path.join(ENV_NAME, "lib/python2.7/site-packages")) # this tests also fail when run in cpython with nose. # pytest makes two of this work but we can't currently run pytest... expected = [{'ran': 51, 'errors': 3}] run_test([NOSETESTS_EXE], env=env, cwd=AVRO_DIR, expected=expected)
import os, sys, subprocess, shutil sys.path.append(os.path.dirname(__file__) + "/../lib") from test_helper import create_virtenv, run_test ENV_NAME = "geoip_test_env_" + os.path.basename(sys.executable) SRC_DIR = os.path.abspath(os.path.join(ENV_NAME, "src")) PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python")) pkg = [ "-e", "git+https://github.com/maxmind/[email protected]#egg=GeoIP" ] create_virtenv(ENV_NAME, pkg, force_create=True) GEOIP_DIR = os.path.abspath(os.path.join(SRC_DIR, "geoip")) expected = [{'ran': 10}] run_test([PYTHON_EXE, "setup.py", "test"], cwd=GEOIP_DIR, expected=expected)
create_virtenv(ENV_NAME, packages, force_create=True) import subprocess # This particular test is bad; it depends on certain implementation details of the openssl library # it's linked against. It fails in cpython and for other people as well # https://www.mail-archive.com/[email protected]/msg52063.html subprocess.check_call([ "sed", "-i", 's/\\(def test_digest.*\\)/\\1\\n return/', os.path.join(PYOPENSSL_DIR, "test", "test_crypto.py") ]) # This particular test is bad; it fails if run close to a second-boundary # https://github.com/pyca/pyopenssl/issues/266 subprocess.check_call([ "sed", "-i", 's/\\(def test_export_text.*\\)/\\1\\n return/', os.path.join(PYOPENSSL_DIR, "test", "test_crypto.py") ]) print os.path.join(PYOPENSSL_DIR, "test", "test_crypto.py") expected = [{'ran': 438}] expected_log_hash = ''' gAAAAAAAAAAAAAAgAgAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAIAAAAAAgAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAEAAAAAAAA AAAAACAAAAAAgAAAAAA= ''' run_test([NOSETESTS_EXE], cwd=PYOPENSSL_DIR, expected=expected, expected_log_hash=expected_log_hash)
import os, sys sys.path.append(os.path.dirname(__file__) + "/../lib") from test_helper import create_virtenv, run_test ENV_NAME = os.path.abspath("cheetah_test_env_" + os.path.basename(sys.executable)) create_virtenv(ENV_NAME, ["cheetah==2.4.4", "Markdown==2.0.1"], force_create=True) cheetah_exe = os.path.join(ENV_NAME, "bin", "cheetah") env = os.environ env["PATH"] = os.path.join(ENV_NAME, "bin") expected = [{"ran": 2138, "errors": 4, "failures": 1}, {"ran": 2138, "errors": 232, "failures": 3}] run_test([cheetah_exe, "test"], cwd=ENV_NAME, expected=expected, env=env)
url = "https://github.com/scipy/scipy" subprocess.check_call( ["git", "clone", "--depth", "1", "--branch", "v0.17.1", url], cwd=SRC_DIR) else: print ">>> SciPy already installed." try: print_progress_header("Setting up SciPy...") subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=SCIPY_DIR, env=env) print_progress_header("Installing SciPy...") subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=SCIPY_DIR, env=env) except: subprocess.check_call(["rm", "-rf", SCIPY_DIR + "/build"]) subprocess.check_call(["rm", "-rf", SCIPY_DIR + "/dist"]) raise scip_test = "import scipy; scipy.test(verbose=2)" print_progress_header("Running SciPy test suite...") expected = [{'ran': 20391}] run_test([PYTHON_EXE, "-c", scip_test], cwd=CYTHON_DIR, expected=expected) print print "PASSED"
from Crypto.PublicKey import RSA from Crypto import Random key = RSA.generate(1024, Random.new().read) public_key = key.publickey() enc_data = public_key.encrypt(test_string, 32) assert enc_data != test_string assert key.decrypt(enc_data) == test_string expected = [{'ran': 1891}] expected_log_hash = ''' gAAAAAAAAAAAAABAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAIAAIAgAAAAAAA BAABAABAAAAAAAAAAAAAAAQAAAgAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAA AAAAAAAAAAAAAAAAAAA= ''' test_helper.run_test([sys.executable, "setup.py", "test"], pycrypto_dir, expected, expected_log_hash=expected_log_hash) print "-- Tests finished" print "-- Unpatching pycrypto" for patch in reversed(PATCHES): cmd = ["patch", "-p1", "--forward", "-i", patch] cmd += ["-R"] subprocess.check_output(cmd, stderr=subprocess.STDOUT) for d in ("build", "install"): if os.path.exists(d): print "Removing the created", d, "directory" shutil.rmtree(d)
import os, sys, subprocess, shutil sys.path.append(os.path.dirname(__file__) + "/../lib") from test_helper import create_virtenv, run_test ENV_NAME = "routes_test_env_" + os.path.basename(sys.executable) SRC_DIR = os.path.abspath(os.path.join(ENV_NAME, "src")) PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python")) pkg = ["nose==1.3.7", "paste==2.0.2", "six==1.10.0"] pkg += ["-e", "git+https://github.com/bbangert/[email protected]#egg=Routes"] create_virtenv(ENV_NAME, pkg, force_create = True) ROUTES_DIR = os.path.abspath(os.path.join(SRC_DIR, "routes")) expected = [{ "ran" : 141 }] expected_log_hash = ''' ggSACQMCAQZABAAUIIMCEABCAAAgQAACDAUABAKgAAgEAAECIAAgIAgBABQICCDoIkNQgQAAIQQE xACSGAIAoIAAAgAQAQEIAAAQAFhWACgBBHAEYAAgIBQAUGAAAAIABCAEQEgAAAFAACAAAo5EgBAA AAAQCSBIURAAwDCAkQA= ''' run_test([PYTHON_EXE, "setup.py", "test"], cwd=ROUTES_DIR, expected=expected, expected_log_hash=expected_log_hash)
try: env = os.environ CYTHON_BIN_DIR = os.path.abspath(os.path.join(ENV_NAME + "/bin")) env["PATH"] = CYTHON_BIN_DIR + ":" + env["PATH"] # Should be able to do this: # subprocess.check_call([os.path.join(SRC_DIR, "bin/pip"), "install", NUMPY_DIR]) # but they end up naming f2py "f2py_release"/"f2py_dbg" print_progress_header("Setting up NumPy...") os.environ["CC"] = "ccache gcc" print "\ndoing 'build'\n" subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=NUMPY_DIR, env=env) print_progress_header("Installing NumPy...") subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=NUMPY_DIR, env=env) except: # TODO: I'm not sure we need to do this: subprocess.check_call(["rm", "-rf", NUMPY_DIR + "/build"]) subprocess.check_call(["rm", "-rf", NUMPY_DIR + "/dist"]) raise test_helper.run_test(['sh', '-c', '. %s/bin/activate && python %s/numpy/tools/test-installed-numpy.py' % (ENV_DIR, ENV_DIR)], ENV_NAME, [dict(ran=6139, failures=1)]) print print "PASSED"
import os, sys, subprocess sys.path.append(os.path.dirname(__file__) + "/../lib") from test_helper import create_virtenv, run_test ENV_NAME = "formencode_test_env_" + os.path.basename(sys.executable) SRC_DIR = os.path.abspath(os.path.join(ENV_NAME, "src")) PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python")) NOSETESTS_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "nosetests")) FORMENCODE_DIR = os.path.abspath(os.path.join(ENV_NAME, "src", "formencode")) packages = ["nose==1.3.7", "pycountry==1.6", "pyDNS==2.3.6"] packages += ["-e", "git+https://github.com/formencode/[email protected]#egg=formencode"] create_virtenv(ENV_NAME, packages, force_create = True) expected = [{'ran': 201}] run_test([NOSETESTS_EXE], cwd=FORMENCODE_DIR, expected=expected)
from test_helper import create_virtenv, run_test ENV_NAME = "avro_test_env_" + os.path.basename(sys.executable) PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python")) PYTEST_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "py.test")) AVRO_DIR = os.path.abspath(os.path.join(ENV_NAME, "avro-1.7.7")) packages = ["pytest==2.8.7", "py==1.4.29", "avro==1.7.7"] create_virtenv(ENV_NAME, packages, force_create=True) url = "https://pypi.python.org/packages/source/a/avro/avro-1.7.7.tar.gz" subprocess.check_call(["wget", url], cwd=ENV_NAME) subprocess.check_call(["tar", "-zxf", "avro-1.7.7.tar.gz"], cwd=ENV_NAME) env = os.environ env["PYTHONPATH"] = os.path.abspath( os.path.join(ENV_NAME, "lib/python2.7/site-packages")) # cpython has the same number of failures expected = [{'failed': 2, 'passed': 47}] expected_log_hash = ''' gBAAAACAAAABBAgAAAACAAgAIAAABAQAAAAAAACAAAgDAIAAABAAIAMBAQgACBAAFBAQAACBAAAA EAEAAAAQAABAAAAAAIAAAAAAAAQAAAgICCgAEBAAAAAQAAAAAACAAAAAAAEAgAAAAAIAAAAAgBAA AZQAAAAAAAAAIAAEAAA= ''' run_test([PYTEST_EXE], env=env, cwd=AVRO_DIR, expected=expected, expected_log_hash=expected_log_hash)
import os, sys, subprocess, shutil sys.path.append(os.path.dirname(__file__) + "/../lib") from test_helper import create_virtenv, run_test ENV_NAME = "routes_test_env_" + os.path.basename(sys.executable) SRC_DIR = os.path.abspath(os.path.join(ENV_NAME, "src")) PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python")) pkg = ["nose==1.3.7", "paste==2.0.2", "six==1.10.0"] pkg += ["-e", "git+https://github.com/bbangert/[email protected]#egg=Routes"] create_virtenv(ENV_NAME, pkg, force_create=True) ROUTES_DIR = os.path.abspath(os.path.join(SRC_DIR, "routes")) expected = [{"ran": 141}] run_test([PYTHON_EXE, "setup.py", "test"], cwd=ROUTES_DIR, expected=expected)
import os, sys sys.path.append(os.path.dirname(__file__) + "/../lib") from test_helper import create_virtenv, run_test ENV_NAME = os.path.abspath("pyopenssl_test_env_" + os.path.basename(sys.executable)) NOSETESTS_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "nosetests")) PYOPENSSL_DIR = os.path.abspath( os.path.join(ENV_NAME, "site-packages", "OpenSSL")) packages = [ "nose==1.3.7", "pycparser==2.13", "cryptography==1.0.1", "pyopenssl==0.15.1", "pyasn1==0.1.7", "idna==2.0", "six==1.9.0", "enum34==1.0.4", "ipaddress==1.0.14", "cffi==1.1.0" ] create_virtenv(ENV_NAME, packages, force_create=True) # This particular test is bad; it depends on certain implementation details of the openssl library # it's linked against. It fails in cpython and for other people as well # https://www.mail-archive.com/[email protected]/msg52063.html import subprocess subprocess.check_call([ "sed", "-i", 's/\\(def test_digest.*\\)/\\1\\n return/', os.path.join(PYOPENSSL_DIR, "test", "test_crypto.py") ]) expected = [{'ran': 438}] run_test([NOSETESTS_EXE], cwd=PYOPENSSL_DIR, expected=expected)
import os, sys sys.path.append(os.path.dirname(__file__) + "/../lib") from test_helper import create_virtenv, run_test ENV_NAME = os.path.abspath("pyopenssl_test_env_" + os.path.basename(sys.executable)) NOSETESTS_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "nosetests")) PYOPENSSL_DIR = os.path.abspath(os.path.join(ENV_NAME, "site-packages", "OpenSSL")) packages = ["nose==1.3.7", "pycparser==2.13", "cryptography==1.0.1", "pyopenssl==0.15.1", "pyasn1==0.1.7", "idna==2.0", "six==1.9.0", "enum34==1.0.4", "ipaddress==1.0.14", "cffi==1.1.0"] create_virtenv(ENV_NAME, packages, force_create = True) expected = [{'ran': 247, 'errors': 2}] run_test([NOSETESTS_EXE], cwd=PYOPENSSL_DIR, expected=expected)
env["PATH"] = CYTHON_BIN_DIR + ":" + env["PATH"] # Should be able to do this: # subprocess.check_call([os.path.join(SRC_DIR, "bin/pip"), "install", NUMPY_DIR]) # but they end up naming f2py "f2py_release"/"f2py_dbg" print_progress_header("Setting up NumPy...") subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=NUMPY_DIR, env=env) print_progress_header("Installing NumPy...") subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=NUMPY_DIR, env=env) except: # TODO: I'm not sure we need to do this: subprocess.check_call(["rm", "-rf", NUMPY_DIR + "/build"]) subprocess.check_call(["rm", "-rf", NUMPY_DIR + "/dist"]) raise test_helper.run_test([ 'sh', '-c', '. %s/bin/activate && python %s/numpy/tools/test-installed-numpy.py' % (ENV_DIR, ENV_DIR) ], ENV_NAME, [dict(ran=6139, failures=1)]) print print "PASSED"
import os, sys, subprocess sys.path.append(os.path.dirname(__file__) + "/../lib") from test_helper import create_virtenv, run_test ENV_NAME = "avro_test_env_" + os.path.basename(sys.executable) PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python")) PYTEST_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "py.test")) AVRO_DIR = os.path.abspath(os.path.join(ENV_NAME, "avro-1.7.7")) packages = ["pytest==2.8.7", "py==1.4.29", "avro==1.7.7"] create_virtenv(ENV_NAME, packages, force_create = True) url = "https://pypi.python.org/packages/source/a/avro/avro-1.7.7.tar.gz" subprocess.check_call(["wget", url], cwd=ENV_NAME) subprocess.check_call(["tar", "-zxf", "avro-1.7.7.tar.gz"], cwd=ENV_NAME) env = os.environ env["PYTHONPATH"] = os.path.abspath(os.path.join(ENV_NAME, "lib/python2.7/site-packages")) # cpython has the same number of failures expected = [{'failed': 1, 'passed': 48}] expected_log_hash = ''' gBAAAgCAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAgBAAAAAAAAIAMBAQAACAAABAAQAACAAAAA AAEAAAAAAABAAAAAAIAAAAAAAAAAAAgACAAAEAAAAAAAAAAAAACAAAAAAAEAAAAAAAAAAAAAAAAA IAQAAAAAAAAAAAAAAAA= ''' run_test([PYTEST_EXE], env=env, cwd=AVRO_DIR, expected=expected, expected_log_hash=expected_log_hash)
# skip-if: 'clang' in os.environ.get('CC', '') # looks like libsass only builds using gcc... import os, sys, subprocess sys.path.append(os.path.dirname(__file__) + "/../lib") from test_helper import create_virtenv, run_test ENV_NAME = "sass_test_env_" + os.path.basename(sys.executable) SRC_DIR = os.path.abspath(os.path.join(ENV_NAME, "src")) PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python")) SASS_DIR = os.path.abspath(os.path.join(ENV_NAME, "src", "libsass")) packages = ["six==1.10", "werkzeug==0.9"] packages += [ "-e", "git+https://github.com/dahlia/[email protected]#egg=libsass" ] create_virtenv(ENV_NAME, packages, force_create=True) expected = [{'ran': 75}] expected_log_hash = ''' wEAIQAAAAAQEhBAAAAgQIF0QAAAQQAAAQigEAAwwABACAARUEBEAACTAAAQAEAAIAABJgQAEACAC AEAAUQQACBAAAAEBBABAARAAAQgCAHAWBQQAAABkaDABQAAYYAAEJtgCAIAgcoASgAwgUAAIRAQR QAQgIAQACCAgFEDEiFA= ''' run_test([PYTHON_EXE, "setup.py", "test"], cwd=SASS_DIR, expected=expected, expected_log_hash=expected_log_hash)
import os, sys, subprocess sys.path.append(os.path.dirname(__file__) + "/../lib") from test_helper import create_virtenv, run_test ENV_NAME = "avro_test_env_" + os.path.basename(sys.executable) PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python")) NOSETESTS_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "nosetests")) AVRO_DIR = os.path.abspath(os.path.join(ENV_NAME, "avro-1.7.7")) packages = ["nose==1.3.7", "avro==1.7.7"] create_virtenv(ENV_NAME, packages, force_create = True) url = "https://pypi.python.org/packages/source/a/avro/avro-1.7.7.tar.gz" subprocess.check_call(["wget", url], cwd=ENV_NAME) subprocess.check_call(["tar", "-zxf", "avro-1.7.7.tar.gz"], cwd=ENV_NAME) env = os.environ env["PYTHONPATH"] = os.path.abspath(os.path.join(ENV_NAME, "site-packages")) # this tests also fail when run in cpython with nose. # pytest makes two of this work but we can't currently run pytest... expected = [{'ran': 51, 'errors': 3}] run_test([NOSETESTS_EXE], env=env, cwd=AVRO_DIR, expected=expected)
import os, sys, subprocess sys.path.append(os.path.dirname(__file__) + "/../lib") from test_helper import create_virtenv, run_test ENV_NAME = "babel_test_env_" + os.path.basename(sys.executable) SRC_DIR = os.path.abspath(os.path.join(ENV_NAME, "src")) PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python")) BABEL_DIR = os.path.abspath(os.path.join(ENV_NAME, "src", "babel")) NOSETESTS_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "nosetests")) packages = ["nose==1.3.7", "pytz==2015.4", "-e", "git+http://github.com/mitsuhiko/[email protected]#egg=Babel"] create_virtenv(ENV_NAME, packages, force_create = True) PATCH_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), "babel.patch")) subprocess.check_call(["patch", "-p1", "--input=" + PATCH_FILE], cwd=BABEL_DIR) subprocess.check_call([PYTHON_EXE, "setup.py", "import_cldr"], cwd=BABEL_DIR) subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=BABEL_DIR) subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=BABEL_DIR) expected = [{"ran": 227, "failures": 3, "errors": 3}] expected_log_hash = ''' gAIAAAAACQAAAABAAAAABAAAAIAAEAAAAAAAAAAAAEAEBAAAAAAAkAAAAAAAAAAAQAAEgAAAAAAA AAAAAAAAAQAACAgAAAAAAAAAIAAJAAAAAAAAAAAAAAAAAAAAAEAAAAAAAhAAAAAAAAAAEACAAAAA EIgAAAAQAAAAAIAAAAA= ''' run_test([NOSETESTS_EXE], cwd=BABEL_DIR, expected=expected, expected_log_hash=expected_log_hash)
# skip-if: 'clang' in os.environ.get('CC', '') # looks like libsass only builds using gcc... import os, sys, subprocess sys.path.append(os.path.dirname(__file__) + "/../lib") from test_helper import create_virtenv, run_test ENV_NAME = "sass_test_env_" + os.path.basename(sys.executable) SRC_DIR = os.path.abspath(os.path.join(ENV_NAME, "src")) PYTHON_EXE = os.path.abspath(os.path.join(ENV_NAME, "bin", "python")) SASS_DIR = os.path.abspath(os.path.join(ENV_NAME, "src", "libsass")) packages = ["six==1.10", "werkzeug==0.9"] packages += ["-e", "git+https://github.com/dahlia/[email protected]#egg=libsass"] create_virtenv(ENV_NAME, packages, force_create = True) expected = [{'ran': 75}] run_test([PYTHON_EXE, "setup.py", "test"], cwd=SASS_DIR, expected=expected)
create_virtenv(ENV_NAME, packages, force_create=True) # Need the test files in the source url = "https://pypi.python.org/packages/source/P/Paste/Paste-1.7.5.tar.gz" subprocess.check_call(["wget", url], cwd=ENV_NAME) subprocess.check_call(["tar", "-zxf", "Paste-1.7.5.tar.gz"], cwd=ENV_NAME) PASTE_DIR = os.path.abspath(os.path.join(ENV_NAME, "Paste-1.7.5")) PASTE_TEST_DIR = os.path.abspath(os.path.join(PASTE_DIR, "tests")) print ">> " print ">> Setting up paste..." print ">> " subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=PASTE_DIR) print ">> " print ">> Installing paste..." print ">> " subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=PASTE_DIR) print ">> " print ">> Running paste tests..." print ">> " # current cpython also does not pass all tests. (9 failed, 127 passed) # the additional test we fail are because: # - we have str.__iter__ # - no sys.settrace # - no shiftjis encoding # - slightly different error messages expected = [{"failed": 22, "passed": 112}] run_test([PYTEST_EXE], cwd=PASTE_TEST_DIR, expected=expected)