From d0a8801e3c569647cc9392ea25a5d22b4aff889f Mon Sep 17 00:00:00 2001 From: Averi Kitsch Date: Thu, 19 Sep 2024 11:29:12 -0700 Subject: [PATCH] feat: remove support for Python 3.8 (#237) * feat: remove support for Python 3.8 * remove required check * Update pyproject.toml * Update DEVELOPER.md --- .github/sync-repo-settings.yaml | 1 - DEVELOPER.md | 12 ++++++------ README.rst | 2 +- integration.cloudbuild.yaml | 2 +- pyproject.toml | 8 +++++--- requirements.txt | 5 ++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index d8469ba8..e1c61541 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -27,7 +27,6 @@ branchProtectionRules: requiredStatusCheckContexts: - "cla/google" - "lint" - - "integration-test-pr-py38 (langchain-alloydb-testing)" - "integration-test-pr-py39 (langchain-alloydb-testing)" - "integration-test-pr-py310 (langchain-alloydb-testing)" - "integration-test-pr-py311 (langchain-alloydb-testing)" diff --git a/DEVELOPER.md b/DEVELOPER.md index 9ef260b4..83902aa2 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -34,7 +34,7 @@ This allows your code to dynamically reflect any changes you make to the library Notes: * Tests run against public and private IP addresses. Tests for private IP can not be run locally due to VPC restrictions. There is no current way to prevent these tests from running. These tests will time out. -* Tests use both IAM and built-in authentication. +* Tests use both IAM and built-in authentication. * Learn how to set up a built-in databases user at [Manage AlloyDB user roles](https://cloud.google.com/alloydb/docs/database-users/about). * Local tests will run against your `gcloud` credentials. Use `gcloud` to login with your personal account or a service account. This account will be used to run IAM tests. Learn how to set up access to the database at [Manage IAM authentication](https://cloud.google.com/alloydb/docs/manage-iam-authn). The "IAM_ACCOUNT" environment variable is also used to test authentication to override the local account. A personal account or a service account can be used for this test. * You may need to grant access to the public schema for your new database user: `GRANT ALL ON SCHEMA public TO myaccount@example.com;` @@ -54,11 +54,11 @@ These tests are registered as required tests in `.github/sync-repo-settings.yaml #### Trigger Setup -Cloud Build triggers (for Python versions 3.8 to 3.11) were created with the following specs: +Cloud Build triggers (for Python versions 3.9 to 3.11) were created with the following specs: ```YAML -name: integration-test-pr-py38 -description: Run integration tests on PR for Python 3.8 +name: integration-test-pr-py39 +description: Run integration tests on PR for Python 3.9 filename: integration.cloudbuild.yaml github: name: langchain-google-alloydb-pg-python @@ -76,7 +76,7 @@ substitutions: _DATABASE_ID: _INSTANCE_ID: _REGION: us-central1 - _VERSION: "3.8" + _VERSION: "3.9" ``` Use `gcloud builds triggers import --source=trigger.yaml` to create triggers via the command line @@ -104,7 +104,7 @@ To run Cloud Build tests on GitHub from external contributors, ie RenovateBot, c #### Code Coverage Please make sure your code is fully tested. The Cloud Build integration tests are run with the `pytest-cov` code coverage plugin. They fail for PRs with a code coverage less than the threshold specified in `.coveragerc`. If your file is inside the main module and should be ignored by code coverage check, add it to the `omit` section of `.coveragerc`. -Check for code coverage report in any Cloud Build integration test log. +Check for code coverage report in any Cloud Build integration test log. Here is a breakdown of the report: - `Stmts`: lines of executable code (statements). - `Miss`: number of lines not covered by tests. diff --git a/README.rst b/README.rst index 2ddbd2fc..36094266 100644 --- a/README.rst +++ b/README.rst @@ -48,7 +48,7 @@ dependencies. Supported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.8 +Python >= 3.9 Mac/Linux ^^^^^^^^^ diff --git a/integration.cloudbuild.yaml b/integration.cloudbuild.yaml index 47a72e4d..a12fdff2 100644 --- a/integration.cloudbuild.yaml +++ b/integration.cloudbuild.yaml @@ -74,7 +74,7 @@ availableSecrets: env: "IAM_ACCOUNT" substitutions: - _VERSION: "3.8" + _VERSION: "3.9" _INSTANCE_CONNECTION_NAME: projects/${PROJECT_ID}/locations/${_REGION}/clusters/${_CLUSTER_ID}/instances/${_INSTANCE_ID} _DATABASE_PORT: "5432" _IP_ADDRESS: "127.0.0.1" diff --git a/pyproject.toml b/pyproject.toml index b5cef93d..fdc3a6d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ dynamic = ["version"] description = "LangChain integrations for Google Cloud AlloyDB for PostgreSQL" readme = "README.rst" license = {file = "LICENSE"} -requires-python = ">=3.8" +requires-python = ">=3.9" authors = [ {name = "Google LLC", email = "googleapis-packages@google.com"} ] @@ -21,7 +21,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "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", @@ -52,11 +51,14 @@ test = [ requires = ["setuptools"] build-backend = "setuptools.build_meta" +[tool.black] +target-version = ['py39'] + [tool.isort] profile = "black" [tool.mypy] -python_version = "3.8" +python_version = "3.9" warn_unused_configs = true disallow_incomplete_defs = true diff --git a/requirements.txt b/requirements.txt index 62ccafe9..a77b0992 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ google-cloud-alloydb-connector[asyncpg]==1.4.0 -langchain-core==0.2.39 -numpy===1.24.4; python_version <= "3.8" -numpy==1.26.4; python_version > "3.8" +langchain-core==0.3.0 +numpy==1.26.4 pgvector==0.3.3 SQLAlchemy[asyncio]==2.0.34