Skip to content

Commit 2110d39

Browse files
authored
Merge pull request #1492 from messense/0.14-backport
Backport and release v0.14.14
2 parents be4d639 + de265a8 commit 2110d39

File tree

31 files changed

+407
-218
lines changed

31 files changed

+407
-218
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
authors = ["konstin <[email protected]>", "messense <[email protected]>"]
33
name = "maturin"
4-
version = "0.14.13"
4+
version = "0.14.14"
55
description = "Build and publish crates with pyo3, rust-cpython and cffi bindings as well as rust binaries as python packages"
66
exclude = ["test-crates/**/*", "sysconfig/*", "test-data/*", "ci/*", "tests/*", "guide/*", ".github/*"]
77
homepage = "https://github.com/pyo3/maturin"

Changelog.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.14.14] - 2023-02-24
11+
12+
* Add support for Emscripten in `generate-ci` command in [#1484](https://github.com/PyO3/maturin/pull/1484)
13+
* Add support for linking with pyo3 in abi3 debug mode on Windows in [#1487](https://github.com/PyO3/maturin/pull/1487)
14+
* Use default `ext_suffix` for Emscripten target if not provided in `PYO3_CONFIG_FILE` in [#1491](https://github.com/PyO3/maturin/pull/1491)
15+
* Deprecate `package.metadata.maturin.data` in favor of `tool.maturin.data` in `pyproject.toml` in [#1492](https://github.com/PyO3/maturin/pull/1492)
16+
1017
## [0.14.13] - 2023-02-12
1118

1219
* `maturin develop` now looks for a virtualenv `.venv` in the current or any parent directory if no virtual environment is active.
@@ -815,7 +822,8 @@ points-0.1.0-py2.py3-none-manylinux1_x86_64.whl | 2,8M | 752K | 85K
815822

816823
* Initial Release
817824

818-
[Unreleased]: https://github.com/pyo3/maturin/compare/v0.14.13...HEAD
825+
[Unreleased]: https://github.com/pyo3/maturin/compare/v0.14.14...HEAD
826+
[0.14.14]: https://github.com/pyo3/maturin/compare/v0.14.13...v0.14.14
819827
[0.14.13]: https://github.com/pyo3/maturin/compare/v0.14.12...v0.14.13
820828
[0.14.12]: https://github.com/pyo3/maturin/compare/v0.14.11...v0.14.12
821829
[0.14.11]: https://github.com/pyo3/maturin/compare/v0.14.10...v0.14.11

guide/src/tutorial.md

+25-13
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,42 @@ rand = "0.8.4"
3737

3838
[dependencies.pyo3]
3939
version = "0.18.0"
40-
# "extension-module" tells pyo3 we want to build an extension module (skips linking against libpython.so)
4140
# "abi3-py37" tells pyo3 (and maturin) to build using the stable ABI with minimum Python version 3.7
42-
features = ["extension-module", "abi3-py37"]
41+
features = ["abi3-py37"]
42+
```
43+
44+
Add a `pyproject.toml` to configure [PEP 518](https://peps.python.org/pep-0518/) build system requirements
45+
and enable the `extension-module` feature of pyo3.
46+
47+
```toml
48+
[build-system]
49+
requires = ["maturin>=0.14,<0.15"]
50+
build-backend = "maturin"
51+
52+
[tool.maturin]
53+
# "extension-module" tells pyo3 we want to build an extension module (skips linking against libpython.so)
54+
features = ["pyo3/extension-module"]
4355
```
4456

4557
### Use `maturin new`
4658

4759
New projects can also be quickly created using the `maturin new` command:
4860

4961
```bash
50-
USAGE:
51-
maturin new [FLAGS] [OPTIONS] <path>
62+
maturin new --help
63+
Create a new cargo project
5264

53-
FLAGS:
54-
-h, --help Prints help information
55-
--mixed Use mixed Rust/Python project layout
56-
-V, --version Prints version information
65+
Usage: maturin new [OPTIONS] <PATH>
5766

58-
OPTIONS:
59-
-b, --bindings <bindings> Which kind of bindings to use [possible values: pyo3, rust-cpython, cffi, bin]
60-
--name <name> Set the resulting package name, defaults to the directory name
67+
Arguments:
68+
<PATH> Project path
6169

62-
ARGS:
63-
<path> Project path
70+
Options:
71+
--name <NAME> Set the resulting package name, defaults to the directory name
72+
--mixed Use mixed Rust/Python project layout
73+
--src Use Python first src layout for mixed Rust/Python project
74+
-b, --bindings <BINDINGS> Which kind of bindings to use [possible values: pyo3, rust-cpython, cffi, uniffi, bin]
75+
-h, --help Print help information
6476
```
6577

6678
The above process can be achieved by running `maturin new -b pyo3 guessing_game`

src/build_context.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,8 @@ impl BuildContext {
526526
&self.project_layout,
527527
&self.module_name,
528528
&artifact.path,
529-
None,
529+
self.interpreter.first(),
530+
true,
530531
&self.target,
531532
self.editable,
532533
self.pyproject_toml.as_ref(),
@@ -605,6 +606,7 @@ impl BuildContext {
605606
&self.module_name,
606607
&artifact.path,
607608
Some(python_interpreter),
609+
false,
608610
&self.target,
609611
self.editable,
610612
self.pyproject_toml.as_ref(),

src/build_options.rs

+5
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,11 @@ impl BuildOptions {
369369
implmentation_name: "cpython".to_string(),
370370
soabi: None,
371371
}])
372+
} else if let Some(config_file) = env::var_os("PYO3_CONFIG_FILE") {
373+
let interpreter_config =
374+
InterpreterConfig::from_pyo3_config(config_file.as_ref(), target)
375+
.context("Invalid PYO3_CONFIG_FILE")?;
376+
Ok(vec![PythonInterpreter::from_config(interpreter_config)])
372377
} else if let Some(interp) = interpreters.get(0) {
373378
println!("🐍 Using {interp} to generate to link bindings (With abi3, an interpreter is only required on windows)");
374379
Ok(interpreters)

0 commit comments

Comments
 (0)