My .pypirc file:
[distutils]
index-servers =
pypi
internal
[pypi]
username:pypiusername
password:pypipasswd
[internal]
repository: http://10.11.12.13:8080
username: ning
password: xxxx
I want to write a script that upload packages but don't want to require a .pypirc file on the machine where it runs. I can specify repository with -r
, but is there a way to specify username
and password
as well? Or Is there an option to pass a different file (e.g --config-file ./my-pypyrc
)
(Yes, you can now host your Python package in GitHub by using private-pypi . ) File system.
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.
This file must be placed in $HOME/. pypirc for pip/twine to use it. Keep in mind, pypi.org and test.pypi.org are not integrated, so you'll need to have a separate account created on each site.
I'm flabbergasted that setuptools has no secure way to do this on the command line, but you can use Twine (https://github.com/pypa/twine)
twine upload -u USERNAME -p PASSWORD dist/*
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