Use pyproject.toml and setup.cfg for Setuptools configuration
This is a major refactor of setup configuration format.
- Instead of
setup.pyandsetup.cfg, most of information is stored inpyproject.toml.-
pyproject.tomlis a relatively modern format for storing package metadata. - It is standardized and universally supported by many build backends (
setuptools,poetry,flit) and tools (pytest,mypy, ...). That would allow to switch between build and test systems more easily, if we want. - Seems that there is a consensus in Python community that
pyproject.tomlis the future of Python package metadata declaration.
-
- Instead of using
requirements.txtandrequirements_dev.txt, optional requirements are used.-
pip instlal quantify-core[docs]will install dependencies needed to build documentation. -
pip install quantify-core[test]will install testing dependencies (namely,pytestand necessary plugins) -
pip install quantify-core[dev]is equivalent topip install quantify-core[docs,test]plus some extra development tools we normally use in development.
-
Notably, versioning-related code is still located in setup.py. That is because miniver does not yet support pyproject.toml. Also, some config values are left in setup.cfg, I didn't find their equivalents in pyproject.toml.
Merge checklist
See also merge request guidelines
-
Merge request has been reviewed (in-depth by a knowledgeable contributor), and is approved by a project maintainer. -
New code is covered by unit tests (or N/A). -
New code is documented and docstrings use numpydoc format (or N/A). -
New functionality: considered making private instead of extending public API (or N/A). -
Public API changed: added @deprecated(or N/A). -
Tested on hardware (or N/A). -
CHANGELOG.mdandAUTHORS.mdhave been updated (or N/A). -
Windows tests in CI pipeline pass (manually triggered by maintainers before merging).
For reference, the issues workflow is described in the contribution guidelines.
Edited by Robert Sokolewicz