使用maturin发布到私有PyPi(代码神器)

问题描述 投票:0回答:1

我有一个 Rust 项目,使用 pyo3。该项目是通过 Maturin 构建和安装的,并且在本地一切正常。

我正在尝试将包发布到 AWS Code Artifact PyPi 中,但是,即使在配置 MATURIN_PYPI_TOKEN 并提供 URL(是的,我已经检查过 - 这是正确的 URL)之后,我还是收到“原因:无法上传轮子”状态 404:未找到”

这是我的一些 pyproject.toml

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

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

我的项目结构:

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

在 src 中,我只有 rust 文件,而板条箱是一个库(lib.rs)。

有人知道为什么我不能发布存储库吗?

rust pypi python-poetry aws-codeartifact maturin
1个回答
0
投票

这对我有用:

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]/
© www.soinside.com 2019 - 2024. All rights reserved.