diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index 46cc2984..00000000 --- a/mypy.ini +++ /dev/null @@ -1,19 +0,0 @@ -[mypy] -python_version = 3.9 -warn_unused_configs = True -namespace_packages = True - -[mypy-google.auth.*] -ignore_missing_imports = True - -[mypy-pg8000] -ignore_missing_imports = True - -[mypy-asyncpg] -ignore_missing_imports = True - -[mypy-google.cloud.alloydb_v1beta] -ignore_missing_imports = True - -[mypy-google.api_core.*] -ignore_missing_imports = True diff --git a/noxfile.py b/noxfile.py index 63dc15cb..d1f9ef49 100644 --- a/noxfile.py +++ b/noxfile.py @@ -20,7 +20,7 @@ BLACK_VERSION = "black==23.12.1" ISORT_VERSION = "isort==5.13.2" -LINT_PATHS = ["google", "tests", "noxfile.py", "setup.py"] +LINT_PATHS = ["google", "tests", "noxfile.py"] SYSTEM_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"] UNIT_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"] @@ -71,7 +71,7 @@ def lint(session): "--non-interactive", "--show-traceback", ) - # verify that setup.py is valid + # verify that pyproject.toml is valid session.run("python", "-m", "build", "--sdist") session.run("twine", "check", "--strict", "dist/*") diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..2ae9f974 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,84 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +description = "A Python client library for connecting securely to your Google Cloud AlloyDB instances." +name = "google-cloud-alloydb-connector" +authors = [{ name = "Google LLC", email = "googleapis-packages@google.com" }] +license = "Apache-2.0" +license-files = ["LICENSE"] +requires-python = ">=3.9" +readme = "README.md" +classifiers = [ + # Should be one of: + # "Development Status :: 3 - Alpha" + # "Development Status :: 4 - Beta" + # "Development Status :: 5 - Production/Stable" + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Operating System :: OS Independent", +] +dependencies = [ + "aiofiles", + "aiohttp", + "cryptography>=42.0.0", + "requests", + "google-auth", + "protobuf", + "google-cloud-alloydb", + "google-api-core", +] +dynamic = ["version"] + +[project.urls] +Homepage = "https://github.com/GoogleCloudPlatform/alloydb-python-connector" +Repository = "https://github.com/GoogleCloudPlatform/alloydb-python-connector.git" +Issues = "https://github.com/GoogleCloudPlatform/alloydb-python-connector/issues" +Changelog = "https://github.com/GoogleCloudPlatform/alloydb-python-connector/blob/main/CHANGELOG.md" + +[project.optional-dependencies] +pg8000 = ["pg8000>=1.31.1"] +asyncpg = ["asyncpg>=0.30.0"] + +[tool.setuptools.dynamic] +version = { attr = "google.cloud.alloydb.connector.version.__version__" } + +[tool.setuptools.package-data] +"google.cloud.alloydb.connector" = ["py.typed"] + +[tool.setuptools.packages.find] +# Only include packages under the 'google' namespace. Do not include tests, +# benchmarks, etc. +include = ["google*"] + +[tool.mypy] +python_version = "3.9" +namespace_packages = true +ignore_missing_imports = true +warn_unused_configs = true +exclude = ['docs/*'] + +[tool.pytest.ini_options] +asyncio_mode = "auto" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index ef6fc131..00000000 --- a/setup.cfg +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -[bdist_wheel] -universal = 1 diff --git a/setup.py b/setup.py deleted file mode 100644 index 9e7f0ae2..00000000 --- a/setup.py +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import io -import os - -import setuptools - -name = "google-cloud-alloydb-connector" -description = "A Python client library for connecting securely to your Google Cloud AlloyDB instances." - -release_status = "Development Status :: 5 - Production/Stable" -dependencies = [ - "aiofiles", - "aiohttp", - "cryptography>=42.0.0", - "requests", - "google-auth", - "protobuf", - "google-cloud-alloydb", - "google-api-core", -] - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.md") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -version = {} -with open( - os.path.join(package_root, "google/cloud/alloydb/connector/version.py") -) as fp: - exec(fp.read(), version) -version = version["__version__"] - -# Only include packages under the 'google' namespace. Do not include tests, -# samples, etc. -packages = [ - package - for package in setuptools.find_namespace_packages() - if package.startswith("google") -] - - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - long_description_content_type="text/markdown", - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/GoogleCloudPlatform/alloydb-python-connector", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - install_requires=dependencies, - extras_require={ - "pg8000": ["pg8000>=1.31.1"], - "asyncpg": ["asyncpg>=0.30.0"], - }, - python_requires=">=3.9", - include_package_data=True, - zip_safe=False, - package_data={"google.cloud.alloydb.connector": ["py.typed"]}, -) diff --git a/tests/pytest.ini b/tests/pytest.ini deleted file mode 100644 index 8cbc67de..00000000 --- a/tests/pytest.ini +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -[pytest] -asyncio_mode = auto