Skip to content

Commit 92d3355

Browse files
chore: synth changes to include py.typed files in release, doc updates (#83)
* chore(python): include py.typed files in release A py.typed file must be included in the released package for it to be considered typed by type checkers. https://www.python.org/dev/peps/pep-0561/#packaging-type-information. See googleapis/python-secret-manager#79 Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Fri Feb 5 17:32:06 2021 -0700 Source-Repo: googleapis/synthtool Source-Sha: 33366574ffb9e11737b3547eb6f020ecae0536e8 Source-Link: googleapis/synthtool@3336657 * docs: update python contributing guide Adds details about blacken, updates version for system tests, and shows how to pass through pytest arguments. Source-Author: Chris Cotter <cjcotter@google.com> Source-Date: Mon Feb 8 17:13:36 2021 -0500 Source-Repo: googleapis/synthtool Source-Sha: 4679e7e415221f03ff2a71e3ffad75b9ec41d87e Source-Link: googleapis/synthtool@4679e7e * build(python): enable flakybot on library unit and system tests Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Wed Feb 17 14:10:46 2021 -0700 Source-Repo: googleapis/synthtool Source-Sha: d17674372e27fb8f23013935e794aa37502071aa Source-Link: googleapis/synthtool@d176743 * test: install pyopenssl for mtls testing Source-Author: arithmetic1728 <58957152+arithmetic1728@users.noreply.github.com> Source-Date: Tue Mar 2 12:27:56 2021 -0800 Source-Repo: googleapis/synthtool Source-Sha: 0780323da96d5a53925fe0547757181fe76e8f1e Source-Link: googleapis/synthtool@0780323
1 parent 74d88ff commit 92d3355

File tree

6 files changed

+54
-12
lines changed

6 files changed

+54
-12
lines changed

packages/google-cloud-bigquery-reservation/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ docs.metadata
5050

5151
# Virtual environment
5252
env/
53+
54+
# Test logs
5355
coverage.xml
54-
sponge_log.xml
56+
*sponge_log.xml
5557

5658
# System test environment variables.
5759
system_tests/local_test_setup

packages/google-cloud-bigquery-reservation/.kokoro/build.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ python3 -m pip uninstall --yes --quiet nox-automation
4040
python3 -m pip install --upgrade --quiet nox
4141
python3 -m nox --version
4242

43+
# If this is a continuous build, send the test log to the FlakyBot.
44+
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
45+
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then
46+
cleanup() {
47+
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
48+
$KOKORO_GFILE_DIR/linux_amd64/flakybot
49+
}
50+
trap cleanup EXIT HUP
51+
fi
52+
4353
# If NOX_SESSION is set, it only runs the specified session,
4454
# otherwise run all the sessions.
4555
if [[ -n "${NOX_SESSION:-}" ]]; then

packages/google-cloud-bigquery-reservation/CONTRIBUTING.rst

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,14 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.
7070
- To test your changes, run unit tests with ``nox``::
7171

7272
$ nox -s unit-2.7
73-
$ nox -s unit-3.7
73+
$ nox -s unit-3.8
7474
$ ...
7575

76+
- Args to pytest can be passed through the nox command separated by a `--`. For
77+
example, to run a single test::
78+
79+
$ nox -s unit-3.8 -- -k <name of test>
80+
7681
.. note::
7782

7883
The unit tests and system tests are described in the
@@ -93,8 +98,12 @@ On Debian/Ubuntu::
9398
************
9499
Coding Style
95100
************
101+
- We use the automatic code formatter ``black``. You can run it using
102+
the nox session ``blacken``. This will eliminate many lint errors. Run via::
103+
104+
$ nox -s blacken
96105

97-
- PEP8 compliance, with exceptions defined in the linter configuration.
106+
- PEP8 compliance is required, with exceptions defined in the linter configuration.
98107
If you have ``nox`` installed, you can test that you have not introduced
99108
any non-compliant code via::
100109

@@ -133,13 +142,18 @@ Running System Tests
133142

134143
- To run system tests, you can execute::
135144

136-
$ nox -s system-3.7
145+
# Run all system tests
146+
$ nox -s system-3.8
137147
$ nox -s system-2.7
138148

149+
# Run a single system test
150+
$ nox -s system-3.8 -- -k <name of test>
151+
152+
139153
.. note::
140154

141155
System tests are only configured to run under Python 2.7 and
142-
Python 3.7. For expediency, we do not run them in older versions
156+
Python 3.8. For expediency, we do not run them in older versions
143157
of Python 3.
144158

145159
This alone will not run the tests. You'll need to change some local

packages/google-cloud-bigquery-reservation/MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
# Generated by synthtool. DO NOT EDIT!
1818
include README.rst LICENSE
19-
recursive-include google *.json *.proto
19+
recursive-include google *.json *.proto py.typed
2020
recursive-include tests *
2121
global-exclude *.py[co]
2222
global-exclude __pycache__
2323

2424
# Exclude scripts for samples readmegen
25-
prune scripts/readme-gen
25+
prune scripts/readme-gen

packages/google-cloud-bigquery-reservation/noxfile.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def default(session):
9393
session.run(
9494
"py.test",
9595
"--quiet",
96+
f"--junitxml=unit_{session.python}_sponge_log.xml",
9697
"--cov=google/cloud",
9798
"--cov=tests/unit",
9899
"--cov-append",
@@ -122,6 +123,9 @@ def system(session):
122123
# Sanity check: Only run tests if the environment variable is set.
123124
if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""):
124125
session.skip("Credentials must be set via environment variable")
126+
# Install pyopenssl for mTLS testing.
127+
if os.environ.get("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true":
128+
session.install("pyopenssl")
125129

126130
system_test_exists = os.path.exists(system_test_path)
127131
system_test_folder_exists = os.path.exists(system_test_folder_path)
@@ -141,9 +145,21 @@ def system(session):
141145

142146
# Run py.test against the system tests.
143147
if system_test_exists:
144-
session.run("py.test", "--quiet", system_test_path, *session.posargs)
148+
session.run(
149+
"py.test",
150+
"--quiet",
151+
f"--junitxml=system_{session.python}_sponge_log.xml",
152+
system_test_path,
153+
*session.posargs,
154+
)
145155
if system_test_folder_exists:
146-
session.run("py.test", "--quiet", system_test_folder_path, *session.posargs)
156+
session.run(
157+
"py.test",
158+
"--quiet",
159+
f"--junitxml=system_{session.python}_sponge_log.xml",
160+
system_test_folder_path,
161+
*session.posargs,
162+
)
147163

148164

149165
@nox.session(python=DEFAULT_PYTHON_VERSION)

packages/google-cloud-bigquery-reservation/synth.metadata

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/python-bigquery-reservation.git",
7-
"sha": "975968c904f5a6627d2f3df1fad9b85c11829d39"
7+
"sha": "5cdcdfa69529de05dab721f7c31f59136bfea637"
88
}
99
},
1010
{
@@ -19,14 +19,14 @@
1919
"git": {
2020
"name": "synthtool",
2121
"remote": "https://github.com/googleapis/synthtool.git",
22-
"sha": "d1bb9173100f62c0cfc8f3138b62241e7f47ca6a"
22+
"sha": "0780323da96d5a53925fe0547757181fe76e8f1e"
2323
}
2424
},
2525
{
2626
"git": {
2727
"name": "synthtool",
2828
"remote": "https://github.com/googleapis/synthtool.git",
29-
"sha": "d1bb9173100f62c0cfc8f3138b62241e7f47ca6a"
29+
"sha": "0780323da96d5a53925fe0547757181fe76e8f1e"
3030
}
3131
}
3232
],

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