Skip to content

Commit

Permalink
fix: Drop Python 3.7 Support (#262)
Browse files Browse the repository at this point in the history
BEGIN_COMMIT_OVERRIDE
fix: Drop Python 3.7 Support
fix: Require google-api-core >= 2.17.1
fix: Require pandas >= 2.0.0
fix: Require proto-plus >= 1.22.3
fix: Require numpy >= 1.23.5
fix: Require pikepdf >= 8.0.0
fix: Require Pillow >= 10.0.0
END_COMMIT_OVERRIDE

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people authored Mar 8, 2024
1 parent b91ac08 commit 71e6c51
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 68 deletions.
35 changes: 35 additions & 0 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# https://github.com/googleapis/repo-automation-bots/tree/main/packages/sync-repo-settings
# Rules for main branch protection
branchProtectionRules:
# Identifies the protection rule pattern. Name of the branch to be protected.
# Defaults to `main`
- pattern: main
requiresStrictStatusChecks: true
requiredStatusCheckContexts:
- 'cla/google'
- 'OwlBot Post Processor'
- 'docs'
- 'lint'
- 'unit (3.8)'
- 'unit (3.9)'
- 'unit (3.10)'
- 'unit (3.11)'
- 'unit (3.12)'
- 'cover'
- 'Kokoro'
- 'Samples - Lint'
- 'Samples - Python 3.8'
- 'Samples - Python 3.12'
permissionRules:
- team: actools-python
permission: admin
- team: actools
permission: admin
- team: cdpe-cloudai
permission: admin
- team: yoshi-python
permission: push
- team: python-samples-owners
permission: push
- team: python-samples-reviewers
permission: push
2 changes: 1 addition & 1 deletion .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
10 changes: 4 additions & 6 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 and 3.12 on both UNIX and Windows.
3.8, 3.9, 3.10, 3.11 and 3.12 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.12 -- -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.8, 3.9, 3.10, 3.11 and 3.12.
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 @@ -221,14 +221,12 @@ 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.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/
Expand All @@ -241,7 +239,7 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
.. _config: https://github.com/googleapis/python-documentai-toolbox/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.8.
Reasons for this include:

- Encouraging use of newest versions of Python 3
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ The Document AI Toolbox is in an experimental state. This library is a work-in-p

.. |experimental| image:: https://img.shields.io/badge/support-experimental-red.svg
:target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-analytics-admin.svg
:target: https://pypi.org/project/google-analytics-admin/
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-documentai-toolbox.svg
:target: https://pypi.org/project/google-cloud-documentai-toolbox/


Quick Start
Expand Down Expand Up @@ -63,7 +63,7 @@ Supported Python Versions
Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
Python.

Python >= 3.7
Python >= 3.8

.. _active: https://devguide.python.org/devcycle/#in-development-main-branch
.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

DEFAULT_PYTHON_VERSION = "3.8"

UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"]
UNIT_TEST_STANDARD_DEPENDENCIES = [
"mock",
"asyncmock",
Expand All @@ -48,7 +48,7 @@
UNIT_TEST_EXTRAS: List[str] = []
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}

SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8"]
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12"]
SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [
"mock",
"pytest",
Expand Down
3 changes: 2 additions & 1 deletion owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
# Add templated files
# ----------------------------------------------------------------------------
templated_files = common.py_library(
system_test_python_versions=["3.8"],
unit_test_python_versions=["3.8", "3.9", "3.10", "3.11", "3.12"],
system_test_python_versions=["3.8", "3.9", "3.10", "3.11", "3.12"],
cov_level=99,
intersphinx_dependencies={
"pandas": "https://pandas.pydata.org/pandas-docs/stable/"
Expand Down
9 changes: 8 additions & 1 deletion samples/snippets/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@

TEST_CONFIG = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": [
"2.7",
"3.6",
"3.7",
"3.9",
"3.10",
"3.11",
],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": True,
Expand Down
2 changes: 1 addition & 1 deletion samples/snippets/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
google-cloud-bigquery==3.17.2
google-cloud-documentai==2.24.0
google-cloud-storage==2.14.0
google-cloud-documentai-toolbox==0.12.2a0
google-cloud-documentai-toolbox==0.13.1a0
39 changes: 17 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,33 +52,28 @@
"google.cloud.documentai_toolbox": ["templates/*.xml.j2"],
},
install_requires=(
"google-api-core >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0",
"pandas >= 1.0.0, <3.0.0",
"pandas >= 1.0.0, <2.0.0; python_version<'3.8'",
"pyarrow >= 15.0.0, <16.0.0; python_version>='3.8'", # Required by Pandas #237
"tabulate >= 0.9.0, <1.0.0",
"proto-plus >= 1.22.0, <2.0.0dev",
"proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'",
"grpc-google-iam-v1 >= 0.12.6, < 0.13dev",
"google-cloud-bigquery >= 3.5.0, < 4.0.0dev",
"google-cloud-documentai >= 2.20.0, < 3.0.0dev",
"google-cloud-storage >= 1.31.0, < 3.0.0dev",
"google-cloud-vision >= 2.7.0, < 4.0.0dev",
"numpy >= 1.18.1, < 2.0.0",
"intervaltree >= 3.0.0",
"pikepdf >= 6.2.9, < 9.0.0",
"pikepdf >= 6.2.9, < 7.0.0; python_version<'3.8'",
"immutabledict >= 2.0.0, < 4.0.0",
"immutabledict >= 2.0.0, < 3.0.0dev; python_version<'3.8'",
"Pillow >= 9.5.0, < 11.0.0",
"Jinja2 >= 3.1.0, <= 4.0.0",
"google-api-core>=2.17.1, <3.0.0dev",
"pandas[performance,gcp]>=2.0.0, <3.0.0",
"pyarrow>=15.0.0, <16.0.0",
"tabulate>=0.9.0, <1.0.0",
"proto-plus>=1.22.3, <2.0.0dev",
"grpc-google-iam-v1>=0.12.6, <1.0.0dev",
"google-cloud-bigquery>=3.5.0, <4.0.0dev",
"google-cloud-documentai>=2.20.0, <3.0.0dev",
"google-cloud-storage>=1.31.0, <3.0.0dev",
"google-cloud-vision>=2.7.0, <4.0.0dev",
"numpy>=1.23.5, <2.0.0",
"intervaltree>=3.0.0",
"pikepdf>=8.0.0, <9.0.0",
"immutabledict>=2.0.0, <5.0.0",
"Pillow>=10.0.0, <11.0.0",
"Jinja2>=3.1.0, <4.0.0",
),
python_requires=">=3.7",
python_requires=">=3.8",
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand Down
1 change: 0 additions & 1 deletion testing/constraints-3.10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# This constraints file is required for unit tests.
# List all library dependencies and extras in this file.
google-api-core
libcst
pandas
proto-plus
grpc-google-iam-v1
Expand Down
1 change: 0 additions & 1 deletion testing/constraints-3.11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# This constraints file is required for unit tests.
# List all library dependencies and extras in this file.
google-api-core
libcst
pandas
proto-plus
grpc-google-iam-v1
Expand Down
1 change: 0 additions & 1 deletion testing/constraints-3.12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# This constraints file is required for unit tests.
# List all library dependencies and extras in this file.
google-api-core
libcst
pandas
proto-plus
grpc-google-iam-v1
Expand Down
16 changes: 0 additions & 16 deletions testing/constraints-3.7.txt

This file was deleted.

24 changes: 14 additions & 10 deletions testing/constraints-3.8.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# -*- coding: utf-8 -*-
# This constraints file is required for unit tests.
# This constraints file is used to check that lower bounds
# are correct in setup.py
# List all library dependencies and extras in this file.
google-api-core
libcst
pandas
proto-plus
grpc-google-iam-v1
google-cloud-bigquery
google-cloud-documentai
google-cloud-storage
numpy==1.21.6
# Pin the version to the lower bound.
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev",
# Then this file should have google-cloud-foo==1.14.0
google-api-core==2.17.1
pandas==2.0.0
proto-plus==1.22.3
grpc-google-iam-v1==0.12.6
google-cloud-bigquery==3.5.0
google-cloud-documentai==2.20.0
google-cloud-storage==2.7.0
pandas-gbq==0.21.0
numpy==1.23.5
pikepdf==8.2.3
3 changes: 1 addition & 2 deletions testing/constraints-3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
# This constraints file is required for unit tests.
# List all library dependencies and extras in this file.
google-api-core
libcst
pandas
pyarrow # Required by Pandas #237
pyarrow
proto-plus
grpc-google-iam-v1
google-cloud-bigquery
Expand Down

0 comments on commit 71e6c51

Please sign in to comment.