PYPI

2017/10/25 Python

The Python Package Index is the official third-party software repository for Python. Some package managers, including pip, use PyPI as the default source for packages and their dependencies. 1 Twine is a utility for publishing Python packages on PyPI. It provides build system independent uploads of source and binary distribution artifacts for both new and existing projects. 2

Edit your pypi configure file

edit ~/.pypirc

[distutils]
index-servers=
    pypi
    testpypi

[pypi]
username: zhiqiangfan
password: xxx

[testpypi]
repository: https://test.pypi.org/legacy/
username: zhiqiangfan
password: xxx

Install twine

pip install --user --upgrade pip setuptools twine

Package your project

python setup.py sdist

Test deploy

  • upload your package to test pypi: twine upload -r testpypi dist/*
  • install your package from test pypi: pip install --index-url https://test.pypi.org/simple/ your-package
  • test your package locally

Deploy your package

twine upload dist/*

REF

License: (CC 3.0) BY-NC-SA

Search

    Table of Contents