Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 14780e3

Browse filesBrowse files
fix: require python 3.7+ (#207)
* 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 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 8b74fba commit 14780e3
Copy full SHA for 14780e3

File tree

Expand file treeCollapse file tree

16 files changed

+150
-110
lines changed
Filter options
Expand file treeCollapse file tree

16 files changed

+150
-110
lines changed

‎packages/google-cloud-monitoring-dashboards/.github/.OwlBot.lock.yaml

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring-dashboards/.github/.OwlBot.lock.yaml
+2-2Lines 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

‎packages/google-cloud-monitoring-dashboards/.github/workflows/unittest.yml

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring-dashboards/.github/workflows/unittest.yml
+1-1Lines 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
+7Lines 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+
}
+7Lines 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+
}

‎packages/google-cloud-monitoring-dashboards/.kokoro/samples/python3.6/common.cfg

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring-dashboards/.kokoro/samples/python3.6/common.cfg
-40Lines changed: 0 additions & 40 deletions
This file was deleted.

‎packages/google-cloud-monitoring-dashboards/.kokoro/samples/python3.6/continuous.cfg

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring-dashboards/.kokoro/samples/python3.6/continuous.cfg
-7Lines changed: 0 additions & 7 deletions
This file was deleted.

‎packages/google-cloud-monitoring-dashboards/.kokoro/samples/python3.6/periodic-head.cfg

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring-dashboards/.kokoro/samples/python3.6/periodic-head.cfg
-11Lines changed: 0 additions & 11 deletions
This file was deleted.

‎packages/google-cloud-monitoring-dashboards/.kokoro/samples/python3.6/periodic.cfg

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring-dashboards/.kokoro/samples/python3.6/periodic.cfg
-6Lines changed: 0 additions & 6 deletions
This file was deleted.

‎packages/google-cloud-monitoring-dashboards/.kokoro/samples/python3.6/presubmit.cfg

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring-dashboards/.kokoro/samples/python3.6/presubmit.cfg
-6Lines changed: 0 additions & 6 deletions
This file was deleted.

‎packages/google-cloud-monitoring-dashboards/.kokoro/test-samples-impl.sh

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring-dashboards/.kokoro/test-samples-impl.sh
+2-2Lines 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.

‎packages/google-cloud-monitoring-dashboards/.repo-metadata.json

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring-dashboards/.repo-metadata.json
+2-1Lines 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": "monitoring-dashboards"
16+
"api_shortname": "monitoring-dashboards",
17+
"api_description": "are one way for you to view and analyze metric data. The Cloud Console provides predefined dashboards that require no setup or configuration. You can also define custom dashboards. With custom dashboards, you have complete control over the charts that are displayed and their configuration."
1718
}

‎packages/google-cloud-monitoring-dashboards/CONTRIBUTING.rst

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring-dashboards/CONTRIBUTING.rst
+2-4Lines 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-monitoring-dashboards/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
+36-26Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
Python Client for Stackdriver Monitoring Dashboards API
2-
=======================================================
1+
Python Client for Monitoring Dashboards API
2+
===========================================
33

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

6-
`Stackdriver Monitoring Dashboards API`_: Manages dashboard configurations used in the Stackdriver UI.
6+
`Monitoring Dashboards API`_: are one way for you to view and analyze metric data. The Cloud Console provides predefined dashboards that require no setup or configuration. You can also define custom dashboards. With custom dashboards, you have complete control over the charts that are displayed and their configuration.
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/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
1313
.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-monitoring-dashboards.svg
1414
:target: https://pypi.org/project/google-cloud-monitoring-dashboards/
1515
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-monitoring-dashboards.svg
1616
:target: https://pypi.org/project/google-cloud-monitoring-dashboards/
17-
18-
.. _Stackdriver Monitoring Dashboards API: https://cloud.google.com/monitoring/dashboards/
19-
.. _Client Library Documentation: https://googleapis.dev/python/monitoring-dashboards/latest
17+
.. _Monitoring Dashboards API: https://cloud.google.com/monitoring/dashboards/
18+
.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/monitoring-dashboards/latest
2019
.. _Product Documentation: https://cloud.google.com/monitoring/dashboards/
2120

2221
Quick Start
@@ -26,24 +25,14 @@ In order to use this library, you first need to go through the following steps:
2625

2726
1. `Select or create a Cloud Platform project.`_
2827
2. `Enable billing for your project.`_
29-
3. `Enable the Stackdriver Monitoring Dashboards API.`_
28+
3. `Enable the Monitoring Dashboards API.`_
3029
4. `Setup Authentication.`_
3130

3231
.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
3332
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
34-
.. _Enable the Stackdriver Monitoring Dashboards API.: https://cloud.google.com/monitoring/dashboards/
33+
.. _Enable the Monitoring Dashboards API.: https://cloud.google.com/monitoring/dashboards/
3534
.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
3635

37-
Supported Python Versions
38-
^^^^^^^^^^^^^^^^^^^^^^^^^
39-
Python >= 3.6
40-
41-
Deprecated Python Versions
42-
^^^^^^^^^^^^^^^^^^^^^^^^^^
43-
Python == 2.7.
44-
45-
The last version of this library compatible with Python 2.7 is google-cloud-monitoring-dashboards==1.0.0.
46-
4736
Installation
4837
~~~~~~~~~~~~
4938

