Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rye defaults to pypi regardless of configured custom servers. #1288

Open
narigama opened this issue Jul 28, 2024 · 4 comments
Open

Rye defaults to pypi regardless of configured custom servers. #1288

narigama opened this issue Jul 28, 2024 · 4 comments

Comments

@narigama
Copy link

narigama commented Jul 28, 2024

Steps to Reproduce

  • Start up an instance of pypiserver/pypiserver using docker [0].
  • Configure the instance in $HOME/.rye/config.toml as an additional source [1].
  • rye build --clean --wheel
  • rye publish --repository foobar

[0]

docker run --rm -d --name pypi -p 8080:8080 pypiserver/pypiserver

[1]

[[sources]]
name = "foobar"
url = "http://localhost:8080/simple/"
verify-ssl = false

Expected Result

Rye should push a build to the custom pypi server.

Actual Result

Rye defaults to pypi and asks for an access token.

$ rye publish --repository foobar
No access token found, generate one at: https://pypi.org/manage/account/token/
Access token:

Version Info

rye 0.37.0
commit: 0.37.0 (09b67c4 2024-07-20)
platform: linux (x86_64)
self-python: [email protected]
symlink support: true
uv enabled: true

Stacktrace

No response

@Zander-1024
Copy link
Contributor

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.

@narigama
Copy link
Author

narigama commented Aug 3, 2024

I don't think that's it either:

$ rye publish --repository foobar --repository_url http://localhost:8080/simple/

error: unexpected argument found

@Zander-1024
Copy link
Contributor

sorry
···
rye publish --repository foobar --repository-url http://localhost:8080/simple/
···

@jbaiter
Copy link

jbaiter commented Oct 25, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants