Skip to content

Commit

Permalink
make clippy happy and add to changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Rene Leveille committed Aug 8, 2020
1 parent 92b8ea5 commit d0c272b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<PyIterator>` instead of `Result<PyIterator, PyDowncastError>`. [#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)
Expand All @@ -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
Expand Down
11 changes: 5 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ fn parse_sysconfigdata(config_path: impl AsRef<Path>) -> Result<HashMap<String,
}

fn load_cross_compile_from_sysconfigdata(
python_include_dir: &Path,
python_lib_dir: &str,
) -> Result<(InterpreterConfig, HashMap<String, String>)> {
// find info from sysconfig
Expand Down Expand Up @@ -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::<Vec<&str>>();
let split = s.split('.').collect::<Vec<&str>>();
(split[0].parse::<u8>()?, split[1].parse::<u8>()?)
}
None => bail!("Could not find python version"),
Expand Down Expand Up @@ -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<String, String>)> {
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
Expand Down Expand Up @@ -294,13 +294,12 @@ fn load_cross_compile_info(
python_include_dir: String,
python_lib_dir: String,
) -> Result<(InterpreterConfig, HashMap<String, String>)> {
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),
}
}

Expand Down

0 comments on commit d0c272b

Please sign in to comment.