diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index c8cf83eae8..2f800676eb 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows. + 3.10, 3.11, 3.12, 3.13, and 3.14 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -143,12 +143,12 @@ Running System Tests $ nox -s system # Run a single system test - $ nox -s system-3.8 -- -k + $ nox -s system-3.10 -- -k .. note:: - System tests are only configured to run under Python 3.8. + System tests are only configured to run under Python 3.10. For expediency, we do not run them in older versions of Python 3. This alone will not run the tests. You'll need to change some local @@ -195,11 +195,11 @@ configure them just like the System Tests. # Run all tests in a folder $ cd samples/snippets - $ nox -s py-3.8 + $ nox -s py-3.10 # Run a single sample test $ cd samples/snippets - $ nox -s py-3.8 -- -k + $ nox -s py-3.10 -- -k ******************************************** Note About ``README`` as it pertains to PyPI @@ -221,18 +221,14 @@ Supported Python Versions We support: -- `Python 3.7`_ -- `Python 3.8`_ -- `Python 3.9`_ + - `Python 3.10`_ - `Python 3.11`_ - `Python 3.12`_ - `Python 3.13`_ - `Python 3.14`_ -.. _Python 3.7: https://docs.python.org/3.7/ -.. _Python 3.8: https://docs.python.org/3.8/ -.. _Python 3.9: https://docs.python.org/3.9/ + .. _Python 3.10: https://docs.python.org/3.10/ .. _Python 3.11: https://docs.python.org/3.11/ .. _Python 3.12: https://docs.python.org/3.12/ @@ -245,7 +241,7 @@ Supported versions can be found in our ``noxfile.py`` `config`_. .. _config: https://github.com/googleapis/google-api-python-client/blob/main/noxfile.py -We also explicitly decided to support Python 3 beginning with version 3.7. +We also explicitly decided to support Python 3 beginning with version 3.10. Reasons for this include: - Encouraging use of newest versions of Python 3 diff --git a/README.md b/README.md index d531ca1f79..b2ac480a40 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ The 2.0 release of `google-api-python-client` includes a substantial reliability improvement, compared with 1.x, as discovery documents are now cached in the library rather than fetched dynamically. It is highly recommended to upgrade from v1.x to v2.x. -Only python 3.7 and newer is supported. If you are not able to upgrade python, then +Only python 3.10 and newer is supported. If you are not able to upgrade python, then please continue to use version 1.x as we will continue supporting python 2.7+ in [v1](https://github.com/googleapis/google-api-python-client/tree/v1). @@ -97,11 +97,11 @@ virtualenv ## Supported Python Versions -Python 3.7, 3.8, 3.9, 3.10, 3.11, 3.12 and 3.13, 3.14 are fully supported and tested. This library may work on later versions of 3, but we do not currently run tests against those versions. +Python 3.10, 3.11, 3.12, 3.13, and 3.14 are fully supported and tested. This library may work on later versions of 3, but we do not currently run tests against those versions. ## Unsupported Python Versions -Python < 3.7 +Python < 3.10 ## Third Party Libraries and Dependencies diff --git a/UPGRADING.md b/UPGRADING.md index facde263fb..72788d396a 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -4,7 +4,7 @@ The 2.0 release of `google-api-python-client` includes a substantial reliability improvement, compared with 1.x, as discovery documents are now cached in the library rather than fetched dynamically. It is highly recommended to upgrade from v1.x to v2.x. -Only python 3.7 and newer is supported. If you are not able to upgrade python, then +Only python 3.10 and newer is supported. If you are not able to upgrade python, then please continue to use version 1.x as we will continue supporting python 2.7+ in [v1](https://github.com/googleapis/google-api-python-client/tree/v1). diff --git a/noxfile.py b/noxfile.py index 450ce2d691..5869a83136 100644 --- a/noxfile.py +++ b/noxfile.py @@ -48,8 +48,6 @@ ] nox.options.sessions = [ - # TODO(https://github.com/googleapis/google-api-python-client/issues/2622): - # Remove or restore testing for Python 3.7/3.8/3.9 "unit-3.10", "unit-3.11", "unit-3.12", @@ -98,7 +96,7 @@ def format(session): ) -@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]) +@nox.session(python=["3.10", "3.11", "3.12", "3.13", "3.14"]) @nox.parametrize( "oauth2client", [ diff --git a/owlbot.py b/owlbot.py index 7ee3d49cf8..323bed9fb3 100644 --- a/owlbot.py +++ b/owlbot.py @@ -25,9 +25,6 @@ # ---------------------------------------------------------------------------- templated_files = common.py_library( unit_test_python_versions=[ - "3.7", - "3.8", - "3.9", "3.10", "3.11", "3.12", @@ -59,7 +56,9 @@ # Samples templates # ---------------------------------------------------------------------------- -python.py_samples(skip_readmes=True) +python.py_samples( + skip_readmes=True, files_to_exclude=["**/noxfile.py", "**/requirements-test.txt"] +) for noxfile in Path(".").glob("**/noxfile.py"): s.shell.run(["nox", "-s", "format"], cwd=noxfile.parent, hide_output=False) diff --git a/samples/compute/noxfile.py b/samples/compute/noxfile.py index 782da04329..1be564b3c4 100644 --- a/samples/compute/noxfile.py +++ b/samples/compute/noxfile.py @@ -86,9 +86,7 @@ def get_pytest_env_vars() -> Dict[str, str]: return ret -# DO NOT EDIT - automatically generated. -# All versions used to test samples. -ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] +ALL_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] diff --git a/samples/compute/requirements-test.txt b/samples/compute/requirements-test.txt index 5027d2b4b6..a6b8542e1a 100644 --- a/samples/compute/requirements-test.txt +++ b/samples/compute/requirements-test.txt @@ -1,4 +1,3 @@ -pytest==7.4.4; python_version == '3.7' -pytest==8.2.2; python_version >= '3.8' +pytest==8.2.2 flaky==3.8.1 diff --git a/scripts/readme-gen/templates/install_deps.tmpl.rst b/scripts/readme-gen/templates/install_deps.tmpl.rst index 6f069c6c87..49fcc14101 100644 --- a/scripts/readme-gen/templates/install_deps.tmpl.rst +++ b/scripts/readme-gen/templates/install_deps.tmpl.rst @@ -12,7 +12,7 @@ Install Dependencies .. _Python Development Environment Setup Guide: https://cloud.google.com/python/setup -#. Create a virtualenv. Samples are compatible with Python 3.7+. +#. Create a virtualenv. Samples are compatible with Python 3.10+. .. code-block:: bash diff --git a/setup.py b/setup.py index 10fcc41255..c680bd43ef 100644 --- a/setup.py +++ b/setup.py @@ -21,8 +21,8 @@ import sys -if sys.version_info < (3, 7): - print("google-api-python-client requires python3 version >= 3.7.", file=sys.stderr) +if sys.version_info < (3, 10): + print("google-api-python-client requires python3 version >= 3.10.", file=sys.stderr) sys.exit(1) import io @@ -69,16 +69,13 @@ author_email="googleapis-packages@google.com", url="https://github.com/googleapis/google-api-python-client/", install_requires=install_requires, - python_requires=">=3.7", + python_requires=">=3.10", packages=packages, package_data={"googleapiclient": ["discovery_cache/documents/*.json"]}, license="Apache 2.0", keywords="google api client", classifiers=[ "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", diff --git a/tests/test_discovery.py b/tests/test_discovery.py index 2d74ce6dfc..5571d77dc7 100644 --- a/tests/test_discovery.py +++ b/tests/test_discovery.py @@ -1418,9 +1418,7 @@ def import_mock(name, *args, **kwargs): return self.mocked_api return self.orig_import(name, *args, **kwargs) - import_fullname = "__builtin__.__import__" - if sys.version_info[0] >= 3: - import_fullname = "builtins.__import__" + import_fullname = "builtins.__import__" with mock.patch(import_fullname, side_effect=import_mock): namespace = "google-api-client"