Publish Python Packages
Suppose you have a Python package that you want to publish to your Python Package Index in Space using the Twine tool.
Publish packages using the Twine command-line tool
Connect to the repository in Space:
Add a repository link to the .pypirc file. For example:[distutils] index-servers = space-mypypi [space-mypypi] repository = https://packages.jetbrains.space/pypi/p/my-python-project/mypypi/legacy
index-serversis an identifier of our Space repository. You can specify any name for it.
Use the keyring tool to save the generated token. For example, if your Space username is
Anna:keyring set https://packages.jetbrains.space/pypi/p/my-python-project/mypypi/simple Anna
When asked for a password, provide the generated token.
An alternative to the
keyringtool would be storing the token in the
.pypircfile. Note that this way is less secure. For example, if your username is
Annaand the token is
abc1234:[distutils] index-servers = space-mypypi [space-mypypi] repository = https://packages.jetbrains.space/pypi/p/my-python-project/mypypi/legacy username = Anna password = abc1234
Upload the package to the repository using the
twinetool. For example, we suppose that the package is located in the
./distdirectory:twine upload -r space-mypypi dist/*