Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -143,12 +143,12 @@ Running System Tests
$ nox -s system

# Run a single system test
$ nox -s system-3.8 -- -k <name of test>
$ nox -s system-3.10 -- -k <name of test>


.. note::

System tests are only configured to run under Python 3.8.
System tests are only configured to run under Python 3.10.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since Python 3.10 is now the minimum supported version, the note on the following line ('For expediency, we do not run them in older versions of Python 3.') is obsolete because there are no older supported versions of Python 3. Consider removing or updating that sentence to avoid confusion.

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
Expand Down Expand Up @@ -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 <name of test>
$ nox -s py-3.10 -- -k <name of test>

********************************************
Note About ``README`` as it pertains to PyPI
Expand All @@ -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/
Expand All @@ -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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since the minimum supported Python version is now 3.10, the reasons listed below (specifically the third bullet point regarding Unicode literal support for Python 2 and Python 3 compatibility) are obsolete and no longer applicable. Consider removing or updating that bullet point to reflect modern Python 3.10+ features.

Reasons for this include:

- Encouraging use of newest versions of Python 3
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down Expand Up @@ -97,11 +97,11 @@ virtualenv <your-env>

## 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

Expand Down
2 changes: 1 addition & 1 deletion UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
4 changes: 1 addition & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
[
Expand Down
7 changes: 3 additions & 4 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)
4 changes: 1 addition & 3 deletions samples/compute/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
3 changes: 1 addition & 2 deletions samples/compute/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -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

2 changes: 1 addition & 1 deletion scripts/readme-gen/templates/install_deps.tmpl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 3 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 1 addition & 3 deletions tests/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading