Skip to content

Commit

Permalink
Update command output in user guide
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Nov 19, 2022
1 parent 24bdab7 commit 464cbd1
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 141 deletions.
2 changes: 1 addition & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.14.0] - 2022-11-??
## [0.14.0] - 2022-11-19

* **Breaking Change**: Remove support for specifying python package metadata in `Cargo.toml` in [#1200](https://github.com/PyO3/maturin/pull/1200).
Python package metadata should be specified in the `project` section of `pyproject.toml` instead as [PEP 621](https://peps.python.org/pep-0621/) specifies.
Expand Down
111 changes: 55 additions & 56 deletions guide/src/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,89 +6,88 @@ For local development, the `maturin develop` command can be used to quickly
build a package in debug mode by default and install it to virtualenv.

```
USAGE:
maturin develop [OPTIONS] [--] [ARGS]...
Usage: maturin develop [OPTIONS] [ARGS]...
ARGS:
<ARGS>...
Rustc flags
Arguments:
[ARGS]...
Rustc flags
OPTIONS:
-b, --bindings <BINDINGS>
Which kind of bindings to use. Possible values are pyo3, rust-cpython, cffi and bin
Options:
-b, --bindings <BINDINGS>
Which kind of bindings to use. Possible values are pyo3, rust-cpython, cffi and bin
-r, --release
Pass --release to cargo
-r, --release
Pass --release to cargo
--strip
Strip the library for minimum file size
--strip
Strip the library for minimum file size
-E, --extras <EXTRAS>
Install extra requires aka. optional dependencies
-E, --extras <EXTRAS>
Install extra requires aka. optional dependencies
Use as `--extras=extra1,extra2`
Use as `--extras=extra1,extra2`
-q, --quiet
Do not print cargo log messages
-q, --quiet
Do not print cargo log messages
-j, --jobs <N>
Number of parallel jobs, defaults to # of CPUs
-j, --jobs <N>
Number of parallel jobs, defaults to # of CPUs
--profile <PROFILE-NAME>
Build artifacts with the specified Cargo profile
--profile <PROFILE-NAME>
Build artifacts with the specified Cargo profile
-F, --features <FEATURES>
Space or comma separated list of features to activate
-F, --features <FEATURES>
Space or comma separated list of features to activate
--all-features
Activate all available features
--all-features
Activate all available features
--no-default-features
Do not activate the `default` feature
--no-default-features
Do not activate the `default` feature
--target <TRIPLE>
Build for the target triple
--target <TRIPLE>
Build for the target triple
[env: CARGO_BUILD_TARGET=]
[env: CARGO_BUILD_TARGET=]
--target-dir <DIRECTORY>
Directory for all generated artifacts
--target-dir <DIRECTORY>
Directory for all generated artifacts
-m, --manifest-path <PATH>
Path to Cargo.toml
-m, --manifest-path <PATH>
Path to Cargo.toml
--ignore-rust-version
Ignore `rust-version` specification in packages
--ignore-rust-version
Ignore `rust-version` specification in packages
-v, --verbose
Use verbose output (-vv very verbose/build.rs output)
-v, --verbose...
Use verbose output (-vv very verbose/build.rs output)
--color <WHEN>
Coloring: auto, always, never
--color <WHEN>
Coloring: auto, always, never
--frozen
Require Cargo.lock and cache are up to date
--frozen
Require Cargo.lock and cache are up to date
--locked
Require Cargo.lock is up to date
--locked
Require Cargo.lock is up to date
--offline
Run without accessing the network
--offline
Run without accessing the network
--config <KEY=VALUE>
Override a configuration value (unstable)
--config <KEY=VALUE>
Override a configuration value (unstable)
-Z <FLAG>
Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
-Z <FLAG>
Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
--timings[=<FMTS>...]
Timing output formats (unstable) (comma separated): html, json
--timings=<FMTS>
Timing output formats (unstable) (comma separated): html, json
--future-incompat-report
Outputs a future incompatibility report at the end of the build (unstable)
--future-incompat-report
Outputs a future incompatibility report at the end of the build (unstable)
-h, --help
Print help information
-h, --help
Print help information (use `-h` for a summary)
```

## PEP 660 Editable Installs
Expand Down
162 changes: 81 additions & 81 deletions guide/src/distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,126 +70,126 @@ or [nanoporetech/fast-ctc-decode](https://github.com/nanoporetech/fast-ctc-decod


```
USAGE:
maturin build [OPTIONS] [--] [ARGS]...
Usage: maturin build [OPTIONS] [ARGS]...
ARGS:
<ARGS>...
Rustc flags
Arguments:
[ARGS]...
Rustc flags
OPTIONS:
-r, --release
Build artifacts in release mode, with optimizations
Options:
-r, --release
Build artifacts in release mode, with optimizations
--strip
Strip the library for minimum file size
--strip
Strip the library for minimum file size
--sdist
Build a source distribution
--sdist
Build a source distribution
--compatibility <compatibility>...
Control the platform tag on linux.
--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
The default is the lowest compatible `manylinux` tag, or plain `linux` if nothing matched
This option is ignored on all non-linux platforms
This option is ignored on all non-linux platforms
-i, --interpreter <INTERPRETER>...
The python versions to build wheels for, given as the names of the interpreters
-i, --interpreter [<INTERPRETER>...]
The python versions to build wheels for, given as the names of the interpreters
-f, --find-interpreter
Find interpreters from the host machine
-f, --find-interpreter
Find interpreters from the host machine
-b, --bindings <BINDINGS>
Which kind of bindings to use. Possible values are pyo3, rust-cpython, cffi and bin
-b, --bindings <BINDINGS>
Which kind of bindings to use
-o, --out <OUT>
The directory to store the built wheels in. Defaults to a new "wheels" directory in the
project's target directory
[possible values: pyo3, pyo3-ffi, rust-cpython, cffi, bin]
--skip-auditwheel
Don't check for manylinux compliance
-o, --out <OUT>
The directory to store the built wheels in. Defaults to a new "wheels" directory in the
project's target directory
--zig
For manylinux targets, use zig to ensure compliance for the chosen manylinux version
--skip-auditwheel
Don't check for manylinux compliance
Default to manylinux2014/manylinux_2_17 if you do not specify an `--compatibility`
--zig
For manylinux targets, use zig to ensure compliance for the chosen manylinux version
Make sure you installed zig with `pip install maturin[zig]`
Default to manylinux2014/manylinux_2_17 if you do not specify an `--compatibility`
--universal2
Control whether to build universal2 wheel for macOS or not. Only applies to macOS
targets, do nothing otherwise
Make sure you installed zig with `pip install maturin[zig]`
-q, --quiet
Do not print cargo log messages
--universal2
Control whether to build universal2 wheel for macOS or not. Only applies to macOS targets,
do nothing otherwise
-j, --jobs <N>
Number of parallel jobs, defaults to # of CPUs
-q, --quiet
Do not print cargo log messages
--profile <PROFILE-NAME>
Build artifacts with the specified Cargo profile
-j, --jobs <N>
Number of parallel jobs, defaults to # of CPUs
-F, --features <FEATURES>
Space or comma separated list of features to activate
--profile <PROFILE-NAME>
Build artifacts with the specified Cargo profile
--all-features
Activate all available features
-F, --features <FEATURES>
Space or comma separated list of features to activate
--no-default-features
Do not activate the `default` feature
--all-features
Activate all available features
--target <TRIPLE>
Build for the target triple
--no-default-features
Do not activate the `default` feature
[env: CARGO_BUILD_TARGET=]
--target <TRIPLE>
Build for the target triple
--target-dir <DIRECTORY>
Directory for all generated artifacts
[env: CARGO_BUILD_TARGET=]
-m, --manifest-path <PATH>
Path to Cargo.toml
--target-dir <DIRECTORY>
Directory for all generated artifacts
--ignore-rust-version
Ignore `rust-version` specification in packages
-m, --manifest-path <PATH>
Path to Cargo.toml
-v, --verbose
Use verbose output (-vv very verbose/build.rs output)
--ignore-rust-version
Ignore `rust-version` specification in packages
--color <WHEN>
Coloring: auto, always, never
-v, --verbose...
Use verbose output (-vv very verbose/build.rs output)
--frozen
Require Cargo.lock and cache are up to date
--color <WHEN>
Coloring: auto, always, never
--locked
Require Cargo.lock is up to date
--frozen
Require Cargo.lock and cache are up to date
--offline
Run without accessing the network
--locked
Require Cargo.lock is up to date
--config <KEY=VALUE>
Override a configuration value (unstable)
--offline
Run without accessing the network
-Z <FLAG>
Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
--config <KEY=VALUE>
Override a configuration value (unstable)
--timings[=<FMTS>...]
Timing output formats (unstable) (comma separated): html, json
-Z <FLAG>
Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
--future-incompat-report
Outputs a future incompatibility report at the end of the build (unstable)
--timings=<FMTS>
Timing output formats (unstable) (comma separated): html, json
-h, --help
Print help information
--future-incompat-report
Outputs a future incompatibility report at the end of the build (unstable)
-h, --help
Print help information (use `-h` for a summary)
```

### Cross Compiling
Expand Down
6 changes: 3 additions & 3 deletions test-crates/update_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ def main():
content = root.joinpath(path).read_text()

matcher = re.compile(
r"```\nUSAGE:\n maturin (\w+) (.*?)```", re.MULTILINE | re.DOTALL
r"```\nUsage: maturin (\w+) (.*?)```", re.MULTILINE | re.DOTALL
)

replaces = {}
for command, old in matcher.findall(content):
command_output = subprocess.check_output(
["cargo", "run", "--", command.lower(), "--help"], text=True
)
new = "USAGE:" + command_output.strip().split("USAGE:")[1] + "\n"
new = "Usage:" + command_output.strip().split("Usage:")[1] + "\n"
# Remove trailing whitespace
new = re.sub(" +\n", "\n", new)
old = "USAGE:\n maturin " + command + " " + old
old = "Usage: maturin " + command + " " + old
replaces[old] = new

for old, new in replaces.items():
Expand Down

0 comments on commit 464cbd1

Please sign in to comment.