Skip to content

Commit

Permalink
feat: add allow prerelease flag
Browse files Browse the repository at this point in the history
  • Loading branch information
fatelei committed Mar 25, 2024
1 parent a761408 commit a6eb99a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [Unreleased]

* Add `--allow-prerelease` option to allow python prerelease interpreters in

## [1.5.1] - 2024-03-21

* Fix usage of `--compatibility` when run as a PEP517 backend in [#1992](https://github.com/PyO3/maturin/pull/1992)
Expand Down
20 changes: 11 additions & 9 deletions guide/src/distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,32 +86,34 @@ Options:
--compatibility [<compatibility>...]
Control the platform tag on linux.
Options are `manylinux` tags (for example `manylinux2014`/`manylinux_2_24`) or `musllinux`
tags (for example `musllinux_1_2`) and `linux` for the native linux tag.
Options are `manylinux` tags (for example `manylinux2014`/`manylinux_2_24`) or `musllinux` tags (for
example `musllinux_1_2`) and `linux` for the native linux tag.
Note that `manylinux1` and `manylinux2010` is unsupported by the rust compiler. Wheels
with the native `linux` tag will be rejected by pypi, unless they are separately validated
by `auditwheel`.
Note that `manylinux1` and `manylinux2010` is unsupported by the rust compiler. Wheels with the native
`linux` tag will be rejected by pypi, unless they are separately validated by `auditwheel`.
The default is the lowest compatible `manylinux` tag, or plain `linux` if nothing matched
This option is ignored on all non-linux platforms
-i, --interpreter [<INTERPRETER>...]
The python versions to build wheels for, given as the executables of interpreters such as
`python3.9` or `/usr/bin/python3.8`
The python versions to build wheels for, given as the executables of interpreters such as `python3.9` or
`/usr/bin/python3.8`
-f, --find-interpreter
Find interpreters from the host machine
-a, --allow-prereleases
Allow prerelease python version
-b, --bindings <BINDINGS>
Which kind of bindings to use
[possible values: pyo3, pyo3-ffi, rust-cpython, cffi, uniffi, bin]
-o, --out <OUT>
The directory to store the built wheels in. Defaults to a new "wheels" directory in the
project's target directory
The directory to store the built wheels in. Defaults to a new "wheels" directory in the project's target
directory
--skip-auditwheel
Don't check for manylinux compliance
Expand Down
7 changes: 4 additions & 3 deletions src/build_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ pub struct BuildOptions {
#[arg(short = 'f', long, conflicts_with = "interpreter")]
pub find_interpreter: bool,

#[arg(short, long)]
/// Allow prerelease python version
#[arg(long)]
pub allow_prereleases: bool,

/// Which kind of bindings to use.
Expand Down Expand Up @@ -568,8 +569,8 @@ impl BuildOptions {
let versions = requires_python.unwrap();
let has_pre_release = versions.iter().any(|v| v.any_prerelease());
if has_pre_release && !self.allow_prereleases {
bail!("⚠️ Warning: python version is pre release, need pass flag --allow-prereleases");
}
log::warn!("⚠️ Warning: python version is pre release, need pass flag --allow-prereleases");
}?
}

self.find_interpreters(
Expand Down

0 comments on commit a6eb99a

Please sign in to comment.