In the documentation for packaging and distributing Python packages, it says to use twine
with repository = https://upload.pypi.org/legacy/
in .pypirc
. Now this URL is both – from the last bit of it – a legacy way to do things, and a non-existing one at that:
$ twine register dist/scriptdoctest-0.1-py2.py3-none-any.whl
Registering package to https://upload.pypi.org/legacy/
Enter your username: MyUserName
Enter your password:
Registering scriptdoctest-0.1-py2.py3-none-any.whl
HTTPError: 410 Client Error: This API is no longer supported, instead simply upload the file. for url: https://upload.pypi.org/legacy/
Is using scriptdoctest.egg-info/PKG-INFO
now the preferred and only way to register a package, or is there some other way to do this with twine
or some other CLI tool?
In order to prepare your package for publication on PyPI, you need to provide some information about it. In general, you need to specify two kinds of information: Configuration of your build system. Configuration of your package.
Installing Python pip on your system allows you to manage PyPI packages easily. Many of these packages can be installed just by typing python -m pip install <package-name> into a terminal or command-line. Newer versions of Python 3 (3.4 and higher) and Python 2 (2.7. 9 and higher) come preloaded with pip.
https://packaging.python.org/distributing/ actually provides all necessary information.
setup.py
python setup.py sdist bdist_wheel
~/.pypirc
with your credentials from https://pypi.python.org/pypi
twine upload dist/*
- it is no longer necessary/possible to register
My .pypirc
looks as follows:
[distutils]
index-servers =
pypi
pypitest
[pypi]
repository=https://pypi.python.org/pypi
username=Martin.Thoma
password=[your password]
[pypitest]
repository=https://testpypi.python.org/pypi
username=Martin.Thoma
password=[your 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