Open narigama opened 4 months ago
when are you first run, you need use:
rye publish --repository foobar --repository_url http://localhost:8080/simple/
rye publish doesn't read config.toml, it looks up ~/.rye/credentials based on the parameters you enter.
I don't think that's it either:
$ rye publish --repository foobar --repository_url http://localhost:8080/simple/
error: unexpected argument found
sorry ··· rye publish --repository foobar --repository-url http://localhost:8080/simple/ ···
That doesn't work either, I'm trying to publish to a self-hosted Sonatype Nexus repository, which worked fine with Poetry:
$ ❯ rye publish --repository nexus --repository-url https://nexus.internal/repository/pypi-myrepo/simple
No access token found, generate one at: https://pypi.org/manage/account/token/
Access token:
My ~/.pypirc
:
[distutils]
index-servers =
nexus
[mdz]
repository = https://nexus.internal/repository/pypi-myrepo
username = nexuspypi
The password was stored with keyring
as documented in the Twine docs.
Publishing with --repository nexus
behaves just the same.
How can I published to a custom internal repository with Rye?
-- Update:
Specifying --username
and --token
made it work for me. I think this needs more documentation, publishing to a custom repository is very common and the docs are very bare bones on that use case at the moment.
Steps to Reproduce
pypiserver/pypiserver
using docker [0].$HOME/.rye/config.toml
as an additional source [1].rye build --clean --wheel
rye publish --repository foobar
[0]
[1]
Expected Result
Rye should push a build to the custom pypi server.
Actual Result
Rye defaults to pypi and asks for an access token.
Version Info
rye 0.37.0 commit: 0.37.0 (09b67c469 2024-07-20) platform: linux (x86_64) self-python: cpython@3.12.3 symlink support: true uv enabled: true
Stacktrace
No response