Even if I googled the method of registering a package on PyPI in a Japanese article, there were many old methods and I could not upload it easily, so I read the guide again and tried the procedure.
https://packaging.python.org/guides/using-testpypi/
This article basically describes the flow when uploading a package. (We do not handle how to write setup.py.)
--Drop the wheel and twine in advance
- pip install wheel twine
--Access https://test.pypi.org/
--Register and write down your username and password
--Execute the following under the directory where the package you created (there is setup.py)
- python setup.py sdist
--You should have a dist directory and a compressed file for upload.
--Create and place .pypirc
.pypirc
[testpypi]
username: <username>
password: <password>
--Use twine
- twine upload --repository-url https://test.pypi.org/legacy/ dist/*
--The uploaded library is displayed on My Page of test.pypi.org
The procedure is almost the same as that at the time of testing, but here are the differences in the procedure at the time of testing.
--Since it will be published on https://pypi.python.org/pypi in production, register on the ← site in advance and make a note of the username and password. --Rewrite pypirc as follows
.pypirc
[pypi]
username: <username>
password: <password>
--When using twine, do not use --repository
, just follow the command below.
- twine upload dist/*
Recommended Posts