@@ -58,6 +47,27 @@ dependencies.
5847
.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/
5948

6049

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+
6171
Mac/Linux
6272
^^^^^^^^^
6373

@@ -82,12 +92,12 @@ Windows
8292
Next Steps
8393
~~~~~~~~~~
8494

85-
- Read the `Client Library Documentation`_ for Stackdriver Monitoring Dashboards API
86-
API to see other available methods on the client.
87-
- Read the `Stackdriver Monitoring Dashboards API Product documentation`_ to learn
95+
- Read the `Client Library Documentation`_ for Monitoring Dashboards API
96+
to see other available methods on the client.
97+
- Read the `Monitoring Dashboards API Product documentation`_ to learn
8898
more about the product and see How-to Guides.
8999
- View this `README`_ to see the full list of Cloud
90100
APIs that we cover.
91101

92-
.. _Stackdriver Monitoring Dashboards API Product documentation: https://cloud.google.com/monitoring/dashboards/
93-
.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst
102+
.. _Monitoring Dashboards API Product documentation: https://cloud.google.com/monitoring/dashboards/
103+
.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst

‎packages/google-cloud-monitoring-dashboards/noxfile.py

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring-dashboards/noxfile.py
+89-1Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from __future__ import absolute_import
2020
import os
2121
import pathlib
22+
import re
2223
import shutil
2324
import warnings
2425

@@ -30,7 +31,7 @@
3031

3132
DEFAULT_PYTHON_VERSION = "3.8"
3233

33-
UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"]
34+
UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10"]
3435
UNIT_TEST_STANDARD_DEPENDENCIES = [
3536
"mock",
3637
"asyncmock",
@@ -324,3 +325,90 @@ def docfx(session):
324325
os.path.join("docs", ""),
325326
os.path.join("docs", "_build", "html", ""),
326327
)
328+
329+
330+
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
331+
def prerelease_deps(session):
332+
"""Run all tests with prerelease versions of dependencies installed."""
333+
334+
# Install all dependencies
335+
session.install("-e", ".[all, tests, tracing]")
336+
session.install(*UNIT_TEST_STANDARD_DEPENDENCIES)
337+
system_deps_all = (
338+
SYSTEM_TEST_STANDARD_DEPENDENCIES
339+
+ SYSTEM_TEST_EXTERNAL_DEPENDENCIES
340+
+ SYSTEM_TEST_EXTRAS
341+
)
342+
session.install(*system_deps_all)
343+
344+
# Because we test minimum dependency versions on the minimum Python
345+
# version, the first version we test with in the unit tests sessions has a
346+
# constraints file containing all dependencies and extras.
347+
with open(
348+
CURRENT_DIRECTORY
349+
/ "testing"
350+
/ f"constraints-{UNIT_TEST_PYTHON_VERSIONS[0]}.txt",
351+
encoding="utf-8",
352+
) as constraints_file:
353+
constraints_text = constraints_file.read()
354+
355+
# Ignore leading whitespace and comment lines.
356+
constraints_deps = [
357+
match.group(1)
358+
for match in re.finditer(
359+
r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE
360+
)
361+
]
362+
363+
session.install(*constraints_deps)
364+
365+
if os.path.exists("samples/snippets/requirements.txt"):
366+
session.install("-r", "samples/snippets/requirements.txt")
367+
368+
if os.path.exists("samples/snippets/requirements-test.txt"):
369+
session.install("-r", "samples/snippets/requirements-test.txt")
370+
371+
prerel_deps = [
372+
"protobuf",
373+
# dependency of grpc
374+
"six",
375+
"googleapis-common-protos",
376+
"grpcio",
377+
"grpcio-status",
378+
"google-api-core",
379+
"proto-plus",
380+
"google-cloud-testutils",
381+
# dependencies of google-cloud-testutils"
382+
"click",
383+
]
384+
385+
for dep in prerel_deps:
386+
session.install("--pre", "--no-deps", "--upgrade", dep)
387+
388+
# Remaining dependencies
389+
other_deps = [
390+
"requests",
391+
"google-auth",
392+
]
393+
session.install(*other_deps)
394+
395+
# Print out prerelease package versions
396+
session.run(
397+
"python", "-c", "import google.protobuf; print(google.protobuf.__version__)"
398+
)
399+
session.run("python", "-c", "import grpc; print(grpc.__version__)")
400+
401+
session.run("py.test", "tests/unit")
402+
403+
system_test_path = os.path.join("tests", "system.py")
404+
system_test_folder_path = os.path.join("tests", "system")
405+
406+
# Only run system tests if found.
407+
if os.path.exists(system_test_path) or os.path.exists(system_test_folder_path):
408+
session.run("py.test", "tests/system")
409+
410+
snippets_test_path = os.path.join("samples", "snippets")
411+
412+
# Only run samples tests if found.
413+
if os.path.exists(snippets_test_path):
414+
session.run("py.test", "samples/snippets")

‎packages/google-cloud-monitoring-dashboards/scripts/readme-gen/templates/install_deps.tmpl.rst

Copy file name to clipboardExpand all lines: packages/google-cloud-monitoring-dashboards/scripts/readme-gen/templates/install_deps.tmpl.rst
+1-1Lines 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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.