Trying out code with Poetry

Poetry, like flit, is one of the most recent packages aimed at helping with package development in Python. Among its features are the ability to write a pyproject.toml file, which is more secure and easy than the older approach with setup.py, and the ability to create a dedicated virtual environment for a project, with all dependencies pinned. Even more importantly, it has a thorough dependency resolution engine that makes sure all dependency versions fit with each other, and an interface to monitor and bump your dependency tree.

But first, we will start by creating a project template. First, type this:

poetry new --name=wikiwwii my-package

This will generate a new folder, my-package, with default files and folders within. Copy and paste everything from this folder into our existing repository folder; delete the REAMDE.rst file (we already have README.md). The most important thing we've got from poetry, for now, is the pyproject.toml dummy file—this specification will be used to generate a setup.py file upon installation. 

Let's check the structure of our repository:

>>> tree wikiwwii
├── README.md
├── pyproject.toml
├── tests
│ ├── __init__.py
│ └── test_wikiwwii.py
└── wikiwwii
└── __init__.py

If everything looks fine, feel free to commit the changes to GitHub (generally, you should commit after each and every logical step—we can always squash commits into one later, for readability purposes).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.210.133