migrate setup procedure to use pyproject.toml
Using a pyproject.toml
at the package root seems to have evolved as a common practice. This should also be considered for AROSICS to keep the project future-proof and to avoid DeprecationWarnings like this from py_tools_ds:
DEPRECATION: Legacy editable install of py_tools_ds==0.22.2 from .../py_tools_ds (setup.py develop) is deprecated. pip 25.0 will enforce this behaviour change. A possible replacement is to add a pyproject.toml or enable --use-pep517, and use setuptools >= 64. If the resulting installation is not behaving as expected, try using --config-settings editable_mode=compat. Please consult the setuptools documentation for more information. Discussion can be found at https://github.com/pypa/pip/issues/11457
Here are some resources for more information:
- How to modernize a setup.py based project?
- Is setup.py deprecated?
- User guide - Package Discovery and Namespace Packages
- Transition your Python project to use pyproject.toml and setup.cfg! (An example.)
- cookiecutter-pypackage pyproject.toml
Example transitions:
- https://github.com/dib-lab/screed/pull/83/files
- https://github.com/isofit/isofit/commit/012dfce79fdc76121695a3d40ac6e28662fea3d1 (part of https://github.com/isofit/isofit/pull/342)
Basically, all the package metadata from the setup.py can be moved to a pyproject.toml or the setup.cfg. Isofit still uses the setup.cfg, I guess because there were some contraints regarding the package installation in editable mode (see, e.g., here Not sure if these constraints are solved in the meanwhile.
This comment suggests some good practice how to do the migration. Also the use of setuptools_scm may be considered as it makes the version tags the only source of truth.