You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a custom private registry, what is the most "correct" way to configure registry support for consumers of an sdist?
In my team's Rust repositories, we simply add a .cargo/config.toml to the workspace root of any workspace with crates that will be published to, or consumed from, our private registry. This is fine for Rust projects consuming Rust packages, but for maturin sdist packages, what are our options?
Consider a Rust workspace where the bulk of the code is in crates/lib, and a Maturin package for Python consumers is defined in crates/python. It appears that, by default, the crates/python/.cargo/config.toml file is included in the sdist, but it doesn't appear that the file is actually used by pip install, because even if I define the private registry in that config file, I get this error when trying to install an sdist generated by maturin:
registry index was not found in any configuration: `<custom>`
💥 maturin failed
Caused by: Cargo metadata failed. Does your crate compile with `cargo build`?
Caused by: `cargo metadata` exited with an error:
Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/tmp/pip-modern-metadata-r2862ymr', '--interpreter', '/root/.pyenv/versions/3.9.20/bin/python3.9']' returned non-zero exit status 1.
I can get it to build by putting the Registry definition in my home directory's .cargo/config.toml, but is this the only, or the best, option? Is there a way to bundle the registry metadata (index and credential-provider) in the sdist itself somehow?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
When using a custom private registry, what is the most "correct" way to configure registry support for consumers of an
sdist?In my team's Rust repositories, we simply add a
.cargo/config.tomlto the workspace root of any workspace with crates that will be published to, or consumed from, our private registry. This is fine for Rust projects consuming Rust packages, but for maturinsdistpackages, what are our options?Consider a Rust workspace where the bulk of the code is in
crates/lib, and a Maturin package for Python consumers is defined incrates/python. It appears that, by default, thecrates/python/.cargo/config.tomlfile is included in thesdist, but it doesn't appear that the file is actually used bypip install, because even if I define the private registry in that config file, I get this error when trying to install ansdistgenerated bymaturin:I can get it to build by putting the Registry definition in my home directory's
.cargo/config.toml, but is this the only, or the best, option? Is there a way to bundle the registry metadata (index and credential-provider) in thesdistitself somehow?Beta Was this translation helpful? Give feedback.
All reactions