using maturin to publish to private PyPi (code artifact)

268 views Asked by At

I have a rust project, using pyo3. The project is built and installed via Maturin and locally everything works ok.

I'm trying to publish the package into an AWS Code Artifact PyPi, however, even after configuring MATURIN_PYPI_TOKEN and providing the URL (Yes, I've checked - it's the right URL) I get "Caused by: Failed to upload the wheel with status 404: Not Found"

Here's some my pyproject.toml

[build-system]
requires = ["maturin >= 1.0.0"]
build-backend = "maturin"

[tool.maturin]
features = ["pyo3/extension-module"]
compatibility = "linux"

my project structure:

my-project
--.venv
--src
--target
--cargo.toml
--cargo.lock
--poetry.lock
--pyproject.toml

in the src, I have only rust files and the crate is a library (lib.rs).

does anyone have a clue why can't I publish the repo?

1

There are 1 answers

1
Simon George On

This worked for me:

maturin publish --username aws --password $(aws codeartifact get-authorization-token --domain [your code artifact domain] --query authorizationToken --output text) --repository-url https://[your account].d.codeartifact.[your region].amazonaws.com/pypi/[your code artifact repository name]/