Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 5a1b948

Browse files
fix: require python 3.7+ (#403)
* chore(python): drop python 3.6 Source-Link: googleapis/synthtool@4f89b13 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c * add api_description to .repo-metadata.json * require python 3.7+ in setup.py * remove python 3.6 sample configs * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * trigger CI * add python_requires to setup.py Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent 4b8edf8 commit 5a1b948

File tree

17 files changed

+94
-134
lines changed

17 files changed

+94
-134
lines changed

.github/.OwlBot.lock.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
# limitations under the License.
1414
docker:
1515
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
16-
digest: sha256:b2dc5f80edcf5d4486c39068c9fa11f7f851d9568eea4dcba130f994ea9b5e97
17-
# created: 2022-06-12T16:09:31.61859086Z
16+
digest: sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c
17+
# created: 2022-07-05T18:31:20.838186805Z

.github/workflows/unittest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
python: ['3.6', '3.7', '3.8', '3.9', '3.10']
11+
python: ['3.7', '3.8', '3.9', '3.10']
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v3

.kokoro/samples/python3.6/common.cfg

Lines changed: 0 additions & 40 deletions
This file was deleted.

.kokoro/samples/python3.6/continuous.cfg

Lines changed: 0 additions & 7 deletions
This file was deleted.

.kokoro/samples/python3.6/periodic-head.cfg

Lines changed: 0 additions & 11 deletions
This file was deleted.

.kokoro/samples/python3.6/periodic.cfg

Lines changed: 0 additions & 6 deletions
This file was deleted.

.kokoro/samples/python3.6/presubmit.cfg

Lines changed: 0 additions & 6 deletions
This file was deleted.

.kokoro/test-samples-impl.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export PYTHONUNBUFFERED=1
3333
env | grep KOKORO
3434

3535
# Install nox
36-
python3.6 -m pip install --upgrade --quiet nox
36+
python3.9 -m pip install --upgrade --quiet nox
3737

3838
# Use secrets acessor service account to get secrets
3939
if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then
@@ -76,7 +76,7 @@ for file in samples/**/requirements.txt; do
7676
echo "------------------------------------------------------------"
7777

7878
# Use nox to execute the tests for the project.
79-
python3.6 -m nox -s "$RUN_TESTS_SESSION"
79+
python3.9 -m nox -s "$RUN_TESTS_SESSION"
8080
EXIT=$?
8181

8282
# If this is a periodic build, send the test log to the FlakyBot.

.repo-metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
"requires_billing": true,
1414
"default_version": "v1",
1515
"codeowner_team": "",
16-
"api_shortname": "datacatalog"
16+
"api_shortname": "datacatalog",
17+
"api_description": "is a fully managed and highly scalable data discovery and metadata management service."
1718
}

CONTRIBUTING.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In order to add a feature:
2222
documentation.
2323

2424
- The feature must work fully on the following CPython versions:
25-
3.6, 3.7, 3.8, 3.9 and 3.10 on both UNIX and Windows.
25+
3.7, 3.8, 3.9 and 3.10 on both UNIX and Windows.
2626

