Skip to main content

pymsbuild-rust

This is a pymsbuild extension for compiling native modules written in Rust.

Quick Start

In your _msbuild.py, import RustPydFile and Cargo from pymsbuild_rust (using import * is okay).

While Cargo is used to run the build, all files need to be specified from your _msbuild.py file to be collected when building an sdist, and to handle incremental builds correctly.

from pymsbuild import *
from pymsbuild_rust import *

METADATA = {...}

PACKAGE = Package(
    'package',
    PyFile("__init__.py"),
    RustPydFile(
        "native",
        Cargo("Cargo.toml"),
        SourceFile("src/lib.rs"),
        source="native"
    ),
)

The Cargo element refers to your Cargo.toml, which should specify that a cdylib is to be built. The name of the lib should match the name provided to RustPydFile, which will also be the resulting extension module's name.

[lib]
name = "native"
crate-type = ["cdylib"]

Other than this, the module may build in any way it likes. Most likely, you will use PyO3, and so should follow their documentation for instructions on setting up the rest of your project (ignoring the parts that refer to other build backends such as Maturin).

Other files listed in the RustPydFile will be included in your sdist, and will be used to determine whether the module needs to be recompiled.

Theoretically, multiple Cargo elements will trigger multiple builds. However, as they will all be directed into the same directory, this may not do what you hope. Advanced users may find some value regardless.

Metadata

Release files for pymsbuild-rust 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymsbuild-rust 0.1.8
File Size Uploaded Provenance Actions
pymsbuild_rust-0.1.8.tar.gz 4.7 kB Without provenance Details for pymsbuild_rust-0.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pymsbuild-rust 0.1.8
File Interpreter ABI Platform Actions
pymsbuild_rust-0.1.8-py3-none-any.whl Python 3 none any Details for pymsbuild_rust-0.1.8-py3-none-any.whl

Total release size: 15.5 kB

Release files / pymsbuild_rust-0.1.8.tar.gz

Download URL pymsbuild_rust-0.1.8.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
747644c66bdf89354c3bda72b7df7533c7c2eac6012425ec444d44603f959e1e
BLAKE2b-256 checksum
How to use checksums
e8a2e0788745160eb2d170aba954b28fe78e340507ad40849d07c714ab6e63c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / pymsbuild_rust-0.1.8-py3-none-any.whl

Download URL pymsbuild_rust-0.1.8-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3428fdb37add7256f992f7b47292706987b783c6e1fa06c761fcbb8aa830209d
BLAKE2b-256 checksum
How to use checksums
70524923e7e4561e0ca7dfe4db935481403f54710aac38b1b4b351d5e1a4fc7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Security for pymsbuild-rust 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page