pub struct PypiConfig {Show 28 fields
pub id: Option<String>,
pub ids: Option<Vec<String>>,
pub targets: Option<Vec<String>>,
pub name: Option<String>,
pub sdist: bool,
pub sdist_manifest: Option<String>,
pub index_url: Option<String>,
pub skip_existing: bool,
pub requires_python: Option<String>,
pub summary: Option<String>,
pub description: Option<String>,
pub description_content_type: Option<String>,
pub author: Option<String>,
pub author_email: Option<String>,
pub project_urls: Option<BTreeMap<String, String>>,
pub homepage: Option<String>,
pub license: Option<String>,
pub keywords: Option<Vec<String>>,
pub classifiers: Option<Vec<String>>,
pub platform_tag_overrides: Option<BTreeMap<String, String>>,
pub amd64_variant: Option<Amd64Variant>,
pub arm_variant: Option<String>,
pub auth: PypiAuthMode,
pub token: Option<String>,
pub skip: Option<StringOrBool>,
pub required: Option<bool>,
pub if_condition: Option<String>,
pub retain_on_rollback: Option<bool>,
}Expand description
PyPI publisher configuration.
Publishes the project’s prebuilt binaries as native Python wheels — one
py3-none-<platform> wheel per built target, with the platform tag
derived by inspecting each binary (glibc floor for manylinux, Mach-O
deployment target for macosx) — and uploads them via PyPI’s legacy
(twine-protocol) upload API. Optionally also builds and uploads a source
distribution via maturin sdist. Each pypis[] entry produces one
publish.
pypis:
- name: my-tool
requires_python: ">=3.7"
sdist: true
sdist_manifest: "pypi/"Fields§
§id: Option<String>Unique identifier for selecting this entry from the CLI (--id=...).
ids: Option<Vec<String>>Build IDs filter: only include binaries whose crate is in this list.
targets: Option<Vec<String>>Target-triple allowlist: restrict the wheels to a subset of the built
targets. When unset (the default), every built target becomes a wheel.
When set, only binaries whose target triple appears in this list are
built into wheels; the rest are silently skipped. Orthogonal to ids::
both filters apply (a binary must pass the ids filter AND, when this
is set, be listed here). A listed triple that no selected build
produces is a config error, and an explicit empty list (targets: [])
is rejected — omit the field to publish every built target. A common use
is excluding x86_64-pc-windows-gnu so it does not collide with the
x86_64-pc-windows-msvc wheel on the shared win_amd64 platform tag.
Example: targets: [x86_64-unknown-linux-gnu, x86_64-pc-windows-msvc].
name: Option<String>PyPI project name. May use any PEP 508 name form (My.Tool,
my_tool); PyPI normalizes it per PEP 503 for index lookups and the
wheel filename escapes it per PEP 427. Falls back to the crate name
when unset.
sdist: boolAlso build and upload a source distribution via maturin sdist.
Default false. Requires sdist_manifest to point at the directory
containing the project’s pyproject.toml, and maturin on PATH.
pypis:
- sdist: true
sdist_manifest: "pypi/"sdist_manifest: Option<String>Templated directory containing the pyproject.toml that maturin sdist builds from, relative to the project root (e.g. "pypi/").
Required when sdist: true; unused otherwise.
index_url: Option<String>Templated twine upload endpoint URL. Default
https://upload.pypi.org/legacy/ (the production PyPI upload API).
Point it at TestPyPI to rehearse a release:
pypis:
- index_url: "https://test.pypi.org/legacy/"This is the twine upload target, not a {owner, name} source
repository — the name index_url keeps it distinct from the reserved
repository meaning every git-based publisher uses. The legacy
repository: spelling is still accepted via serde alias.
skip_existing: boolTolerate the index rejecting a file that already exists (the
twine --skip-existing semantics). Default true so a re-run of an
already-published tag skips previously-uploaded files instead of
failing the release. Set to false to make a duplicate upload a hard
error.
requires_python: Option<String>Requires-Python version specifier written into each wheel’s
METADATA (e.g. ">=3.7"). Purely declarative for a binary wheel —
the shipped executable does not import Python — but pip honors it
during resolution. Omitted when unset.
summary: Option<String>Templated one-line Summary for the package METADATA. Falls back to
the project-level metadata.description (and then the crate’s
Cargo.toml [package].description) when unset.
description: Option<String>Templated long description written as the METADATA body (rendered on the PyPI project page). Falls back to the summary when unset.
description_content_type: Option<String>Description-Content-Type for the long-description body — how PyPI
renders it (text/markdown, text/x-rst, text/plain). When a
description is present and this is unset, defaults to
text/markdown (the modern norm); without the header PyPI renders the
body as raw plaintext. Omitted entirely when there is no description.
Package author, emitted as the METADATA Author header.
Package author email, emitted as the METADATA Author-email header.
project_urls: Option<BTreeMap<String, String>>Arbitrary Project-URL label → URL map, one
Project-URL: <label>, <url> METADATA header each (the PyPI sidebar
links). Emitted in addition to the Homepage link derived from
homepage; use this for Repository, Documentation, Changelog,
Funding, etc. Rendered in sorted label order for a byte-stable wheel.
pypis:
- project_urls:
Repository: "https://github.com/me/my-tool"
Documentation: "https://docs.example.com"homepage: Option<String>Templated homepage URL, emitted as Project-URL: Homepage. Falls
back to metadata.homepage (then Cargo.toml [package].homepage)
when unset.
license: Option<String>Templated license expression (e.g. MIT, Apache-2.0), emitted as
the METADATA License field. Falls back to metadata.license (then
Cargo.toml [package].license) when unset.
keywords: Option<Vec<String>>Keywords list, emitted comma-separated in METADATA.
classifiers: Option<Vec<String>>Trove classifier lines (e.g.
"Programming Language :: Rust"), one Classifier: METADATA header
each.
platform_tag_overrides: Option<BTreeMap<String, String>>Per-target-triple wheel platform-tag overrides: <target triple> →
explicit wheel platform tag. When a built target has an entry, its tag
is used verbatim — binary inspection (the glibc floor for
manylinux, the Mach-O deployment target for macosx) is skipped for
that target. Every target without an entry keeps the auto-detected tag.
The escape hatch for toolchains whose emitted glibc floor is stricter
than the compatibility a project wants to advertise — e.g. pinning
aarch64-unknown-linux-gnu to manylinux_2_28 to match a
maturin/PyO3 build environment rather than shipping the higher floor
the binary’s symbols imply.
pypis:
- platform_tag_overrides:
aarch64-unknown-linux-gnu: manylinux_2_28_aarch64amd64_variant: Option<Amd64Variant>x86_64 micro-architecture variant selector — v1 (baseline), v2,
v3 (AVX2), or v4. When set, an amd64 binary carrying
amd64_variant metadata becomes the win_amd64/manylinux…x86_64
wheel only when its variant matches; a binary with no variant metadata
still matches (the baseline build). Default: v1. Typed as
Amd64Variant, so any value outside v1..v4 is rejected at parse
time.
arm_variant: Option<String>ARM version selector (e.g. "6", "7"). When set, a 32-bit ARM binary
carrying arm_variant metadata becomes the wheel only when its variant
matches; a binary with no variant metadata still matches. Does not
affect aarch64/arm64 (64-bit ARM has no sub-variant).
auth: PypiAuthModeWhether the upload authenticates with a long-lived API token or with
GitHub Actions OIDC (PyPI Trusted Publishing). Default Auto:
a token when one is available, otherwise a Trusted-Publishing exchange
when an OIDC context is present.
token: Option<String>API token for the upload (templated). Falls back to the PYPI_TOKEN
env var, then MATURIN_PYPI_TOKEN, when unset. Sent as HTTP Basic
auth with the literal username __token__ and NEVER logged. Unused
when auth: oidc (Trusted Publishing mints its own short-lived token).
skip: Option<StringOrBool>Skip this publisher. Accepts bool or template string.
Accepts the legacy disable: spelling via serde alias for back-compat.
required: Option<bool>Override whether this publisher failing should fail the overall release.
Default: true — PyPI is a Manager-group publisher whose uploads are
one-way (a published filename can never be re-uploaded, even after
deletion), so a failed publish aborts by default to avoid surprising
the operator with a half-released version. Set to false to log
failures but continue.
if_condition: Option<String>Template-conditional gate: when the rendered result is falsy
("false" / "0" / "no" / empty), the PyPI publisher entry is
skipped. Render failure hard-errors.
retain_on_rollback: Option<bool>When true, a triggered rollback leaves this publisher’s work in
place rather than attempting to undo it. Default false. (PyPI has
no programmatic delete path anyway — rollback is warn-only — but the
flag suppresses even that warning.)
Trait Implementations§
Source§impl Clone for PypiConfig
impl Clone for PypiConfig
Source§fn clone(&self) -> PypiConfig
fn clone(&self) -> PypiConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PypiConfig
impl Debug for PypiConfig
Source§impl Default for PypiConfig
impl Default for PypiConfig
Source§impl<'de> Deserialize<'de> for PypiConfigwhere
PypiConfig: Default,
impl<'de> Deserialize<'de> for PypiConfigwhere
PypiConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for PypiConfig
impl JsonSchema for PypiConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PublisherGateOverrides for PypiConfig
impl PublisherGateOverrides for PypiConfig
Source§fn required_override(&self) -> Option<bool>
fn required_override(&self) -> Option<bool>
required: override. None keeps the publisher’s
built-in default; Some(true) anywhere escalates the release gate.Source§fn retain_on_rollback_override(&self) -> Option<bool>
fn retain_on_rollback_override(&self) -> Option<bool>
retain_on_rollback: override. Some(true) anywhere
opts the publisher’s successful work out of rollback.