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 distribution `setup.{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. `wheel` and `twine` 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)](https://www.youtube.com/watch?v=pA4XriRWVxQ)
## Plan
- [x] Add documentation for Poetry installation and usage, update `README.md` link
- [x] Add `pyproject.toml` and `poetry.lock` files
- [x] Get rid of Pipenv doc, update `README.md` link
- [x] Get rid of `Pipenv{.lock}` and `setup.py` files
- [x] 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 want `Black` not to be pre-install `Black` in Poetry for now. It’s a pain in the ass, as a `Black` 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: Migration to `setup.cfg`~~
- [Dependency manager discussion for DuniterPy](https://git.duniter.org/clients/python/duniterpy/issues/66)
issue