I was interested in automatic blog posting, but I made it myself because Python didn't have an easy-to-use library. I want to do pip install hogehoge
, so I summarized the method.
You should register at PyPI! Use twine for uploading!
The following is the command when using Pipenv, but please replace it as appropriate by looking at Reference.
-You have created an account with PyPI and Test PyPI. --Prepare LICENSE, README.md, setup.py, etc. If you haven't done so already, please refer to here to create it.
Uploading to PyPI uses twine
, so install it in advance.
pipenv install --dev twine
The following will create .whl
and .tar.gz
under dist /
.
python setup.py sdist bdist_wheel
You can use PyPI in the Test environment before uploading to production PyPI. You don't have to use it, but it's better to use it before you get used to it.
python -m twine upload --repository testpypi dist/*
This completes the upload to Test PyPI. Since it's a big deal, let's install from Test PyPI.
pipenv install --pypi-mirror https://test.pypi.org/simple/ <PACKAGE_NAME>
After confirming the operation of the library uploaded to Test PyPI, let's finally register it in the actual PyPI. Please feel free to contact us as it will not be judged by anyone.
python -m twine upload dist/*
This completes the upload to the production PyPI. Finally, try the example one and you're done. Thank you for your hard work.
pipenv install <PACKAGE_NAME>
Recommended Posts