Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Build wheel (with sdist)
if: matrix.target == 'x86_64-unknown-linux-musl'
run: |
cargo run -- build --release -b bin --sdist -o dist --target ${{ matrix.target }} --features password-storage --compatibility manylinux2010 musllinux_1_1
cargo run -- build --release -b bin --sdist -o dist --target ${{ matrix.target }} --compatibility manylinux2010 musllinux_1_1

# ring doesn't support aarch64 windows yet
- name: Build wheel (windows aarch64)
Expand All @@ -91,7 +91,7 @@ jobs:

- name: Build wheel (without sdist)
if: ${{ matrix.target != 'x86_64-unknown-linux-musl' && matrix.target != 'aarch64-pc-windows-msvc' }}
run: cargo run -- build --release -b bin -o dist --target ${{ matrix.target }} --features password-storage,static
run: cargo run -- build --release -b bin -o dist --target ${{ matrix.target }} --features static

- name: Build wheel (macOS universal2)
if: matrix.target == 'x86_64-apple-darwin'
Expand All @@ -103,7 +103,7 @@ jobs:
# set SDKROOT for C dependencies like ring and bzip2
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
rustup target add aarch64-apple-darwin
cargo run -- build --release -b bin -o dist --target universal2-apple-darwin --features password-storage,static
cargo run -- build --release -b bin -o dist --target universal2-apple-darwin --features static

- name: Archive binary (windows)
if: matrix.os == 'windows-latest'
Expand Down Expand Up @@ -195,8 +195,7 @@ jobs:
sudo python3 -m pip install -U --pre maturin
maturin build --release -b bin -o dist \
--target ${{ matrix.platform.target }} \
--compatibility ${{ matrix.platform.compatibility }} \
--features password-storage
--compatibility ${{ matrix.platform.compatibility }}
- name: Archive binary
run: tar czvf target/release/maturin-${{ matrix.platform.target }}.tar.gz -C target/${{ matrix.platform.target }}/release maturin
- name: Upload wheel artifacts
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
if: startsWith(matrix.os, 'windows')
run: echo "RUSTFLAGS="-C debuginfo=0"" >> $GITHUB_ENV
- name: cargo test
run: cargo nextest run --features password-storage
run: cargo nextest run
# TODO: https://github.com/PyO3/maturin/issues/2263
#- name: test cross compiling with zig
# if: ${{ !contains(matrix.python-version, '-dev') }}
Expand Down Expand Up @@ -307,7 +307,7 @@ jobs:
- name: cargo test
run: |
# unset GITHUB_ACTIONS env var to disable zig related tests
env -u GITHUB_ACTIONS cargo nextest run --features password-storage
env -u GITHUB_ACTIONS cargo nextest run

