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.
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:
package-name/package-name/__init__.py. You should see one thing:
This is where you add your package code. I'll add some basic stuff:
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
This is amazing! Thank you so much! If you want to see it, the name of it is "tilecode"
Cool! You can also add change the beginning of pyproject.toml from
[tool.poetry] name = "tilecode" version = "0.0.0" description = "" authors = ["WhatDoWeDoNow"]
[tool.poetry] name = "tilecode" version = "0.0.0" description = "" authors = ["WhatDoWeDoNow"] documentation = "<.md file>"
to add documentation!
I'm trapped when Poetry asks my PyPI password:
AND IT DOESN'T LET ME PUT MY PASSWORD