From d0c272bcd0a0acafe7ac776cbf1dabc0ad16b6b6 Mon Sep 17 00:00:00 2001 From: Rene Leveille Date: Sat, 8 Aug 2020 17:41:16 -0400 Subject: [PATCH] make clippy happy and add to changelog --- CHANGELOG.md | 2 ++ build.rs | 11 +++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc44503d7c8..96304a1a7a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Change `PyIterator::from_object` to return `PyResult` instead of `Result`. [#1051](https://github.com/PyO3/pyo3/pull/1051) - Implement `Send + Sync` for `PyErr`. `PyErr::new`, `PyErr::from_type`, `PyException::py_err` and `PyException::into` have had these bounds added to their arguments. [#1067](https://github.com/PyO3/pyo3/pull/1067) - Change `#[pyproto]` to return NotImplemented for operators for which Python can try a reversed operation. [1072](https://github.com/PyO3/pyo3/pull/1072) +- Change method for getting cross-compilation configurations using the file which provides the `sysconfig` module with its data, `_sysconfig_*.py` located in the lib directory. [1077](https://github.com/PyO3/pyo3/issues/1077) ### Removed - Remove `PyString::as_bytes`. [#1023](https://github.com/PyO3/pyo3/pull/1023) @@ -35,6 +36,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Don't rely on the order of structmembers to compute offsets in PyCell. Related to [#1058](https://github.com/PyO3/pyo3/pull/1058). [#1059](https://github.com/PyO3/pyo3/pull/1059) - Allows `&Self` as a `#[pymethods]` argument again. [#1071](https://github.com/PyO3/pyo3/pull/1071) +- Linking against libpython when compiling for android even with `extension-module` set[#1082](https://github.com/PyO3/pyo3/issues/1082) ## [0.11.1] - 2020-06-30 ### Added diff --git a/build.rs b/build.rs index facb7c348a3..ae45729b9bc 100644 --- a/build.rs +++ b/build.rs @@ -175,7 +175,6 @@ fn parse_sysconfigdata(config_path: impl AsRef) -> Result Result<(InterpreterConfig, HashMap)> { // find info from sysconfig @@ -207,7 +206,7 @@ fn load_cross_compile_from_sysconfigdata( let (major, minor) = match config_map.get("VERSION") { Some(s) => { - let split = s.split(".").collect::>(); + let split = s.split('.').collect::>(); (split[0].parse::()?, split[1].parse::()?) } None => bail!("Could not find python version"), @@ -237,9 +236,10 @@ fn load_cross_compile_from_sysconfigdata( } fn load_cross_compile_from_headers( - python_include_dir: &Path, + python_include_dir: &str, python_lib_dir: &str, ) -> Result<(InterpreterConfig, HashMap)> { + let python_include_dir = Path::new(&python_include_dir); let patchlevel_defines = parse_header_defines(python_include_dir.join("patchlevel.h"))?; let major = match patchlevel_defines @@ -294,13 +294,12 @@ fn load_cross_compile_info( python_include_dir: String, python_lib_dir: String, ) -> Result<(InterpreterConfig, HashMap)> { - let python_include_dir = Path::new(&python_include_dir); // Try to configure from the sysconfigdata file which is more accurate for the information // provided at python's compile time - match load_cross_compile_from_sysconfigdata(python_include_dir, &python_lib_dir) { + match load_cross_compile_from_sysconfigdata(&python_lib_dir) { Ok(ret) => Ok(ret), // If the config could not be loaded by sysconfigdata, failover to configuring from headers - Err(_) => load_cross_compile_from_headers(python_include_dir, &python_lib_dir), + Err(_) => load_cross_compile_from_headers(&python_include_dir, &python_lib_dir), } }