Use pyproject.toml and setup.cfg for Setuptools configuration

This is a major refactor of setup configuration format.

  1. Instead of setup.py and setup.cfg, most of information is stored in pyproject.toml.
    • pyproject.toml is 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.toml is the future of Python package metadata declaration.
  2. Instead of using requirements.txt and requirements_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, pytest and necessary plugins)
    • pip install quantify-core[dev] is equivalent to pip 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.md and AUTHORS.md have 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

Merge request reports

Loading