Skip to content

Commit d52334c

Browse files
chore(python): simplify nox steps in CONTRIBUTING.rst (#195)
Source-Link: googleapis/synthtool@26558ba Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:99d90d097e4a4710cc8658ee0b5b963f4426d0e424819787c3ac1405c9a26719 chore: add kokoro 3.9 config templates chore: update precommit hook pre-commit/pre-commit-hooks to v4 chore(python): remove hardcoded versions in CONTRIBUTING.rst docs: omit mention of Python 2.7 in 'CONTRIBUTING.rst'
1 parent cd4e341 commit d52334c

File tree

8 files changed

+80
-16
lines changed

8 files changed

+80
-16
lines changed

.github/.OwlBot.lock.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
docker:
22
image: gcr.io/repo-automation-bots/owlbot-python:latest
3-
digest: sha256:58c7342b0bccf85028100adaa3d856cb4a871c22ca9c01960d996e66c40548ce
3+
digest: sha256:99d90d097e4a4710cc8658ee0b5b963f4426d0e424819787c3ac1405c9a26719

.kokoro/samples/python3.9/common.cfg

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Build logs will be here
4+
action {
5+
define_artifacts {
6+
regex: "**/*sponge_log.xml"
7+
}
8+
}
9+
10+
# Specify which tests to run
11+
env_vars: {
12+
key: "RUN_TESTS_SESSION"
13+
value: "py-3.9"
14+
}
15+
16+
# Declare build specific Cloud project.
17+
env_vars: {
18+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
19+
value: "python-docs-samples-tests-py39"
20+
}
21+
22+
env_vars: {
23+
key: "TRAMPOLINE_BUILD_FILE"
24+
value: "github/python-bigquery-sqlalchemy/.kokoro/test-samples.sh"
25+
}
26+
27+
# Configure the docker image for kokoro-trampoline.
28+
env_vars: {
29+
key: "TRAMPOLINE_IMAGE"
30+
value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
31+
}
32+
33+
# Download secrets for samples
34+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
35+
36+
# Download trampoline resources.
37+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
38+
39+
# Use the trampoline script to run in docker.
40+
build_file: "python-bigquery-sqlalchemy/.kokoro/trampoline.sh"
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "INSTALL_LIBRARY_FROM_SOURCE"
5+
value: "True"
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "INSTALL_LIBRARY_FROM_SOURCE"
5+
value: "True"
6+
}
7+
8+
env_vars: {
9+
key: "TRAMPOLINE_BUILD_FILE"
10+
value: "github/python-pubsub/.kokoro/test-samples-against-head.sh"
11+
}
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "INSTALL_LIBRARY_FROM_SOURCE"
5+
value: "False"
6+
}
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "INSTALL_LIBRARY_FROM_SOURCE"
5+
value: "True"
6+
}

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# See https://pre-commit.com/hooks.html for more hooks
1717
repos:
1818
- repo: https://github.com/pre-commit/pre-commit-hooks
19-
rev: v3.4.0
19+
rev: v4.0.1
2020
hooks:
2121
- id: trailing-whitespace
2222
- id: end-of-file-fixer

CONTRIBUTING.rst

+9-14
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,12 @@ Using ``nox``
6868
We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.
6969

7070
- To test your changes, run unit tests with ``nox``::
71+
$ nox -s unit
7172

72-
$ nox -s unit-2.7
73-
$ nox -s unit-3.8
74-
$ ...
73+
- To run a single unit test::
7574

76-
- Args to pytest can be passed through the nox command separated by a `--`. For
77-
example, to run a single test::
75+
$ nox -s unit-3.9 -- -k <name of test>
7876

79-
$ nox -s unit-3.8 -- -k <name of test>
8077

8178
.. note::
8279

@@ -143,18 +140,16 @@ Running System Tests
143140
- To run system tests, you can execute::
144141

145142
# Run all system tests
146-
$ nox -s system-3.8
147-
$ nox -s system-2.7
143+
$ nox -s system
148144

149145
# Run a single system test
150-
$ nox -s system-3.8 -- -k <name of test>
146+
$ nox -s system-3.9 -- -k <name of test>
151147

152148

153149
.. note::
154150

155-
System tests are only configured to run under Python 2.7 and
156-
Python 3.8. For expediency, we do not run them in older versions
157-
of Python 3.
151+
System tests are only configured to run under Python 3.8 and 3.9.
152+
For expediency, we do not run them in older versions of Python 3.
158153

159154
This alone will not run the tests. You'll need to change some local
160155
auth settings and change some configuration in your project to
@@ -218,8 +213,8 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
218213
.. _config: https://github.com/googleapis/python-bigquery-sqlalchemy/blob/master/noxfile.py
219214

220215

221-
We also explicitly decided to support Python 3 beginning with version
222-
3.6. Reasons for this include:
216+
We also explicitly decided to support Python 3 beginning with version 3.6.
217+
Reasons for this include:
223218

224219
- Encouraging use of newest versions of Python 3
225220
- Taking the lead of `prominent`_ open-source `projects`_

0 commit comments

Comments
 (0)