How to upload my plugin or package to PyPI?
The first step is to ensure that you have the detailed structure outlined in the following file:
Then, before uploading the plugin to PyPI, it’s necessary to ensure that it works. Some recommendations for testing it and the steps to follow to create a plugin are available on the following page:
Finally, ensuring that the above documents have been reviewed, you can create the package on PyPI to upload the plugin.
Tutorial for uploading plugin or package to PyPI
IMPORTANT: The following tutorial uses twine to upload the package to PyPI. However, there are many other ways to do it, and you are free to use any.
Package the files. To do this, run the following commands:
python -m pip install --upgrade build python -m build
The following files will be created:
+---dist | plugin-name-0.0.1--none-any.whl | plugin-name-0.0.1.tar.gz
Request a token from PyPI. This is shown on the following page, in the section “How do I use API tokens to authenticate with PyPI?”
Using Twine, this is necessary for PyPI security measures.
Upload the package to test PyPI. To do this, run the following commands:
IMPORTANT: PyPI has a testing version for uploading plugins and testing that they work well when downloaded. For this, replace “pypi” with “testpypi” in the following snippet.
python -m pip install --upgrade twine python -m twine upload --repository pypi dist/*
If the token is properly configured, there should be no problem.
With this, the plugin will be uploaded.