picki23
picki23

Reputation: 63

using maturin to publish to private PyPi (code artifact)

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?

Upvotes: 0

Views: 675

Answers (1)

Simon George
Simon George

Reputation: 1

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]/

Upvotes: 0

Related Questions