Skip to content

Commit 4fe1320

Browse files
build: update package to use pyproject.toml (#1230)
1 parent 144311b commit 4fe1320

9 files changed

+408
-442
lines changed

.kokoro/requirements.in

+3
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ setuptools
88
nox>=2022.11.21 # required to remove dependency on py
99
charset-normalizer<3
1010
click<8.1.0
11+
build
12+
tomli
13+
secretstorage

.kokoro/requirements.txt

+318-297
Large diffs are not rendered by default.

.mypy.ini

-22
This file was deleted.

noxfile.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
BLACK_VERSION = "black==24.10.0"
2424
ISORT_VERSION = "isort==5.13.2"
2525

26-
LINT_PATHS = ["google", "tests", "noxfile.py", "setup.py"]
26+
LINT_PATHS = ["google", "tests", "noxfile.py"]
2727

2828
TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]
2929

@@ -71,7 +71,7 @@ def lint(session):
7171
"--non-interactive",
7272
"--show-traceback",
7373
)
74-
# verify that setup.py is valid
74+
# verify that pyproject.toml is valid
7575
session.run("python", "-m", "build", "--sdist")
7676
session.run("twine", "check", "--strict", "dist/*")
7777

pyproject.toml

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
[build-system]
16+
requires = ["setuptools"]
17+
build-backend = "setuptools.build_meta"
18+
19+
[project]
20+
description = "Google Cloud SQL Python Connector library"
21+
name = "cloud-sql-python-connector"
22+
authors = [{ name = "Google LLC", email = "[email protected]" }]
23+
license = { text = "Apache 2.0" }
24+
requires-python = ">=3.9"
25+
readme = "README.md"
26+
classifiers = [
27+
# Should be one of:
28+
# "Development Status :: 3 - Alpha"
29+
# "Development Status :: 4 - Beta"
30+
# "Development Status :: 5 - Production/Stable"
31+
"Development Status :: 5 - Production/Stable",
32+
"Intended Audience :: Developers",
33+
"License :: OSI Approved :: Apache Software License",
34+
"Programming Language :: Python",
35+
"Programming Language :: Python :: 3",
36+
"Programming Language :: Python :: 3.9",
37+
"Programming Language :: Python :: 3.10",
38+
"Programming Language :: Python :: 3.11",
39+
"Programming Language :: Python :: 3.12",
40+
"Programming Language :: Python :: 3.13",
41+
"Operating System :: OS Independent",
42+
]
43+
dependencies = [
44+
"aiofiles",
45+
"aiohttp",
46+
"cryptography>=42.0.0",
47+
"dnspython>=2.0.0",
48+
"Requests",
49+
"google-auth>=2.28.0",
50+
]
51+
dynamic = ["version"]
52+
53+
[project.urls]
54+
Homepage = "https://github.com/GoogleCloudPlatform/cloud-sql-python-connector"
55+
Repository = "https://github.com/GoogleCloudPlatform/cloud-sql-python-connector.git"
56+
Issues = "https://github.com/GoogleCloudPlatform/cloud-sql-python-connector/issues"
57+
Changelog = "https://github.com/GoogleCloudPlatform/cloud-sql-python-connector/blob/main/CHANGELOG.md"
58+
59+
[project.optional-dependencies]
60+
pymysql = ["PyMySQL>=1.1.0"]
61+
pg8000 = ["pg8000>=1.31.1"]
62+
pytds = ["python-tds>=1.15.0"]
63+
asyncpg = ["asyncpg>=0.30.0"]
64+
65+
[tool.setuptools.dynamic]
66+
version = { attr = "google.cloud.sql.connector.version.__version__" }
67+
68+
[tool.setuptools.package-data]
69+
"google.cloud.sql.connector" = ["py.typed"]
70+
71+
[tool.setuptools.packages.find]
72+
# Only include packages under the 'google' namespace. Do not include tests,
73+
# benchmarks, etc.
74+
include = ["google*"]
75+
76+
[tool.mypy]
77+
python_version = "3.9"
78+
namespace_packages = true
79+
ignore_missing_imports = true
80+
warn_unused_configs = true
81+
exclude = ['docs/*', 'samples/*']
82+
83+
[tool.pytest.ini_options]
84+
asyncio_mode = "auto"

setup.cfg

-15
This file was deleted.

setup.py

-90
This file was deleted.

tests/pytest.ini

-15
This file was deleted.

tests/system/test_asyncpg_connection.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ async def getconn(
140140
password=password,
141141
db=db,
142142
ip_type="public", # can also be "private" or "psc",
143-
**kwargs
143+
**kwargs,
144144
)
145145
return conn
146146

0 commit comments

Comments
 (0)