Skip to content

Commit

Permalink
fix: require python 3.7+ (#201)
Browse files Browse the repository at this point in the history
* 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

* exclude templated README

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* remove required check for python 3.6

* fix(deps): require google-api-core >= 1.31.6

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 committed Jul 10, 2022
1 parent 1bc7354 commit 3277c60
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 97 deletions.
4 changes: 2 additions & 2 deletions .github/.OwlBot.lock.yaml
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32
# created: 2022-05-05T22:08:23.383410683Z
digest: sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c
# created: 2022-07-05T18:31:20.838186805Z
1 change: 0 additions & 1 deletion .github/sync-repo-settings.yaml
Expand Up @@ -11,7 +11,6 @@ branchProtectionRules:
# No Kokoro: the following are Github actions
- 'mypy'
- 'lint'
- 'unit (3.6)'
- 'unit (3.7)'
- 'unit (3.8)'
- 'unit (3.9)'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unittest.yml
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9', '3.10']
python: ['3.7', '3.8', '3.9', '3.10']
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
7 changes: 7 additions & 0 deletions .kokoro/continuous/prerelease-deps.cfg
@@ -0,0 +1,7 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "prerelease_deps"
}
7 changes: 7 additions & 0 deletions .kokoro/presubmit/prerelease-deps.cfg
@@ -0,0 +1,7 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "prerelease_deps"
}
40 changes: 0 additions & 40 deletions .kokoro/samples/python3.6/common.cfg

This file was deleted.

7 changes: 0 additions & 7 deletions .kokoro/samples/python3.6/continuous.cfg

This file was deleted.

11 changes: 0 additions & 11 deletions .kokoro/samples/python3.6/periodic-head.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions .kokoro/samples/python3.6/periodic.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions .kokoro/samples/python3.6/presubmit.cfg

This file was deleted.

4 changes: 2 additions & 2 deletions .kokoro/test-samples-impl.sh
Expand Up @@ -33,7 +33,7 @@ export PYTHONUNBUFFERED=1
env | grep KOKORO

# Install nox
python3.6 -m pip install --upgrade --quiet nox
python3.9 -m pip install --upgrade --quiet nox

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

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

# If this is a periodic build, send the test log to the FlakyBot.
Expand Down
6 changes: 2 additions & 4 deletions CONTRIBUTING.rst
Expand Up @@ -22,7 +22,7 @@ In order to add a feature:
documentation.

- The feature must work fully on the following CPython versions:
3.6, 3.7, 3.8, 3.9 and 3.10 on both UNIX and Windows.
3.7, 3.8, 3.9 and 3.10 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 @@ -221,13 +221,11 @@ Supported Python Versions

We support:

- `Python 3.6`_
- `Python 3.7`_
- `Python 3.8`_
- `Python 3.9`_
- `Python 3.10`_

.. _Python 3.6: https://docs.python.org/3.6/
.. _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/
Expand All @@ -239,7 +237,7 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
.. _config: https://github.com/googleapis/python-cloud-core/blob/main/noxfile.py


We also explicitly decided to support Python 3 beginning with version 3.6.
We also explicitly decided to support Python 3 beginning with version 3.7.
Reasons for this include:

- Encouraging use of newest versions of Python 3
Expand Down
5 changes: 4 additions & 1 deletion README.rst
Expand Up @@ -32,9 +32,12 @@ to `Python Development Environment Setup Guide`_ for Google Cloud Platform.

Supported Python Versions
-------------------------
Python >= 3.6
Python >= 3.7

Unsupported Python Versions
---------------------------
Python == 2.7: the last version of this library which supported Python 2.7
is ``google.cloud.core 1.7.2``.

Python == 3.6: the last version of this library which supported Python 3.6
is ``google.cloud.core 2.3.1``.
2 changes: 1 addition & 1 deletion owlbot.py
Expand Up @@ -26,7 +26,6 @@
templated_files = common.py_library(
microgenerator=True,
cov_level=100,
unit_test_python_versions=["3.6", "3.7", "3.8", "3.9", "3.10"],
)
s.move(
templated_files,
Expand All @@ -36,6 +35,7 @@
".flake8",
".coveragerc",
"setup.cfg",
"README.rst",
],
)

Expand Down
2 changes: 1 addition & 1 deletion scripts/readme-gen/templates/install_deps.tmpl.rst
Expand Up @@ -12,7 +12,7 @@ Install Dependencies
.. _Python Development Environment Setup Guide:
https://cloud.google.com/python/setup

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

.. code-block:: bash
Expand Down
7 changes: 3 additions & 4 deletions setup.py
Expand Up @@ -28,10 +28,10 @@
# 'Development Status :: 5 - Production/Stable'
release_status = "Development Status :: 5 - Production/Stable"
dependencies = [
"google-api-core >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0",
"google-api-core >= 1.31.6, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0",
"google-auth >= 1.25.0, < 3.0dev",
]
extras = {"grpc": "grpcio >= 1.8.2, < 2.0dev"}
extras = {"grpc": "grpcio >= 1.38.0, < 2.0dev"}


# Setup boilerplate below this line.
Expand Down Expand Up @@ -74,7 +74,6 @@
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
Expand All @@ -87,7 +86,7 @@
namespace_packages=namespaces,
install_requires=dependencies,
extras_require=extras,
python_requires=">=3.6",
python_requires=">=3.7",
include_package_data=True,
zip_safe=False,
)
10 changes: 0 additions & 10 deletions testing/constraints-3.6.txt

This file was deleted.

10 changes: 10 additions & 0 deletions testing/constraints-3.7.txt
@@ -0,0 +1,10 @@
# This constraints file is used to check that lower bounds
# are correct in setup.py
# List *all* library dependencies and extras in this file.
# Pin the version to the lower bound.
#
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0
google-api-core==1.31.6
google-auth==1.25.0
grpcio==1.38.0

0 comments on commit 3277c60

Please sign in to comment.