GoogleCloudPlatform / cloud-sql-python-connector

A Python library for connecting securely to your Cloud SQL instances.
Apache License 2.0
284 stars 67 forks source link

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

Open jackwotherspoon opened 9 months ago

jackwotherspoon commented 9 months ago

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.

jackwotherspoon commented 8 months ago

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