2018 m. gegužės 11 d., penktadienis

How to create pypi python package


$ python setup.py sdist bdist_wheel
# pip install wheel # if there is error runing upper command



$ twine upload --repository testpypi dist/*


Old ways

 Create login file
Window: C:\Users\username\.pypirc
Unix: /home/username/.pypirc
$ chmod 600 ~/.pypirc

[distutils]
index-servers =
        pypi
        pypitest

[pypitest]
repository = https://test.pypi.org/legacy/
username = username
password = password

[pypi]
repository = https://pypi.python.org/pypi
username = username
password = password



Registration is only required the first time
$ python setup.py register -r pypitest
$ python setup.py sdist
$ twine upload dist/* -r pypitest

Creating virtual env
$ virtualenv -p python3 testenv

Installing package
$ pip install --verbose --extra-index-url https://test.pypi.org/legacy/ stellar-desk
$ pip install  --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple stellar-desk
$ pip install  --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple stellar-desk==0.3.1

$ pip show stellar-desk

Main enviroment
$ pip install package_name


Official links:
https://pypi.org - This is a pre-production deployment of Warehouse.
Next Generation Python Package Repository. Beta version, that will be replace pypi
https://pypi.python.org/

Test pypi package:
https://test.pypi.org
https://testpypi.python.org



Resources: