pypa / twine

Utilities for interacting with PyPI

Home Page:https://twine.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

twine ignores my .pypirc

mluerig opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues (open and closed), and could not find an existing issue

What keywords did you use to search existing issues?

twine doesn't find my pypirc / twine ignores pypirc

What operating system are you using?

Windows 11

If you selected 'Other', describe your Operating System here

No response

What version of Python are you running?

3.9

How did you install twine? Did you use your operating system's package manager or pip or something else?

pip install twine

What version of twine do you have installed (include the complete output)

5.0.0

Which package repository are you using?

test.pypi.org

Please describe the issue that you are experiencing

I'm trying to upload my package to test.pypi.org, while having my .pypirc in my home directory, which contains

[distutils]
index-servers =
     pypi
     testpypi

[pypi]
username = __token__
password = pypi-...

[testpypi]
username = __token__
password = pypi-...

When using python -m twine upload --skip-existing dist/* --repository-url https://test.pypi.org/legacy/ --verbose, I get prompted for password to username __token__. Same behavior if I remove my .pypirc file - I always get this:

INFO     Querying keyring for password
Enter your API token:

It also does not work if I use --config-file to point to the file.

It does work when I paste my token in there, so that's not it.

Please list the steps required to reproduce this behaviour

  1. install package in editable mode
  2. build wheel
  3. use twine

Anything else you'd like to mention?

No response

sorry I just figured it out - it was the --repository-url https://test.pypi.org/legacy/ flag which made it ignore the entry in the pypirc file. I switched to --repository testpypi and then it worked. was not easy to figure out from the feedback I got from twine though...