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

Commit 86e17b9

Browse files
chore(python): use ubuntu 22.04 in docs image (#86)
Source-Link: googleapis/synthtool@f15cc72 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd
1 parent 95819c5 commit 86e17b9

File tree

6 files changed

+48
-11
lines changed

6 files changed

+48
-11
lines changed

.github/.OwlBot.lock.yaml

Lines 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:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163
17-
# created: 2022-04-06T10:30:21.687684602Z
16+
digest: sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd
17+
# created: 2022-04-21T15:43:16.246106921Z

.kokoro/docker/docs/Dockerfile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from ubuntu:20.04
15+
from ubuntu:22.04
1616

1717
ENV DEBIAN_FRONTEND noninteractive
1818

@@ -60,8 +60,24 @@ RUN apt-get update \
6060
&& rm -rf /var/lib/apt/lists/* \
6161
&& rm -f /var/cache/apt/archives/*.deb
6262

63+
###################### Install python 3.8.11
64+
65+
# Download python 3.8.11
66+
RUN wget https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tgz
67+
68+
# Extract files
69+
RUN tar -xvf Python-3.8.11.tgz
70+
71+
# Install python 3.8.11
72+
RUN ./Python-3.8.11/configure --enable-optimizations
73+
RUN make altinstall
74+
75+
###################### Install pip
6376
RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
64-
&& python3.8 /tmp/get-pip.py \
77+
&& python3 /tmp/get-pip.py \
6578
&& rm /tmp/get-pip.py
6679

80+
# Test pip
81+
RUN python3 -m pip
82+
6783
CMD ["python3.8"]

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
# All configuration values have a default; values that are commented out
2525
# serve to show the default.
2626

27-
import sys
2827
import os
2928
import shlex
29+
import sys
3030

3131
# If extensions (or modules to document with autodoc) are in another directory,
3232
# add these directories to sys.path here. If the directory is relative to the

google/cloud/iam_logging_v1/types/audit_data.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
import proto # type: ignore
17-
1816
from google.iam.v1 import policy_pb2 # type: ignore
19-
17+
import proto # type: ignore
2018

2119
__protobuf__ = proto.module(
2220
package="google.iam.v1.logging",

noxfile.py

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# Generated by synthtool. DO NOT EDIT!
1818

1919
from __future__ import absolute_import
20+
2021
import os
2122
import pathlib
2223
import shutil
@@ -25,7 +26,8 @@
2526
import nox
2627

2728
BLACK_VERSION = "black==22.3.0"
28-
BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
29+
ISORT_VERSION = "isort==5.10.1"
30+
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
2931

3032
DEFAULT_PYTHON_VERSION = "3.8"
3133

@@ -83,7 +85,7 @@ def lint(session):
8385
session.run(
8486
"black",
8587
"--check",
86-
*BLACK_PATHS,
88+
*LINT_PATHS,
8789
)
8890
session.run("flake8", "google", "tests")
8991

@@ -94,7 +96,27 @@ def blacken(session):
9496
session.install(BLACK_VERSION)
9597
session.run(
9698
"black",
97-
*BLACK_PATHS,
99+
*LINT_PATHS,
100+
)
101+
102+
103+
@nox.session(python=DEFAULT_PYTHON_VERSION)
104+
def format(session):
105+
"""
106+
Run isort to sort imports. Then run black
107+
to format code to uniform standard.
108+
"""
109+
session.install(BLACK_VERSION, ISORT_VERSION)
110+
# Use the --fss option to sort imports using strict alphabetical order.
111+
# See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections
112+
session.run(
113+
"isort",
114+
"--fss",
115+
*LINT_PATHS,
116+
)
117+
session.run(
118+
"black",
119+
*LINT_PATHS,
98120
)
99121

100122

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#
1616
import io
1717
import os
18+
1819
import setuptools # type: ignore
1920

2021
version = "1.0.1"

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