test-auditwheel:
name: Test Auditwheel
Expand Down
87 changes: 0 additions & 87 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 2 additions & 49 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ["konstin <konstin@mailbox.org>", "messense <messense@icloud.com>"]
name = "maturin"
version = "1.10.2"
description = "Build and publish crates with pyo3, cffi and uniffi bindings as well as rust binaries as python packages"
description = "Build crates with pyo3, cffi and uniffi bindings as well as rust binaries as python packages"
exclude = [
"test-crates/**/*",
"sysconfig/*",
Expand Down Expand Up @@ -113,30 +113,6 @@ dialoguer = { version = "0.11.0", default-features = false, optional = true }
console = { version = "0.16.0", optional = true }
minijinja = { version = "2.5.0", optional = true }

# upload
bytesize = { version = "2.2.0", optional = true }
configparser = { version = "3.0.3", optional = true }
dirs = { version = "5.0.0", optional = true }
multipart = { version = "0.18.0", features = [
"client",
], default-features = false, optional = true }
ureq = { version = "2.9.4", features = [
"gzip",
"json",
"socks-proxy",
], default-features = false, optional = true }
native-tls = { version = "0.2.8", optional = true }
rustls = { version = "0.23", default-features = false, features = [
"logging",
"std",
"tls12",
], optional = true }
rustls-pemfile = { version = "2.1.0", optional = true }
keyring = { version = "2.3.2", default-features = false, features = [
"linux-no-secret-service",
], optional = true }
wild = { version = "2.1.0", optional = true }

# JSON schema
schemars = { version = "1.0.4", optional = true }
pretty_assertions = { version = "1.3.0", optional = true }
Expand All @@ -157,36 +133,17 @@ which = "7.0.0"
[features]
default = ["full", "rustls"]

full = ["cli-completion", "cross-compile", "scaffolding", "upload"]
full = ["cli-completion", "cross-compile", "scaffolding"]

cli-completion = ["dep:clap_complete_command"]

upload = [
"ureq",
"multipart",
"configparser",
"bytesize",
"dialoguer/password",
"wild",
"dep:dirs",
]

schemars = ["dep:schemars", "dep:pretty_assertions"]

# keyring doesn't support *BSD so it's not enabled in `full` by default
password-storage = ["upload", "keyring"]

rustls = [
"dep:rustls",
"ureq?/tls",
"cargo-xwin?/rustls-tls",
"dep:rustls-pemfile",
]
native-tls = [
"dep:native-tls",
"ureq?/native-tls",
"cargo-xwin?/native-tls",
"dep:rustls-pemfile",
]

# cross compile using zig or xwin
Expand All @@ -203,10 +160,6 @@ static = ["xz2/static"]
# Internal feature to speed up the tests significantly
faster-tests = []

# Deprecated features, keep them now for compatibility
human-panic = []
log = []

[profile.profiling]
inherits = "release"
debug = true
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN --mount=type=cache,target=/root/.cargo/git \
mkdir /maturin/src && \
touch /maturin/src/lib.rs && \
echo 'fn main() { println!("Dummy") }' > /maturin/src/main.rs && \
cargo rustc --target $CARGO_BUILD_TARGET --bin maturin --manifest-path /maturin/Cargo.toml --release --features password-storage -- -C link-arg=-s
cargo rustc --target $CARGO_BUILD_TARGET --bin maturin --manifest-path /maturin/Cargo.toml --release -- -C link-arg=-s

ADD . /maturin/

Expand All @@ -32,7 +32,7 @@ RUN touch /maturin/src/lib.rs /maturin/src/main.rs
RUN --mount=type=cache,target=/root/.cargo/git \
--mount=type=cache,target=/root/.cargo/registry \
--mount=type=cache,target=/maturin/target,sharing=locked \
cargo rustc --target $CARGO_BUILD_TARGET --bin maturin --manifest-path /maturin/Cargo.toml --release --features password-storage -- -C link-arg=-s \
cargo rustc --target $CARGO_BUILD_TARGET --bin maturin --manifest-path /maturin/Cargo.toml --release -- -C link-arg=-s \
&& mv /maturin/target/$CARGO_BUILD_TARGET/release/maturin /usr/bin/maturin

FROM base-$TARGETARCH
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ _formerly pyo3-pack_
[![PyPI](https://img.shields.io/pypi/v/maturin.svg?logo=python&style=flat-square)](https://pypi.org/project/maturin)
[![discord server](https://img.shields.io/discord/1209263839632424990?logo=discord&style=flat-square)](https://discord.gg/33kcChzH7f)

Build and publish crates with [pyo3, cffi and uniffi bindings](https://maturin.rs/bindings) as well as rust binaries as python packages with minimal configuration.
It supports building wheels for python 3.8+ on Windows, Linux, macOS and FreeBSD, can upload them to [pypi](https://pypi.org/) and has basic PyPy and GraalPy support.
Build crates with [pyo3, cffi and uniffi bindings](https://maturin.rs/bindings) as well as rust binaries as python packages with minimal configuration.
It supports building wheels for python 3.8+ on Windows, Linux, macOS and FreeBSD and has basic PyPy and GraalPy support.

Check out the [User Guide](https://maturin.rs/)!

Expand All @@ -30,8 +30,7 @@ uv tool install maturin
There are four main commands:

- `maturin new` creates a new cargo project with maturin configured.
- `maturin publish` builds the crate into python packages and publishes them to pypi.
- `maturin build` builds the wheels and stores them in a folder (`target/wheels` by default), but doesn't upload them. It's recommended to publish packages with [uv](https://github.com/astral-sh/uv) using `uv publish`.
- `maturin build` builds the wheels and stores them in a folder (`target/wheels` by default). It's recommended to publish packages with [uv](https://github.com/astral-sh/uv) using `uv publish`.
- `maturin develop` builds the crate and installs it as a python module directly in the current virtualenv. Note that while `maturin develop` is faster, it doesn't support all the feature that running `pip install` after `maturin build` supports.

maturin doesn't need extra configuration files and doesn't clash with an existing setuptools-rust configuration.
Expand Down
2 changes: 0 additions & 2 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ feature-depth = 1
# A list of advisory IDs to ignore. Note that ignored advisories will still
# output a note when they are encountered.
ignore = [
# multipart unmaintained
"RUSTSEC-2023-0050",
# paste unmaintained
"RUSTSEC-2024-0436",
# num_prefix unmaintained
Expand Down
2 changes: 1 addition & 1 deletion guide/src/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ run `mdbook watch guide` from the repository root. The output can then be found

## Code

The main part is the maturin library, which is completely documented and should be well integrable. The accompanying `main.rs` takes care username and password for the pypi upload and otherwise calls into the library.
The main part is the maturin library, which is completely documented and should be well integrable. The accompanying `main.rs` calls into the library.

The `sysconfig` folder contains the output of `python -m sysconfig` for different python versions and platform, which is helpful during development.

Expand Down
Loading
Loading