Migrate from Pipenv/setup.{py,cfg} to Poetry/pyproject.toml
Problems with Pipenv and setup.{py,cfg}
- 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
Advantages of Poetry and pyproject.toml
- 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.
wheelandtwineare hidden under the hood. Nice for CI/CD and new contributors. - Poetry installs dev dependencies by defaults
-
pyproject.tomlis 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.mdlink -
Add pyproject.tomlandpoetry.lockfiles -
Get rid of Pipenv doc, update README.mdlink -
Get rid of Pipenv{.lock}andsetup.pyfiles -
Update release.sh -
Update documentations: release, tests
Black, Python 3.5 support
-
Blackdependency needs Python 3.6 as a minimal version for the development environment. We want to keep Python 3.5 support. We wantBlacknot to be pre-installBlackin Poetry for now. It’s a pain in the ass, as aBlackshould 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
blackon Python version ≥ 3.6 environement. -
Open ticket to add Blackas a dependency when dropping Python 3.5.
Other
#217 (closed): Migration tosetup.cfg- Dependency manager discussion for DuniterPy
Edited by Moul