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

Commit 147d1c3

Browse files
fix: require python 3.7+ (#101)
* 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 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 28aa573 commit 147d1c3

File tree

15 files changed

+173
-93
lines changed

15 files changed

+173
-93
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: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

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
Lines changed: 7 additions & 0 deletions
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

Lines changed: 7 additions & 0 deletions
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

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.

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-iam-logging/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: 61 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,37 @@
1-
Python Client for Google Cloud IAM Logging
2-
=======================================================
1+
Python Client for IAM Logging Protos API
2+
========================================
33

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

6-
This package contains generated Python types for ``google.iam.v1.logging``.
6+
`IAM Logging Protos API`_:
77

88
- `Client Library Documentation`_
99
- `Product Documentation`_
1010

11-
.. |ga| image:: https://img.shields.io/badge/support-ga-gold.svg
12-
:target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#ga-support
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
1313
.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-iam-logging.svg
1414
:target: https://pypi.org/project/google-cloud-iam-logging/
1515
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-iam-logging.svg
1616
:target: https://pypi.org/project/google-cloud-iam-logging/
17-
.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/iamlogging/latest
18-
.. _Product Documentation: https://cloud.google.com/iam/docs/audit-logging
17+
.. _IAM Logging Protos API: https://cloud.google.com/iam/docs/audit-logging
18+
.. _Client Library Documentation: https://cloud.google.com/python/docs/reference//latest
19+
.. _Product Documentation: https://cloud.google.com/iam/docs/audit-logging
1920

21+
Quick Start
22+
-----------
23+
24+
In order to use this library, you first need to go through the following steps:
25+
26+
1. `Select or create a Cloud Platform project.`_
27+
2. `Enable billing for your project.`_
28+
3. `Enable the IAM Logging Protos API.`_
29+
4. `Setup Authentication.`_
30+
31+
.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
32+
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
33+
.. _Enable the IAM Logging Protos API.: https://cloud.google.com/iam/docs/audit-logging
34+
.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
2035

2136
Installation
2237
~~~~~~~~~~~~
@@ -32,12 +47,34 @@ dependencies.
3247
.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/
3348

3449

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+
3571
Mac/Linux
3672
^^^^^^^^^
3773

3874
.. code-block:: console
3975
40-
python3 -m venv <your-env>
76+
pip install virtualenv
77+
virtualenv <your-env>
4178
source <your-env>/bin/activate
4279
<your-env>/bin/pip install google-cloud-iam-logging
4380
@@ -47,6 +84,20 @@ Windows
4784

4885
.. code-block:: console
4986
50-
python3 -m venv <your-env>
87+
pip install virtualenv
88+
virtualenv <your-env>
5189
<your-env>\Scripts\activate
5290
<your-env>\Scripts\pip.exe install google-cloud-iam-logging
91+
92+
Next Steps
93+
~~~~~~~~~~
94+
95+
- Read the `Client Library Documentation`_ for IAM Logging Protos API
96+
to see other available methods on the client.
97+
- Read the `IAM Logging Protos API Product documentation`_ to learn
98+
more about the product and see How-to Guides.
99+
- View this `README`_ to see the full list of Cloud
100+
APIs that we cover.
101+
102+
.. _IAM Logging Protos API Product documentation: https://cloud.google.com/iam/docs/audit-logging
103+
.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst

noxfile.py

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import os
2222
import pathlib
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",
@@ -325,3 +326,90 @@ def docfx(session):
325326
os.path.join("docs", ""),
326327
os.path.join("docs", "_build", "html", ""),
327328
)
329+
330+
331+
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
332+
def prerelease_deps(session):
333+
"""Run all tests with prerelease versions of dependencies installed."""
334+
335+
# Install all dependencies
336+
session.install("-e", ".[all, tests, tracing]")
337+
session.install(*UNIT_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)
344+
345+
# Because we test minimum dependency versions on the minimum Python
346+
# version, the first version we test with in the unit tests sessions has a
347+
# constraints file containing all dependencies and extras.
348+
with open(
349+
CURRENT_DIRECTORY
350+
/ "testing"
351+
/ f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt",
352+
encoding="utf-8",
353+
) as constraints_file:
354+
constraints_text = constraints_file.read()
355+
356+
# Ignore leading whitespace and comment lines.
357+
constraints_deps = [
358+
match.group(1)
359+
for match in re.finditer(
360+
r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE
361+
)
362+
]
363+
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)
395+
396+
# Print out prerelease package versions
397+
session.run(
398+
"python", "-c", "import google.protobuf; print(google.protobuf.__version__)"
399+
)
400+
session.run("python", "-c", "import grpc; print(grpc.__version__)")
401+
402+
session.run("py.test", "tests/unit")
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")

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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,11 @@
4747
"protobuf >= 3.19.0, <4.0.0dev",
4848
"grpc-google-iam-v1 >=0.12.4, <1.0.0dev",
4949
),
50-
python_requires=">=3.6",
50+
python_requires=">=3.7",
5151
classifiers=[
5252
"Development Status :: 5 - Production/Stable",
5353
"Intended Audience :: Developers",
5454
"Operating System :: OS Independent",
55-
"Programming Language :: Python :: 3.6",
5655
"Programming Language :: Python :: 3.7",
5756
"Programming Language :: Python :: 3.8",
5857
"Programming Language :: Python :: 3.9",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy