Migrate from Pipenv/setup.{py,cfg} to Poetry/pyproject.toml
setup.{py,cfg}
Problems with Pipenv and - Pipenv dependency update is updating all packages. There is an option to update just one, but last time I tried it it was broken.
- When updating a dependency, two files needs to me changed: one for the dev env
Pipenv.{lock}
and the other for the PyPi distributionsetup.{py,cfg}
. In other words, there is no central file to handle dependencies. - Dependencies update is very CPU consuming
pyproject.toml
Advantages of Poetry and - Poetry can update one dependency at the time.
- Poetry uses a central file for the dev env and the PyPi distribution.
- Poetry can build and publish to PyPi out of the box.
wheel
andtwine
are hidden under the hood. Nice for CI/CD and new contributors. - Poetry installs dev dependencies by defaults
-
pyproject.toml
is the standard file format defined by the Python project. - Easier installation of DuniterPy as a local dependency
Poetry
- https://github.com/python-poetry/poetry
- https://python-poetry.org/
- Conference explaining different dependencies manager and Python env (dev env)
Plan
-
Add documentation for Poetry installation and usage, update README.md
link -
Add pyproject.toml
andpoetry.lock
files -
Get rid of Pipenv doc, update README.md
link -
Get rid of Pipenv{.lock}
andsetup.py
files -
Update release.sh
-
Update documentations: release, tests
Black, Python 3.5 support
-
Black
dependency needs Python 3.6 as a minimal version for the development environment. We want to keep Python 3.5 support. We wantBlack
not to be pre-installBlack
in Poetry for now. It’s a pain in the ass, as aBlack
should be installed separately.
The classifiers are updated (erased) by python
dependency.
Try to upload to PyPi test and install it in Python 3.5 environment. Not possible to install it Silkaj without Python 3.5 support on a Python 3.5 installation.
- Solution: the black line is commented, and can be uncommented to install
black
on Python version ≥ 3.6 environement. -
Open ticket to add Black
as a dependency when dropping Python 3.5.
Other
#217 (closed): Migration tosetup.cfg
- Dependency manager discussion for DuniterPy
Edited by Moul