diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 6f0623238b..2ca247d785 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -16,7 +16,7 @@ branchProtectionRules: - 'cla/google' - 'Kokoro docs-presubmit' - 'Presubmit - Lint and Coverage' - - 'Presubmit - Unit Tests Python 3.9' + - 'Presubmit - Unit Tests Python 3.10' - 'Presubmit - Unit Tests Python 3.11' - 'Presubmit - Unit Tests Python 3.12' @@ -27,7 +27,7 @@ branchProtectionRules: - 'Presubmit - Unit Tests Ray 2.42.0 (Python 3.10)' - 'Presubmit - Unit Tests Ray 2.42.0 (Python 3.11)' - 'Presubmit - Unit Tests Ray 2.47.1 (Python 3.11)' - - 'Presubmit - Unit Tests LangChain (Python 3.9)' + - 'Presubmit - Unit Tests LangChain (Python 3.10)' - 'Presubmit - Unit Tests LangChain (Python 3.11)' - 'Presubmit - Unit Tests LangChain (Python 3.12)' diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 696465849a..3162fa3883 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] steps: - name: Checkout code diff --git a/.kokoro/continuous/unit.cfg b/.kokoro/continuous/unit.cfg index 57188a42d1..3a99882367 100644 --- a/.kokoro/continuous/unit.cfg +++ b/.kokoro/continuous/unit.cfg @@ -1,6 +1,6 @@ # Format: //devtools/kokoro/config/proto/build.proto -# Run all unit test sessions, in Python 3.7 to 3.9 +# Run all unit test sessions env_vars: { key: "NOX_SESSION" value: "unit" diff --git a/.kokoro/docker/docs/Dockerfile b/.kokoro/docker/docs/Dockerfile index e8ee8191ee..e004cc0ceb 100644 --- a/.kokoro/docker/docs/Dockerfile +++ b/.kokoro/docker/docs/Dockerfile @@ -60,24 +60,11 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && rm -f /var/cache/apt/archives/*.deb -###################### Install python 3.9.13 - -# Download python 3.9.13 -RUN wget https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tgz - -# Extract files -RUN tar -xvf Python-3.9.13.tgz - -# Install python 3.9.13 -RUN ./Python-3.9.13/configure --enable-optimizations -RUN make altinstall - -###################### Install pip -RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3 /tmp/get-pip.py \ - && rm /tmp/get-pip.py - -# Test pip -RUN python3 -m pip - -CMD ["python3.9"] +###################### Install python 3.10.13 +# Download python 3.10.13 +RUN wget https://www.python.org/ftp/python/3.10.13/Python-3.10.13.tgz +RUN tar -xvf Python-3.10.13.tgz +# Install python 3.10.13 +RUN ./Python-3.10.13/configure --enable-optimizations +RUN make install +CMD ["python3.10"] diff --git a/.kokoro/presubmit/presubmit.cfg b/.kokoro/presubmit/presubmit.cfg index 46866717fc..8b996be11a 100644 --- a/.kokoro/presubmit/presubmit.cfg +++ b/.kokoro/presubmit/presubmit.cfg @@ -1,11 +1,11 @@ # Format: //devtools/kokoro/config/proto/build.proto # Run all sessions except system tests and docs builds -# This only runs unit tests for Python 3.9 since unit tests are required for `cover` to run +# This only runs unit tests for Python 3.10 since unit tests are required for `cover` to run # Other Python version unit tests are run separately env_vars: { key: "NOX_SESSION" - value: "unit-3.9 lint lint_setup_py blacken cover" + value: "unit-3.10 lint lint_setup_py blacken cover" } # Run unit tests in parallel, splitting up by file diff --git a/.kokoro/presubmit/release.cfg b/.kokoro/presubmit/release.cfg index bb84c062a9..a53b631c60 100644 --- a/.kokoro/presubmit/release.cfg +++ b/.kokoro/presubmit/release.cfg @@ -3,7 +3,7 @@ # Run system tests in presubmit for library releases env_vars: { key: "NOX_SESSION" - value: "system-3.9 unit" + value: "system-3.10 unit" } # Run system tests in parallel, splitting up by file diff --git a/.kokoro/presubmit/unit_3-9.cfg b/.kokoro/presubmit/unit_3-9.cfg index e97dc78539..d6f7d6acca 100644 --- a/.kokoro/presubmit/unit_3-9.cfg +++ b/.kokoro/presubmit/unit_3-9.cfg @@ -3,7 +3,7 @@ # Run unit tests for Python 3.9 env_vars: { key: "NOX_SESSION" - value: "unit-3.9" + value: "unit-3.10" } # Run unit tests in parallel, splitting up by file diff --git a/.kokoro/presubmit/unit_langchain_py39.cfg b/.kokoro/presubmit/unit_langchain_py39.cfg index 5b3c7bb9bf..d6a6283d91 100644 --- a/.kokoro/presubmit/unit_langchain_py39.cfg +++ b/.kokoro/presubmit/unit_langchain_py39.cfg @@ -3,7 +3,7 @@ # Run unit tests for LangChain on Python 3.9 env_vars: { key: "NOX_SESSION" - value: "unit_langchain-3.9" + value: "unit_langchain-3.10" } # Run unit tests in parallel, splitting up by file diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index ff71365e69..3a884ecda0 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.9, 3.10, 3.11, 3.12, and 3.13 on both UNIX and Windows. + 3.10, 3.11, 3.12, and 3.13 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -146,10 +146,7 @@ Running System Tests $ nox -s system-3.9 -- -k - .. note:: - System tests are only configured to run under Python 3.9. - 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 auth settings and change some configuration in your project to @@ -195,11 +192,11 @@ configure them just like the System Tests. # Run all tests in a folder $ cd samples/snippets - $ nox -s py-3.9 + $ nox -s py-3.10 # Run a single sample test $ cd samples/snippets - $ nox -s py-3.9 -- -k + $ nox -s py-3.10 -- -k ******************************************** Note About ``README`` as it pertains to PyPI @@ -221,13 +218,11 @@ Supported Python Versions We support: -- `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ - `Python 3.12`_ - `Python 3.13`_ -.. _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/ @@ -239,7 +234,7 @@ Supported versions can be found in our ``noxfile.py`` `config`_. .. _config: https://github.com/googleapis/python-aiplatform/blob/main/noxfile.py -We also explicitly decided to support Python 3 beginning with version 3.9. +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.rst b/README.rst index 20f1413155..d69e13d336 100644 --- a/README.rst +++ b/README.rst @@ -319,7 +319,7 @@ In order to use this library, you first need to go through the following steps: Supported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.9 +Python >= 3.10 Deprecated Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/google/cloud/aiplatform_v1/__init__.py b/google/cloud/aiplatform_v1/__init__.py index 2c8faf1a87..da3814406a 100644 --- a/google/cloud/aiplatform_v1/__init__.py +++ b/google/cloud/aiplatform_v1/__init__.py @@ -1109,7 +1109,7 @@ + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) if sys.version_info[:2] == (3, 9): diff --git a/google/cloud/aiplatform_v1beta1/__init__.py b/google/cloud/aiplatform_v1beta1/__init__.py index 9bd968d6da..e0944ca0aa 100644 --- a/google/cloud/aiplatform_v1beta1/__init__.py +++ b/google/cloud/aiplatform_v1beta1/__init__.py @@ -1342,7 +1342,7 @@ + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) if sys.version_info[:2] == (3, 9): diff --git a/noxfile.py b/noxfile.py index 2ea6d71713..7d948135e3 100644 --- a/noxfile.py +++ b/noxfile.py @@ -53,10 +53,10 @@ "recommonmark", ) -UNIT_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] -UNIT_TEST_LANGCHAIN_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] -UNIT_TEST_AG2_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] -UNIT_TEST_LLAMA_INDEX_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] +UNIT_TEST_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"] +UNIT_TEST_LANGCHAIN_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"] +UNIT_TEST_AG2_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"] +UNIT_TEST_LLAMA_INDEX_PYTHON_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"] PYTHON_TO_RAY_VERSIONS = { "3.10": ["2.9.3", "2.33.0", "2.42.0"], "3.11": ["2.42.0", "2.47.1"], @@ -459,7 +459,7 @@ def cover(session): session.run("coverage", "erase") -@nox.session(python="3.9", venv_backend="virtualenv") +@nox.session(python=DEFAULT_PYTHON_VERSION, venv_backend="virtualenv") def docs(session): """Build the docs for this library.""" @@ -519,7 +519,7 @@ def docfx(session): ) -@nox.session(python="3.9", venv_backend="virtualenv") +@nox.session(python=DEFAULT_PYTHON_VERSION, venv_backend="virtualenv") def gemini_docs(session): """Build the docs for library related to Gemini.""" @@ -590,9 +590,7 @@ def prerelease_deps(session): # version, the first version we test with in the unit tests sessions has a # constraints file containing all dependencies and extras. with open( - CURRENT_DIRECTORY - / "testing" - / f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt", + CURRENT_DIRECTORY / "testing" / "constraints-3.10.txt", encoding="utf-8", ) as constraints_file: constraints_text = constraints_file.read() diff --git a/owlbot.py b/owlbot.py index 569c043bfa..b49dce78b6 100644 --- a/owlbot.py +++ b/owlbot.py @@ -98,8 +98,8 @@ templated_files = common.py_library( cov_level=98, - system_test_python_versions=["3.9"], - unit_test_python_versions=["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"], + system_test_python_versions=["3.10"], + unit_test_python_versions=["3.10", "3.11", "3.12", "3.13", "3.14"], unit_test_extras=["testing"], system_test_extras=["testing"], microgenerator=True, @@ -122,12 +122,10 @@ ".kokoro/samples/python3.8/**", # exclude sample configs so periodic samples are tested against main # instead of pypi - ".kokoro/samples/python3.9/common.cfg", ".kokoro/samples/python3.10/common.cfg", ".kokoro/samples/python3.11/common.cfg", ".kokoro/samples/python3.12/common.cfg", ".kokoro/samples/python3.13/common.cfg", - ".kokoro/samples/python3.9/periodic.cfg", ".kokoro/samples/python3.10/periodic.cfg", ".kokoro/samples/python3.11/periodic.cfg", ".kokoro/samples/python3.12/periodic.cfg", @@ -164,7 +162,7 @@ s.replace( ".kokoro/test-samples-impl.sh", - "python3.9", + "python3.10", "python3", ) diff --git a/pypi/_vertex_ai_placeholder/pyproject.toml b/pypi/_vertex_ai_placeholder/pyproject.toml index ab4d22f39e..0dd44ea941 100644 --- a/pypi/_vertex_ai_placeholder/pyproject.toml +++ b/pypi/_vertex_ai_placeholder/pyproject.toml @@ -11,7 +11,7 @@ authors = [ license = {text = "Apache 2.0"} description = "Please run pip install vertexai to use the Vertex SDK." readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.10" [project.urls] repository = "https://github.com/googleapis/python-aiplatform.git" \ No newline at end of file diff --git a/pypi/_vertex_ai_placeholder/setup.py b/pypi/_vertex_ai_placeholder/setup.py index 30d9c16f27..190b1390cb 100644 --- a/pypi/_vertex_ai_placeholder/setup.py +++ b/pypi/_vertex_ai_placeholder/setup.py @@ -236,7 +236,6 @@ "Programming Language :: Python", "Programming Language :: Python :: 3", "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/setup.py b/setup.py index edf3fca906..b1835c9a88 100644 --- a/setup.py +++ b/setup.py @@ -351,14 +351,13 @@ "llama_index": llama_index_extra_require, "llama_index_testing": llama_index_testing_extra_require, }, - python_requires=">=3.9", + python_requires=">=3.10", classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Operating System :: OS Independent", "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", diff --git a/tests/system/aiplatform/test_project_id_inference.py b/tests/system/aiplatform/test_project_id_inference.py index 4150ed35e2..47dd3ad689 100644 --- a/tests/system/aiplatform/test_project_id_inference.py +++ b/tests/system/aiplatform/test_project_id_inference.py @@ -50,7 +50,7 @@ def test_project_id_inference(self, shared_state): "machine_spec": {"machine_type": "n1-standard-4"}, "replica_count": 1, "container_spec": { - "image_uri": "python:3.9", + "image_uri": "python:3.10", "command": [ "sh", "-exc", diff --git a/tests/unit/aiplatform/test_explain_lit.py b/tests/unit/aiplatform/test_explain_lit.py index a2d727a120..351a37ff1a 100644 --- a/tests/unit/aiplatform/test_explain_lit.py +++ b/tests/unit/aiplatform/test_explain_lit.py @@ -340,7 +340,7 @@ def test_create_lit_model_from_tensorflow_returns_model(self, set_up_sequential) @pytest.mark.skipif( sys.version_info < (3, 11), - reason=("temporarily skipped due to failures in python 3.9 and 3.10"), + reason=("temporarily skipped due to failures in python 3.10"), ) @mock.patch.dict(os.environ, {"LIT_PROXY_URL": "auto"}) @pytest.mark.usefixtures( @@ -622,7 +622,7 @@ def test_set_up_and_open_lit( @pytest.mark.skipif( sys.version_info < (3, 11), - reason=("temporarily skipped due to failures in python 3.9 and 3.10"), + reason=("temporarily skipped due to failures in python 3.10"), ) @pytest.mark.usefixtures("init_lit_widget_mock") @mock.patch.dict(os.environ, {"LIT_PROXY_URL": "auto"}) diff --git a/vertexai/agent_engines/_agent_engines.py b/vertexai/agent_engines/_agent_engines.py index dd4e35269d..8bf0c8658d 100644 --- a/vertexai/agent_engines/_agent_engines.py +++ b/vertexai/agent_engines/_agent_engines.py @@ -53,7 +53,7 @@ _LOGGER = _utils.LOGGER -_SUPPORTED_PYTHON_VERSIONS = ("3.9", "3.10", "3.11", "3.12", "3.13", "3.14") +_SUPPORTED_PYTHON_VERSIONS = ("3.10", "3.11", "3.12", "3.13", "3.14") _DEFAULT_GCS_DIR_NAME = "agent_engine" _BLOB_FILENAME = "agent_engine.pkl" _REQUIREMENTS_FILE = "requirements.txt" @@ -1778,7 +1778,7 @@ async def _method(self, **kwargs) -> Any: factory = ClientFactory(config) client = factory.create(a2a_agent_card) - # kokoro job uses python 3.9, replaced match with if else. + # kokoro job uses python 3.10, replaced match with if else. if method_name == "on_message_send": response = client.send_message(Message(**kwargs)) chunks = [] diff --git a/vertexai/reasoning_engines/_reasoning_engines.py b/vertexai/reasoning_engines/_reasoning_engines.py index 322bf2a2d4..7d94cda0bc 100644 --- a/vertexai/reasoning_engines/_reasoning_engines.py +++ b/vertexai/reasoning_engines/_reasoning_engines.py @@ -48,7 +48,7 @@ _LOGGER = base.Logger(__name__) -_SUPPORTED_PYTHON_VERSIONS = ("3.9", "3.10", "3.11", "3.12", "3.13", "3.14") +_SUPPORTED_PYTHON_VERSIONS = ("3.10", "3.11", "3.12", "3.13", "3.14") _DEFAULT_GCS_DIR_NAME = "reasoning_engine" _BLOB_FILENAME = "reasoning_engine.pkl" _REQUIREMENTS_FILE = "requirements.txt" @@ -224,7 +224,7 @@ def create( use for staging the artifacts needed. sys_version (str): Optional. The Python system version used. Currently supports any - of "3.9", "3.10", "3.11", "3.12", "3.13". If not specified, + of "3.10", "3.11", "3.12", "3.13". If not specified, it defaults to the "{major}.{minor}" attributes of sys.version_info. extra_packages (Sequence[str]):