I have pip
installed pypirc
and set up a ~/.pypirc
file with the requisite password. Why is twine
asking for a password each time python setup.py
is invoked?
$twine upload --repository-url https://test.pypi.org/legacy/ dist/*
Enter your username:
Here is the form of the .pypirc
[distutils] # this tells distutils what package indexes you can push to
index-servers =
pypi
pypitest
[pypi]
repository: https://pypi.python.org/pypi
username: myuser
password: mypwd
[pypitest]
repository: https://testpypi.python.org/pypi
username: myuser
password: mypwd
Update Not including the --repository-url
gives:
UploadToDeprecatedPyPIDetected: You're trying to upload to the legacy PyPI site 'https://pypi.python.org/pypi'. Uploading to those sites is deprecated.
The new sites are pypi.org and test.pypi.org. Try using https://upload.pypi.org/legacy/ (or https://test.pypi.org/legacy/) to upload your packages instead. These are the default URLs for Twine now.
More at https://packaging.python.org/guides/migrating-to-pypi-org/ .
pypirc file. A . pypirc file allows you to define the configuration for package indexes (referred to here as “repositories”), so that you don't have to enter the URL, username, or password whenever you upload a package with twine or flit.
pypirc location on windows. Your . pypirc file on windows should be in your $HOME directory.
twine upload dist/*
or
twine upload -r pypi dist/*
or
twine upload -r pypitest dist/*
As far as I understand twine --repository-url <url>
doesn't even consult ~/.pypirc
. With -r <name>
it lookups ~/.pypirc
for the URL, user name and password. If you omit -r <name>
, twine uses the first repo from ~/.pypirc
.
python -m twine upload dist/* -u%username% -p%password%
you can
set username="token"
set password="pypi-AgEIc..."
set username=pypi name
set password=pypi password
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With