Skip to main content

PypiConfig

Struct PypiConfig 

Source
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: bool

Also 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: bool

Tolerate 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.

§author: Option<String>

Package author, emitted as the METADATA Author header.

§author_email: Option<String>

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_aarch64
§amd64_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: PypiAuthMode

Whether 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

Source§

fn clone(&self) -> PypiConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PypiConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PypiConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for PypiConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for PypiConfig

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PublisherGateOverrides for PypiConfig

Source§

fn required_override(&self) -> Option<bool>

Config-level 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>

Config-level retain_on_rollback: override. Some(true) anywhere opts the publisher’s successful work out of rollback.
Source§

impl Serialize for PypiConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more