Skip to content

Commit cbb0fbc

Browse files
1 parent 3d213cf commit cbb0fbc

File tree

8 files changed

+104
-80
lines changed

8 files changed

+104
-80
lines changed

‎packages/google-cloud-common/.gitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ docs.metadata
5050

5151
# Virtual environment
5252
env/
53-
venv/
5453

5554
# Test logs
5655
coverage.xml

‎packages/google-cloud-common/CONTRIBUTING.rst‎

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ Running System Tests
143143
$ nox -s system
144144

145145
# Run a single system test
146-
$ nox -s system-3.8 -- -k <name of test>
146+
$ nox -s system-3.11 -- -k <name of test>
147147

148148

149149
.. note::
150150

151-
System tests are only configured to run under Python 3.8.
151+
System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11.
152152
For expediency, we do not run them in older versions of Python 3.
153153

154154
This alone will not run the tests. You'll need to change some local
@@ -236,21 +236,9 @@ We support:
236236

237237
Supported versions can be found in our ``noxfile.py`` `config`_.
238238

239-
.. _config: https://github.com/googleapis/python-cloud-common/blob/main/noxfile.py
239+
.. _config: https://github.com/googleapis/python-cloud-common/blob/main/packages/google-cloud-common/noxfile.py
240240

241241

242-
We also explicitly decided to support Python 3 beginning with version 3.7.
243-
Reasons for this include:
244-
245-
- Encouraging use of newest versions of Python 3
246-
- Taking the lead of `prominent`_ open-source `projects`_
247-
- `Unicode literal support`_ which allows for a cleaner codebase that
248-
works in both Python 2 and Python 3
249-
250-
.. _prominent: https://docs.djangoproject.com/en/1.9/faq/install/#what-python-version-can-i-use-with-django
251-
.. _projects: http://flask.pocoo.org/docs/0.10/python3/
252-
.. _Unicode literal support: https://www.python.org/dev/peps/pep-0414/
253-
254242
**********
255243
Versioning
256244
**********
Lines changed: 74 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,108 @@
11
Python Client for Google Cloud Common
22
=====================================
33

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

6-
This package contains generated Python types for `google.cloud.common`.
6+
`Google Cloud Common`_: This package contains generated Python types for google.cloud.common
77

88
- `Client Library Documentation`_
9+
- `Product Documentation`_
910

