Member-only story
Managing Python Projects With Poetry
Software projects are almost never built without a number of third party libraries. It’s usually always better to use a library, then to spend a large amount of time reinventing the wheel. Selecting a good tool to manage these dependencies is thus crucial.
In this article I will describe how to use Poetry, a very popular tool for managing third party libraries in your Python project.
First, you need to have Poetry installed on your local machine. You can do this either by pip installing it, which I wouldn’t recommend because it will also install a large number of dependent libraries. Instead, use the installation script, provided by poetry. Follow the instructions here.
Now you can create a new python project, by running
poetry new <your_project_name>
This will create a project with following structure:
As you can see, we get a folder with our project name, a tests folder, a README and last but not least a pyproject.toml file which is where we will keep track of all of our dependencies. A lot of other programming languages have similar files:
- JavaScript ->…