[python] requirements.txt, install_requires, and Python-requires
In dune_python_install_package
a requirements.txt
is created for each module. Usually, this file contains the development requirements of a package. How does this relate to what is stated in Python-requires
? Is this the way to add development requirements? And packaging requirements are then stated pyproject.toml
?
Where would be the right place to add pylint
and flake8
in the current setup which are only needed during development?
UPDATE: A requirements.txt
file is no longer created (see !1062 (merged)). This resolves the confusion. This means currently only "minimal" required dependencies can be stated (through dune.module's Python-requires
argument which is propagated to setup.py
's install_requires
, see https://packaging.python.org/discussions/install-requires-vs-requirements/ for what install_requires
is good for). However, the current default mode when running dunecontrol all
creates a developer environment with local internal virtual env and editable package installs. Hence, it would be nice to have a way to specify development requirements (e.g. linters or testing frameworks). This is a job that is often accomplished by providing such packages in a requirement.txt
file (see e.g. https://packaging.python.org/discussions/install-requires-vs-requirements/, https://github.com/yngvem/python-project-structure, https://gitlab.dune-project.org/samuel.burbulla/dune-mmesh/-/blob/master/requirements.txt).
Idea/suggestion: if a requirement.txt
is found in the configured Python dune module (in the build directory) next to setup.py
, the requirements.txt
is used. There are several possibilities what "used" means, the simplest is that requirements.txt
is considered as pip install -e -r requirements.txt
when doing an editable installation.