2727
- The feature must not add unnecessary dependencies (where
2828
"unnecessary" is of course subjective, but new dependencies should
@@ -221,13 +221,11 @@ Supported Python Versions
221221

222222
We support:
223223

224-
- `Python 3.6`_
225224
- `Python 3.7`_
226225
- `Python 3.8`_
227226
- `Python 3.9`_
228227
- `Python 3.10`_
229228

230-
.. _Python 3.6: https://docs.python.org/3.6/
231229
.. _Python 3.7: https://docs.python.org/3.7/
232230
.. _Python 3.8: https://docs.python.org/3.8/
233231
.. _Python 3.9: https://docs.python.org/3.9/
@@ -239,7 +237,7 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
239237
.. _config: https://github.com/googleapis/python-datacatalog/blob/main/noxfile.py
240238

241239

242-
We also explicitly decided to support Python 3 beginning with version 3.6.
240+
We also explicitly decided to support Python 3 beginning with version 3.7.
243241
Reasons for this include:
244242

245243
- Encouraging use of newest versions of Python 3

README.rst

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
Python Client for Google Cloud Data Catalog API
22
===============================================
33

4-
|ga| |pypi| |versions|
4+
|stable| |pypi| |versions|
55

6-
`Google Cloud Data Catalog API`_: Google Cloud Data Catalog API provides features to attach metadata to
7-
Google Cloud Platform resources like BigQuery Tables. Key critical resources
8-
include: Entries (Data Catalog representation of a cloud resource).
6+
`Google Cloud Data Catalog API`_: is a fully managed and highly scalable data discovery and metadata management service.
97

108
- `Client Library Documentation`_
119
- `Product Documentation`_
1210

13-
.. |ga| image:: https://img.shields.io/badge/support-GA-gold.svg
14-
:target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#general-availability
11+
.. |stable| image:: https://img.shields.io/badge/support-stable-gold.svg
12+
:target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels
1513
.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-datacatalog.svg
1614
:target: https://pypi.org/project/google-cloud-datacatalog/
1715
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-datacatalog.svg
@@ -35,17 +33,6 @@ In order to use this library, you first need to go through the following steps:
3533
.. _Enable the Google Cloud Data Catalog API.: https://cloud.google.com/data-catalog
3634
.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
3735

38-
39-
Supported Python Versions
40-
^^^^^^^^^^^^^^^^^^^^^^^^^
41-
Python >= 3.6
42-
43-
Deprecated Python Versions
44-
^^^^^^^^^^^^^^^^^^^^^^^^^^
45-
Python == 2.7.
46-
47-
The last version of this library compatible with Python 2.7 is google-cloud-datacatalog==1.0.0.
48-
4936
Installation
5037
~~~~~~~~~~~~
5138

@@ -60,6 +47,27 @@ dependencies.
6047
.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/
6148

6249

50+
Code samples and snippets
51+
~~~~~~~~~~~~~~~~~~~~~~~~~
52+
53+
Code samples and snippets live in the `samples/` folder.
54+
55+
56+
Supported Python Versions
57+
^^^^^^^^^^^^^^^^^^^^^^^^^
58+
Our client libraries are compatible with all current [active](https://devguide.python.org/devcycle/#in-development-main-branch) and [maintenance](https://devguide.python.org/devcycle/#maintenance-branches) versions of
59+
Python.
60+
61+
Python >= 3.7
62+
63+
Unsupported Python Versions
64+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
65+
Python <= 3.6
66+
67+
If you are using an [end-of-life](https://devguide.python.org/devcycle/#end-of-life-branches)
68+
version of Python, we recommend that you update as soon as possible to an actively supported version.
69+
70+
6371
Mac/Linux
6472
^^^^^^^^^
6573

@@ -85,7 +93,7 @@ Next Steps
8593
~~~~~~~~~~
8694

8795
- Read the `Client Library Documentation`_ for Google Cloud Data Catalog API
88-
API to see other available methods on the client.
96+
to see other available methods on the client.
8997
- Read the `Google Cloud Data Catalog API Product documentation`_ to learn
9098
more about the product and see How-to Guides.
9199
- View this `README`_ to see the full list of Cloud

noxfile.py

Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
DEFAULT_PYTHON_VERSION = "3.8"
3434

35-
UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"]
35+
UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10"]
3636
UNIT_TEST_STANDARD_DEPENDENCIES = [
3737
"mock",
3838
"asyncmock",
@@ -332,28 +332,15 @@ def docfx(session):
332332
def prerelease_deps(session):
333333
"""Run all tests with prerelease versions of dependencies installed."""
334334

335-
prerel_deps = [
336-
"protobuf",
337-
"googleapis-common-protos",
338-
"google-auth",
339-
"grpcio",
340-
"grpcio-status",
341-
"google-api-core",
342-
"proto-plus",
343-
# dependencies of google-auth
344-
"cryptography",
345-
"pyasn1",
346-
]
347-
348-
for dep in prerel_deps:
349-
session.install("--pre", "--no-deps", "--upgrade", dep)
350-
351-
# Remaining dependencies
352-
other_deps = ["requests"]
353-
session.install(*other_deps)
354-
335+
# Install all dependencies
336+
session.install("-e", ".[all, tests, tracing]")
355337
session.install(*UNIT_TEST_STANDARD_DEPENDENCIES)
356-
session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES)
338+
system_deps_all = (
339+
SYSTEM_TEST_STANDARD_DEPENDENCIES
340+
+ SYSTEM_TEST_EXTERNAL_DEPENDENCIES
341+
+ SYSTEM_TEST_EXTRAS
342+
)
343+
session.install(*system_deps_all)
357344

358345
# Because we test minimum dependency versions on the minimum Python
359346
# version, the first version we test with in the unit tests sessions has a
@@ -367,19 +354,44 @@ def prerelease_deps(session):
367354
constraints_text = constraints_file.read()
368355

369356
# Ignore leading whitespace and comment lines.
370-
deps = [
357+
constraints_deps = [
371358
match.group(1)
372359
for match in re.finditer(
373360
r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE
374361
)
375362
]
376363

377-
# Don't overwrite prerelease packages.
378-
deps = [dep for dep in deps if dep not in prerel_deps]
379-
# We use --no-deps to ensure that pre-release versions aren't overwritten
380-
# by the version ranges in setup.py.
381-
session.install(*deps)
382-
session.install("--no-deps", "-e", ".[all]")
364+
session.install(*constraints_deps)
365+
366+
if os.path.exists("samples/snippets/requirements.txt"):
367+
session.install("-r", "samples/snippets/requirements.txt")
368+
369+
if os.path.exists("samples/snippets/requirements-test.txt"):
370+
session.install("-r", "samples/snippets/requirements-test.txt")
371+
372+
prerel_deps = [
373+
"protobuf",
374+
# dependency of grpc
375+
"six",
376+
"googleapis-common-protos",
377+
"grpcio",
378+
"grpcio-status",
379+
"google-api-core",
380+
"proto-plus",
381+
"google-cloud-testutils",
382+
# dependencies of google-cloud-testutils"
383+
"click",
384+
]
385+
386+
for dep in prerel_deps:
387+
session.install("--pre", "--no-deps", "--upgrade", dep)
388+
389+
# Remaining dependencies
390+
other_deps = [
391+
"requests",
392+
"google-auth",
393+
]
394+
session.install(*other_deps)
383395

384396
# Print out prerelease package versions
385397
session.run(
@@ -388,5 +400,16 @@ def prerelease_deps(session):
388400
session.run("python", "-c", "import grpc; print(grpc.__version__)")
389401

390402
session.run("py.test", "tests/unit")
391-
session.run("py.test", "tests/system")
392-
session.run("py.test", "samples/snippets")
403+
404+
system_test_path = os.path.join("tests", "system.py")
405+
system_test_folder_path = os.path.join("tests", "system")
406+
407+
# Only run system tests if found.
408+
if os.path.exists(system_test_path) or os.path.exists(system_test_folder_path):
409+
session.run("py.test", "tests/system")
410+
411+
snippets_test_path = os.path.join("samples", "snippets")
412+
413+
# Only run samples tests if found.
414+
if os.path.exists(snippets_test_path):
415+
session.run("py.test", "samples/snippets")

samples/quickstart/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def get_pytest_env_vars() -> Dict[str, str]:
8888

8989
# DO NOT EDIT - automatically generated.
9090
# All versions used to test samples.
91-
ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"]
91+
ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10"]
9292

9393
# Any default versions that should be ignored.
9494
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]

samples/snippets/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def get_pytest_env_vars() -> Dict[str, str]:
8888

8989
# DO NOT EDIT - automatically generated.
9090
# All versions used to test samples.
91-
ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"]
91+
ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10"]
9292

9393
# Any default versions that should be ignored.
9494
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]

samples/v1beta1/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def get_pytest_env_vars() -> Dict[str, str]:
8888

8989
# DO NOT EDIT - automatically generated.
9090
# All versions used to test samples.
91-
ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"]
91+
ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10"]
9292

9393
# Any default versions that should be ignored.
9494
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]

scripts/readme-gen/templates/install_deps.tmpl.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Install Dependencies
1212
.. _Python Development Environment Setup Guide:
1313
https://cloud.google.com/python/setup
1414

15-
#. Create a virtualenv. Samples are compatible with Python 3.6+.
15+
#. Create a virtualenv. Samples are compatible with Python 3.7+.
1616

1717
.. code-block:: bash
1818

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
"License :: OSI Approved :: Apache Software License",
7171
"Programming Language :: Python",
7272
"Programming Language :: Python :: 3",
73-
"Programming Language :: Python :: 3.6",
7473
"Programming Language :: Python :: 3.7",
7574
"Programming Language :: Python :: 3.8",
7675
"Programming Language :: Python :: 3.9",
@@ -89,4 +88,5 @@
8988
extras_require=extras,
9089
include_package_data=True,
9190
zip_safe=False,
91+
python_requires=">=3.7",
9292
)

0 commit comments

Comments
 (0)