Skip to content

Commit

Permalink
Add --find-interpreter option to build and publish commands
Browse files Browse the repository at this point in the history
Some behaviors changed:

1. `maturin build` now implicitly translate to `maturin build -i python3`, meaning that we only build for the current python3 interpreter in `PATH`
2. `maturin build --find-interpreter` makes maturin search for interpreters on host, also search for bundled sysconfig when cross compiling
3. Mix `-i` and `--find-interpreter` is not allowed
4. `maturin publish` does the same as `maturin build`
  • Loading branch information
messense committed Jun 11, 2022
1 parent 7ce21fe commit 7162269
Show file tree
Hide file tree
Showing 6 changed files with 309 additions and 261 deletions.
5 changes: 2 additions & 3 deletions src/build_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::compile::warn_missing_py_init;
use crate::module_writer::{
add_data, write_bin, write_bindings_module, write_cffi_module, write_python_part, WheelWriter,
};
use crate::python_interpreter::InterpreterKind;
use crate::source_distribution::source_distribution;
use crate::{compile, Metadata21, ModuleWriter, PyProjectToml, PythonInterpreter, Target};
use anyhow::{anyhow, bail, Context, Result};
Expand Down Expand Up @@ -229,13 +228,13 @@ impl BuildContext {
let cpythons: Vec<_> = self
.interpreter
.iter()
.filter(|interp| interp.interpreter_kind == InterpreterKind::CPython)
.filter(|interp| interp.interpreter_kind.is_cpython())
.cloned()
.collect();
let pypys: Vec<_> = self
.interpreter
.iter()
.filter(|interp| interp.interpreter_kind == InterpreterKind::PyPy)
.filter(|interp| interp.interpreter_kind.is_pypy())
.cloned()
.collect();
let mut built_wheels = Vec::new();
Expand Down
Loading

0 comments on commit 7162269

Please sign in to comment.