You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever you pip install a package, it's being pulled from PyPI, the central Python package database. If you want your projects to be pip installable, you'll need to put them there. This example will use the Test PyPI server, but can be trivially modified to use the main PyPI repo.
save credentials and configurations to ~/.pypirc (if you're on Windows, %userprofile%/.pypirc)
[distutils]index-servers=
pypi
pypitest
[pypitest]repository = https://testpypi.python.org/pypi
username = <your user name goes here>
password = <your password goes here>
[pypi]repository = https://pypi.python.org/pypi
username = <your user name goes here>
password = <your password goes here>
Create source package: python setup.py sdist
This bundles up all your files and preps them for PyPI.
This creates a new directory called dist/ in your project directory.
The default way of interacting with PyPI using setuptools is insecure. Instead, we'll use twine: pip install twine
Now use twine to register your package with PyPI. Run this from your project directory: twine register -r pypitest dist/<package> -c ~/.pypirc
<package> is the .tar.gz file in the dist directory which was created earlier. It should correspond to the name field from your setup.py, not the project name on github.
Whenever you
pip install
a package, it's being pulled from PyPI, the central Python package database. If you want your projects to bepip
installable, you'll need to put them there. This example will use the Test PyPI server, but can be trivially modified to use the main PyPI repo.Register for an account on Test PyPI: https://testpypi.python.org/pypi
save credentials and configurations to
~/.pypirc
(if you're on Windows,%userprofile%/.pypirc
)Create source package:
python setup.py sdist
dist/
in your project directory.The default way of interacting with PyPI using setuptools is insecure. Instead, we'll use twine:
pip install twine
Now use
twine
to register your package with PyPI. Run this from your project directory:twine register -r pypitest dist/<package> -c ~/.pypirc
<package>
is the.tar.gz
file in the dist directory which was created earlier. It should correspond to thename
field from yoursetup.py
, not the project name on github.twine register -r pypitest dist/<package> -c %userprofile%/.pypirc
)And upload it!
twine upload dist/<package>
Further reading is provided here: https://packaging.python.org/en/latest/
The text was updated successfully, but these errors were encountered: