GoogleCloudPlatform/cloud-sql-python-connector

Switch to using `pyproject.toml` over `setup.py` for package

jackwotherspoon opened this issue · 1 comments

Nowadays it is recommended to package python libraries using pyproject.toml over setup.py

This comes with the added benefit of having all configuration in one file, so the removal of mypy.ini, pytest.ini etc etc.

To keep version in version.py for release-please and user agent config:

[project]
name = "package"
dynamic = ["version"]

[tool.setuptools.dynamic]
version = {attr = "package.__version__"}

ref: https://packaging.python.org/en/latest/guides/single-sourcing-package-version