10-
.. |ga| image:: https://img.shields.io/badge/support-ga-gold.svg
11-
:target: https://github.com/googleapis/google-cloud-python/blob/main/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
1213
.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-common.svg
1314
:target: https://pypi.org/project/google-cloud-common/
1415
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-common.svg
1516
:target: https://pypi.org/project/google-cloud-common/
17+
.. _Google Cloud Common: https://cloud.google.com
1618
.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/common/latest
19+
.. _Product Documentation: https://cloud.google.com
20+
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 Google Cloud Common.`_
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 Google Cloud Common.: https://cloud.google.com
34+
.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
1735

1836
Installation
19-
------------
37+
~~~~~~~~~~~~
2038

21-
Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to
22-
create isolated Python environments. The basic problem it addresses is one of
23-
dependencies and versions, and indirectly permissions.
39+
Install this library in a virtual environment using `venv`_. `venv`_ is a tool that
40+
creates isolated Python environments. These isolated environments can have separate
41+
versions of Python packages, which allows you to isolate one project's dependencies
42+
from the dependencies of other projects.
2443

25-
With `virtualenv`_, it's possible to install this library without needing system
44+
With `venv`_, it's possible to install this library without needing system
2645
install permissions, and without clashing with the installed system
2746
dependencies.
2847

29-
.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/
48+
.. _`venv`: https://docs.python.org/3/library/venv.html
49+
50+
51+
Code samples and snippets
52+
~~~~~~~~~~~~~~~~~~~~~~~~~
53+
54+
Code samples and snippets live in the `samples/`_ folder.
55+
56+
.. _samples/: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-common/samples
57+
3058

59+
Supported Python Versions
60+
^^^^^^^^^^^^^^^^^^^^^^^^^
61+
Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
62+
Python.
63+
64+
Python >= 3.7
65+
66+
.. _active: https://devguide.python.org/devcycle/#in-development-main-branch
67+
.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
68+
69+
Unsupported Python Versions
70+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
71+
Python <= 3.6
72+
73+
If you are using an `end-of-life`_
74+
version of Python, we recommend that you update as soon as possible to an actively supported version.
75+
76+
.. _end-of-life: https://devguide.python.org/devcycle/#end-of-life-branches
3177

3278
Mac/Linux
3379
^^^^^^^^^
3480

3581
.. code-block:: console
3682
37-
pip install virtualenv
38-
virtualenv <your-env>
83+
python3 -m venv <your-env>
3984
source <your-env>/bin/activate
40-
<your-env>/bin/pip install google-cloud-common
85+
pip install google-cloud-common
4186
4287
4388
Windows
4489
^^^^^^^
4590

4691
.. code-block:: console
4792
48-
pip install virtualenv
49-
virtualenv <your-env>
50-
<your-env>\Scripts\activate
51-
<your-env>\Scripts\pip.exe install google-cloud-common
93+
py -m venv <your-env>
94+
.\<your-env>\Scripts\activate
95+
pip install google-cloud-common
96+
97+
Next Steps
98+
~~~~~~~~~~
99+
100+
- Read the `Client Library Documentation`_ for Google Cloud Common
101+
to see other available methods on the client.
102+
- Read the `Google Cloud Common Product documentation`_ to learn
103+
more about the product and see How-to Guides.
104+
- View this `README`_ to see the full list of Cloud
105+
APIs that we cover.
106+
107+
.. _Google Cloud Common Product documentation: https://cloud.google.com
108+
.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../CHANGELOG.md
File renamed without changes.

‎packages/google-cloud-common/google-cloud-common/google-cloud-common.txt‎

Whitespace-only changes.

‎packages/google-cloud-common/noxfile.py‎

Lines changed: 25 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -22,43 +22,41 @@
2222
import pathlib
2323
import re
2424
import shutil
25-
from typing import Dict, List
2625
import warnings
2726

2827
import nox
2928

30-
FLAKE8_VERSION = "flake8==6.1.0"
31-
BLACK_VERSION = "black[jupyter]==23.7.0"
32-
ISORT_VERSION = "isort==5.11.0"
29+
BLACK_VERSION = "black==22.3.0"
30+
ISORT_VERSION = "isort==5.10.1"
3331
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
3432

35-
DEFAULT_PYTHON_VERSION = "3.8"
33+
DEFAULT_PYTHON_VERSION = "3.9"
3634

37-
UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"]
35+
UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
3836
UNIT_TEST_STANDARD_DEPENDENCIES = [
3937
"mock",
4038
"asyncmock",
4139
"pytest",
4240
"pytest-cov",
4341
"pytest-asyncio",
4442
]
45-
UNIT_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
46-
UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = []
47-
UNIT_TEST_DEPENDENCIES: List[str] = []
48-
UNIT_TEST_EXTRAS: List[str] = []
49-
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
50-
51-
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8"]
52-
SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [
43+
UNIT_TEST_EXTERNAL_DEPENDENCIES = []
44+
UNIT_TEST_LOCAL_DEPENDENCIES = []
45+
UNIT_TEST_DEPENDENCIES = []
46+
UNIT_TEST_EXTRAS = []
47+
UNIT_TEST_EXTRAS_BY_PYTHON = {}
48+
49+
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11"]
50+
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
5351
"mock",
5452
"pytest",
5553
"google-cloud-testutils",
5654
]
57-
SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
58-
SYSTEM_TEST_LOCAL_DEPENDENCIES: List[str] = []
59-
SYSTEM_TEST_DEPENDENCIES: List[str] = []
60-
SYSTEM_TEST_EXTRAS: List[str] = []
61-
SYSTEM_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
55+
SYSTEM_TEST_EXTERNAL_DEPENDENCIES = []
56+
SYSTEM_TEST_LOCAL_DEPENDENCIES = []
57+
SYSTEM_TEST_DEPENDENCIES = []
58+
SYSTEM_TEST_EXTRAS = []
59+
SYSTEM_TEST_EXTRAS_BY_PYTHON = {}
6260

6361
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
6462

@@ -71,7 +69,6 @@
7169
"lint_setup_py",
7270
"blacken",
7371
"docs",
74-
"format",
7572
]
7673

7774
# Error if a python version is missing
@@ -85,7 +82,7 @@ def lint(session):
8582
Returns a failure if the linters find linting errors or sufficiently
8683
serious code quality issues.
8784
"""
88-
session.install(FLAKE8_VERSION, BLACK_VERSION)
85+
session.install("flake8", BLACK_VERSION)
8986
session.run(
9087
"black",
9188
"--check",
@@ -190,6 +187,7 @@ def unit(session):
190187

191188

192189
def install_systemtest_dependencies(session, *constraints):
190+
193191
# Use pre-release gRPC for system tests.
194192
# Exclude version 1.52.0rc1 which has a known issue.
195193
# See https://github.com/grpc/grpc/issues/32163
@@ -275,7 +273,7 @@ def cover(session):
275273
session.run("coverage", "erase")
276274

277275

278-
@nox.session(python="3.9")
276+
@nox.session(python=DEFAULT_PYTHON_VERSION)
279277
def docs(session):
280278
"""Build the docs for this library."""
281279

@@ -301,7 +299,7 @@ def docs(session):
301299
)
302300

303301

304-
@nox.session(python="3.9")
302+
@nox.session(python=DEFAULT_PYTHON_VERSION)
305303
def docfx(session):
306304
"""Build the docfx yaml files for this library."""
307305

@@ -338,7 +336,7 @@ def docfx(session):
338336
)
339337

340338

341-
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
339+
@nox.session(python="3.11")
342340
def prerelease_deps(session):
343341
"""Run all tests with prerelease versions of dependencies installed."""
344342

@@ -347,7 +345,9 @@ def prerelease_deps(session):
347345
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
348346
session.install(*unit_deps_all)
349347
system_deps_all = (
350-
SYSTEM_TEST_STANDARD_DEPENDENCIES + SYSTEM_TEST_EXTERNAL_DEPENDENCIES
348+
SYSTEM_TEST_STANDARD_DEPENDENCIES
349+
+ SYSTEM_TEST_EXTERNAL_DEPENDENCIES
350+
+ SYSTEM_TEST_EXTRAS
351351
)
352352
session.install(*system_deps_all)
353353

@@ -405,24 +405,3 @@ def prerelease_deps(session):
405405
session.run("python", "-c", "import google.auth; print(google.auth.__version__)")
406406

407407
session.run("py.test", "tests/unit")
408-
409-
system_test_path = os.path.join("tests", "system.py")
410-
system_test_folder_path = os.path.join("tests", "system")
411-
412-
# Only run system tests if found.
413-
if os.path.exists(system_test_path):
414-
session.run(
415-
"py.test",
416-
"--verbose",
417-
f"--junitxml=system_{session.python}_sponge_log.xml",
418-
system_test_path,
419-
*session.posargs,
420-
)
421-
if os.path.exists(system_test_folder_path):
422-
session.run(
423-
"py.test",
424-
"--verbose",
425-
f"--junitxml=system_{session.python}_sponge_log.xml",
426-
system_test_folder_path,
427-
*session.posargs,
428-
)

‎packages/google-cloud-common/setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'",
4242
"protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
4343
]
44-
url = "https://github.com/googleapis/python-cloud-common"
44+
url = "https://github.com/googleapis/google-cloud-python"
4545

4646
package_root = os.path.abspath(os.path.dirname(__file__))
4747

0 commit comments

Comments
 (0)