Skip to content

Commit bce01df

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

18 files changed

+119
-89
lines changed

.github/.OwlBot.lock.yaml

+2-2
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:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32
17-
# created: 2022-05-05T22:08:23.383410683Z
16+
digest: sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c
17+
# created: 2022-07-05T18:31:20.838186805Z

.github/workflows/unittest.yml

+1-1
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
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Only run this nox session.
4+
env_vars: {
5+
key: "NOX_SESSION"
6+
value: "prerelease_deps"
7+
}

.kokoro/presubmit/prerelease-deps.cfg

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Only run this nox session.
4+
env_vars: {
5+
key: "NOX_SESSION"
6+
value: "prerelease_deps"
7+
}

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

-40
This file was deleted.

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

-7
This file was deleted.

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

-11
This file was deleted.

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

-6
This file was deleted.

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

-6
This file was deleted.

.kokoro/test-samples-impl.sh

+2-2
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

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "db-dtypes",
33
"name_pretty": "Pandas Data Types for SQL systems (BigQuery, Spanner)",
4+
"product_documentation": "https://pandas.pydata.org/pandas-docs/stable/ecosystem.html#ecosystem-extensions",
45
"client_documentation": "https://googleapis.dev/python/db-dtypes/latest/index.html",
56
"release_level": "stable",
67
"language": "python",
@@ -9,5 +10,6 @@
910
"distribution_name": "db-dtypes",
1011
"api_id": "bigquery.googleapis.com",
1112
"default_version": "",
12-
"codeowner_team": "@googleapis/api-bigquery"
13+
"codeowner_team": "@googleapis/api-bigquery",
14+
"api_description": "Pandas extension data types for data from SQL systems such as BigQuery."
1315
}

CONTRIBUTING.rst

+2-4
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-db-dtypes-pandas/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

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ dependencies.
3434

3535
Supported Python Versions
3636
^^^^^^^^^^^^^^^^^^^^^^^^^
37-
Python >= 3.6
37+
Python >= 3.7
3838

3939
Unsupported Python Versions
4040
^^^^^^^^^^^^^^^^^^^^^^^^^^^
41-
Python <= 3.5.
41+
Python <= 3.6.
4242

4343

4444
Mac/Linux

noxfile.py

+89-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import os
2121
import pathlib
2222
import re
23+
import re
2324
import shutil
2425
import warnings
2526

@@ -31,7 +32,7 @@
3132

3233
DEFAULT_PYTHON_VERSION = "3.8"
3334

34-
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"]
3536
UNIT_TEST_STANDARD_DEPENDENCIES = [
3637
"mock",
3738
"asyncmock",
@@ -421,3 +422,90 @@ def docfx(session):
421422
os.path.join("docs", ""),
422423
os.path.join("docs", "_build", "html", ""),
423424
)
425+
426+
427+
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
428+
def prerelease_deps(session):
429+
"""Run all tests with prerelease versions of dependencies installed."""
430+
431+
# Install all dependencies
432+
session.install("-e", ".[all, tests, tracing]")
433+
session.install(*UNIT_TEST_STANDARD_DEPENDENCIES)
434+
system_deps_all = (
435+
SYSTEM_TEST_STANDARD_DEPENDENCIES
436+
+ SYSTEM_TEST_EXTERNAL_DEPENDENCIES
437+
+ SYSTEM_TEST_EXTRAS
438+
)
439+
session.install(*system_deps_all)
440+
441+
# Because we test minimum dependency versions on the minimum Python
442+
# version, the first version we test with in the unit tests sessions has a
443+
# constraints file containing all dependencies and extras.
444+
with open(
445+
CURRENT_DIRECTORY
446+
/ "testing"
447+
/ f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt",
448+
encoding="utf-8",
449+
) as constraints_file:
450+
constraints_text = constraints_file.read()
451+
452+
# Ignore leading whitespace and comment lines.
453+
constraints_deps = [
454+
match.group(1)
455+
for match in re.finditer(
456+
r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE
457+
)
458+
]
459+
460+
session.install(*constraints_deps)
461+
462+
if os.path.exists("samples/snippets/requirements.txt"):
463+
session.install("-r", "samples/snippets/requirements.txt")
464+
465+
if os.path.exists("samples/snippets/requirements-test.txt"):
466+
session.install("-r", "samples/snippets/requirements-test.txt")
467+
468+
prerel_deps = [
469+
"protobuf",
470+
# dependency of grpc
471+
"six",
472+
"googleapis-common-protos",
473+
"grpcio",
474+
"grpcio-status",
475+
"google-api-core",
476+
"proto-plus",
477+
"google-cloud-testutils",
478+
# dependencies of google-cloud-testutils"
479+
"click",
480+
]
481+
482+
for dep in prerel_deps:
483+
session.install("--pre", "--no-deps", "--upgrade", dep)
484+
485+
# Remaining dependencies
486+
other_deps = [
487+
"requests",
488+
"google-auth",
489+
]
490+
session.install(*other_deps)
491+
492+
# Print out prerelease package versions
493+
session.run(
494+
"python", "-c", "import google.protobuf; print(google.protobuf.__version__)"
495+
)
496+
session.run("python", "-c", "import grpc; print(grpc.__version__)")
497+
498+
session.run("py.test", "tests/unit")
499+
500+
system_test_path = os.path.join("tests", "system.py")
501+
system_test_folder_path = os.path.join("tests", "system")
502+
503+
# Only run system tests if found.
504+
if os.path.exists(system_test_path) or os.path.exists(system_test_folder_path):
505+
session.run("py.test", "tests/system")
506+
507+
snippets_test_path = os.path.join("samples", "snippets")
508+
509+
# Only run samples tests if found.
510+
if os.path.exists(snippets_test_path):
511+
session.run("py.test", "samples/snippets")

owlbot.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,13 @@
2828
# Add templated files
2929
# ----------------------------------------------------------------------------
3030
templated_files = common.py_library(
31-
unit_test_python_versions=["3.6", "3.7", "3.8", "3.9", "3.10"],
3231
system_test_python_versions=["3.8"],
3332
cov_level=100,
3433
intersphinx_dependencies={
3534
"pandas": "https://pandas.pydata.org/pandas-docs/stable/"
3635
},
3736
)
38-
s.move(templated_files, excludes=["docs/multiprocessing.rst"])
37+
s.move(templated_files, excludes=["docs/multiprocessing.rst", "README.rst"])
3938

4039
# ----------------------------------------------------------------------------
4140
# Fixup files

samples/snippets/noxfile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:
8989

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

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

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

+1-1
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

+1-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def readme():
6262
"License :: OSI Approved :: Apache Software License",
6363
"Programming Language :: Python",
6464
"Programming Language :: Python :: 3",
65-
"Programming Language :: Python :: 3.6",
6665
"Programming Language :: Python :: 3.7",
6766
"Programming Language :: Python :: 3.8",
6867
"Programming Language :: Python :: 3.9",
@@ -72,6 +71,6 @@ def readme():
7271
],
7372
platforms="Posix; MacOS X; Windows",
7473
install_requires=dependencies,
75-
python_requires=">=3.6, <3.11",
74+
python_requires=">=3.7, <3.11",
7675
tests_require=["pytest"],
7776
)

0 commit comments

Comments
 (0)