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

Commit 98a7806

Browse files
changes without context
autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters.
1 parent 1163f2b commit 98a7806

File tree

13 files changed

+102
-107
lines changed

13 files changed

+102
-107
lines changed

.kokoro/docker/docs/Dockerfile

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ RUN apt-get update \
4040
libssl-dev \
4141
libsqlite3-dev \
4242
portaudio19-dev \
43+
python3-distutils \
4344
redis-server \
4445
software-properties-common \
4546
ssh \
@@ -59,40 +60,8 @@ RUN apt-get update \
5960
&& rm -rf /var/lib/apt/lists/* \
6061
&& rm -f /var/cache/apt/archives/*.deb
6162

62-
63-
COPY fetch_gpg_keys.sh /tmp
64-
# Install the desired versions of Python.
65-
RUN set -ex \
66-
&& export GNUPGHOME="$(mktemp -d)" \
67-
&& echo "disable-ipv6" >> "${GNUPGHOME}/dirmngr.conf" \
68-
&& /tmp/fetch_gpg_keys.sh \
69-
&& for PYTHON_VERSION in 3.7.8 3.8.5; do \
70-
wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
71-
&& wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
72-
&& gpg --batch --verify python-${PYTHON_VERSION}.tar.xz.asc python-${PYTHON_VERSION}.tar.xz \
73-
&& rm -r python-${PYTHON_VERSION}.tar.xz.asc \
74-
&& mkdir -p /usr/src/python-${PYTHON_VERSION} \
75-
&& tar -xJC /usr/src/python-${PYTHON_VERSION} --strip-components=1 -f python-${PYTHON_VERSION}.tar.xz \
76-
&& rm python-${PYTHON_VERSION}.tar.xz \
77-
&& cd /usr/src/python-${PYTHON_VERSION} \
78-
&& ./configure \
79-
--enable-shared \
80-
# This works only on Python 2.7 and throws a warning on every other
81-
# version, but seems otherwise harmless.
82-
--enable-unicode=ucs4 \
83-
--with-system-ffi \
84-
--without-ensurepip \
85-
&& make -j$(nproc) \
86-
&& make install \
87-
&& ldconfig \
88-
; done \
89-
&& rm -rf "${GNUPGHOME}" \
90-
&& rm -rf /usr/src/python* \
91-
&& rm -rf ~/.cache/
92-
9363
RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
94-
&& python3.7 /tmp/get-pip.py \
9564
&& python3.8 /tmp/get-pip.py \
9665
&& rm /tmp/get-pip.py
9766

98-
CMD ["python3.7"]
67+
CMD ["python3.8"]

.kokoro/docker/docs/fetch_gpg_keys.sh

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 40 additions & 0 deletions
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-compute/.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-compute/.kokoro/trampoline.sh"
Lines changed: 6 additions & 0 deletions
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+
}
Lines changed: 11 additions & 0 deletions
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+
}
Lines changed: 6 additions & 0 deletions
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+
}
Lines changed: 6 additions & 0 deletions
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+
}

.kokoro/test-samples-impl.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ set -eo pipefail
2020
# Enables `**` to include files nested inside sub-folders
2121
shopt -s globstar
2222

23-
# Exit early if samples directory doesn't exist
24-
if [ ! -d "./samples" ]; then
25-
echo "No tests run. `./samples` not found"
23+
# Exit early if samples don't exist
24+
if ! find samples -name 'requirements.txt' | grep -q .; then
25+
echo "No tests run. './samples/**/requirements.txt' not found"
2626
exit 0
2727
fi
2828

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 8 additions & 13 deletions
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
150146
$ nox -s system-3.8 -- -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.
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
@@ -242,8 +237,8 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
242237
.. _config: https://github.com/googleapis/python-compute/blob/master/noxfile.py
243238

244239

245-
We also explicitly decided to support Python 3 beginning with version
246-
3.6. Reasons for this include:
240+
We also explicitly decided to support Python 3 beginning with version 3.6.
241+
Reasons for this include:
247242

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

0 commit comments

Comments
 (0)