How to create a python package on repl.it!
In this tutorial, I'm gonna show you how to create a python package and publish it to pypi. Many people say this is impossible on repl.it. It is not. Though you can't do it using a generic approach, but using poetry, you can do it quite easily.
Part 1: coding your package
Start by creating a python repl. Then go to the bash shell (
CTRL + SHIFT + S or CMD + SHIFT + S) and type
poetry new mypackage. **Replace the mypackage with your package name. If when you import it, you want it to have underscores (
my_package) , use dashes (
my-package). Here is what you should see:
Part 2: Publishing your package
Now you can publish your package so others can use it! Create an account on pypi. In the bash shell, type
cd package-name. Again, replace package-name with your package name. After that, type
poetry update to update the dependencies for your package. Then type
poetry build. Then
poetry publish. When it asks for them, enter you pypi credentials. You are good to go!
To create a new release, simply change line one of
package-name/package-name/__init__.py to 0.1.1, and line three of
poetry build, and