-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vendor Rust crates into source distributions
`vendor_rust()` takes an existing sdist tar ball and creates a new sdist with all Rust crates vendored. This allows offline compilation without downloading any Rust crates at build time. Switch from `tomli` to `toml`. The `tomli` package does not have write support. I have successfully wheel builds with vendored crates for - `cryptography-42.0.7.tar.gz` - `maturin-1.5.1.tar.gz` - `pydantic_core-2.18.4.tar.gz` - `setuptools-rust-1.9.0.tar.gz` with `CARGO_NET_OFFLINE=true python3 -m build -w`. Signed-off-by: Christian Heimes <[email protected]>
- Loading branch information
Showing
14 changed files
with
542 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "pyo3_test" | ||
version = "1.0.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
pyo3 = { version = "0.21.2", features = ["gil-refs"] } | ||
|
||
[lib] | ||
name = "_lib" | ||
crate-type = ["cdylib"] | ||
path = "rust/lib.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
graft python | ||
graft rust | ||
include Cargo.toml Cargo.lock tests.py tox.ini | ||
exclude .cargo vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[build-system] | ||
requires = ["setuptools", "setuptools-rust"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "pyo3_test" | ||
version = "1.0.0" | ||
|
||
[tool.setuptools.packages] | ||
find = { where = ["python"] } | ||
|
||
[[tool.setuptools-rust.ext-modules]] | ||
target = "pyo3_test._lib" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from ._lib import add | ||
|
||
__all__ = ["add"] |
Oops, something went wrong.