diff options
Diffstat (limited to 'community/maturin/integration_tests_platform.patch')
-rw-r--r-- | community/maturin/integration_tests_platform.patch | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/community/maturin/integration_tests_platform.patch b/community/maturin/integration_tests_platform.patch deleted file mode 100644 index 41c523b7872..00000000000 --- a/community/maturin/integration_tests_platform.patch +++ /dev/null @@ -1,83 +0,0 @@ -From c299b71f6f3893aa7035b0a63978bbd074ec94cb Mon Sep 17 00:00:00 2001 -From: messense <messense@icloud.com> -Date: Thu, 13 May 2021 23:56:15 +0800 -Subject: [PATCH] Run intergration tests with `pip install --platform` - ---- - tests/common/integration.rs | 57 +++++++++++++++++++++++++++++++++++-- - 1 file changed, 55 insertions(+), 2 deletions(-) - -diff --git a/tests/common/integration.rs b/tests/common/integration.rs -index bb71df4f..6c47b873 100644 ---- a/tests/common/integration.rs -+++ b/tests/common/integration.rs -@@ -82,14 +82,67 @@ pub fn test_integration(package: impl AsRef<Path>, bindings: Option<String>) -> - - let python = target.get_venv_python(&venv_dir); - -- let command = [ -+ let filename = adjust_canonicalization(filename); -+ let linux_platform = format!("linux_{}", target.target_arch()); -+ let output = Command::new(&python) -+ .args(&[ -+ "-c", -+ "from distutils.sysconfig import get_python_lib; print(get_python_lib())", -+ ]) -+ .output() -+ .context(format!("get_python_lib() failed with {:?}", python))?; -+ if !output.status.success() { -+ bail!( -+ "get_python_lib() failed running: {}\n--- Stdout:\n{}\n--- Stderr:\n{}\n---\n", -+ output.status, -+ str::from_utf8(&output.stdout)?.trim(), -+ str::from_utf8(&output.stderr)?.trim(), -+ ); -+ } -+ let install_target = str::from_utf8(&output.stdout)?.trim(); -+ let manylinux1_platform = format!("manylinux1_{}", target.target_arch()); -+ let manylinux2010_platform = format!("manylinux2010_{}", target.target_arch()); -+ let manylinux2014_platform = format!("manylinux2014_{}", target.target_arch()); -+ let mut command = vec![ - "-m", - "pip", - "--disable-pip-version-check", - "install", - "--force-reinstall", -- &adjust_canonicalization(filename), - ]; -+ if target.is_linux() { -+ if package_string.contains("cffi") { -+ // Install cffi first -+ let output = Command::new(&python) -+ .args(&["-m", "pip", "install", "cffi"]) -+ .output() -+ .context(format!("pip install cffi failed with {:?}", python))?; -+ if !output.status.success() { -+ bail!( -+ "pip install cffi failed running: {}\n--- Stdout:\n{}\n--- Stderr:\n{}\n---\n", -+ output.status, -+ str::from_utf8(&output.stdout)?.trim(), -+ str::from_utf8(&output.stderr)?.trim(), -+ ); -+ } -+ command.push("--no-deps"); -+ } -+ // Add --upgrade to avoid pip warning about -+ // `Target directory XXXX already exists. Specify --upgrade to force replacement.` -+ command.push("--upgrade"); -+ command.push("--target"); -+ command.push(&install_target); -+ command.push("--only-binary=:all:"); -+ command.push("--platform"); -+ command.push(&linux_platform); -+ command.push("--platform"); -+ command.push(&manylinux1_platform); -+ command.push("--platform"); -+ command.push(&manylinux2010_platform); -+ command.push("--platform"); -+ command.push(&manylinux2014_platform); -+ } -+ command.push(&filename); - let output = Command::new(&python) - .args(&command) - .output() |