Modern Python Projects Transcripts
Chapter: Managing Python project
Lecture: Publishing package with Poetry
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
One last thing that I want to show you, is how to build a Python package with poetry. Normally, when you want to create a Python package by hand,
0:08
you go to the Python packaging User guide, and you follow instructions from there. First you need to create a setup.py file.
0:19
Then you need to install setup tools and wheel that you will use to generate the sdist and bdist_wheel folders.
0:27
Then you need to install another tool called twine, and finally you will have to use the tool to upload your package to pypi
0:34
The instructions are very detailed and rather easy to follow, but there is no way I would remember all those steps of the top of my
0:42
head, unless I build and publish a lot of Python packages, which I don't. Let's compare this to using poetry.
0:49
First we run poetry build. Then we run poetry publish, and that's all two commands, with the most obvious names possible built and publish.
1:02
As you can see, the publish command asked me for a Username and password for PyPI. So if you want to publish your package,
1:09
need to first go to the pypi website and create an account. This example Folder contains some rubbish files, so I'm obviously not going to publish it.
1:18
But at the end of this course where we will be building a real Python application
1:21
I will show you how you can build and publish a PyPI package, so stay tuned.