Skip to content

Commit 76f4daa

Browse files
authored
chore: release 0.2.0 (#6)
* chore: release 0.2.0 Change-Id: Id9f7843e3c5238e82a2514b5f9b81d7335460c6e * Update CHANGELOG Change-Id: Ic77a9acfdbffe3bf97103d164f606f85fc9fe4db
1 parent 3e143d7 commit 76f4daa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3883
-924
lines changed

.kokoro/docker/docs/Dockerfile

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from ubuntu:22.04
16+
17+
ENV DEBIAN_FRONTEND noninteractive
18+
19+
# Ensure local Python is preferred over distribution Python.
20+
ENV PATH /usr/local/bin:$PATH
21+
22+
# Install dependencies.
23+
RUN apt-get update \
24+
&& apt-get install -y --no-install-recommends \
25+
apt-transport-https \
26+
build-essential \
27+
ca-certificates \
28+
curl \
29+
dirmngr \
30+
git \
31+
gpg-agent \
32+
graphviz \
33+
libbz2-dev \
34+
libdb5.3-dev \
35+
libexpat1-dev \
36+
libffi-dev \
37+
liblzma-dev \
38+
libreadline-dev \
39+
libsnappy-dev \
40+
libssl-dev \
41+
libsqlite3-dev \
42+
portaudio19-dev \
43+
python3-distutils \
44+
redis-server \
45+
software-properties-common \
46+
ssh \
47+
sudo \
48+
tcl \
49+
tcl-dev \
50+
tk \
51+
tk-dev \
52+
uuid-dev \
53+
wget \
54+
zlib1g-dev \
55+
&& add-apt-repository universe \
56+
&& apt-get update \
57+
&& apt-get -y install jq \
58+
&& apt-get clean autoclean \
59+
&& apt-get autoremove -y \
60+
&& rm -rf /var/lib/apt/lists/* \
61+
&& rm -f /var/cache/apt/archives/*.deb
62+
63+
###################### Install python 3.9.13 and 3.10.5
64+
65+
# Download python 3.9.13 and 3.10.5
66+
RUN wget https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tgz
67+
RUN wget https://www.python.org/ftp/python/3.9.13/Python-3.10.5.tgz
68+
69+
# Extract files
70+
RUN tar -xvf Python-3.9.13.tgz
71+
RUN tar -xvf Python-3.10.5.tgz
72+
73+
# Install python 3.9.13 and 3.10.5
74+
RUN ./Python-3.9.13/configure --enable-optimizations
75+
RUN ./Python-3.10.5/configure --enable-optimizations
76+
RUN make altinstall
77+
78+
###################### Install pip
79+
RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
80+
&& python3 /tmp/get-pip.py \
81+
&& rm /tmp/get-pip.py
82+
83+
# Test pip
84+
RUN python3 -m pip
85+
RUN python3.9 -m pip
86+
RUN python3.10 -m pip
87+
88+
CMD ["python3.10"]

.kokoro/docker/docs/fetch_gpg_keys.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
# Copyright 2023 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# A script to fetch gpg keys with retry.
17+
# Avoid jinja parsing the file.
18+
#
19+
20+
function retry {
21+
if [[ "${#}" -le 1 ]]; then
22+
echo "Usage: ${0} retry_count commands.."
23+
exit 1
24+
fi
25+
local retries=${1}
26+
local command="${@:2}"
27+
until [[ "${retries}" -le 0 ]]; do
28+
$command && return 0
29+
if [[ $? -ne 0 ]]; then
30+
echo "command failed, retrying"
31+
((retries--))
32+
fi
33+
done
34+
return 1
35+
}
36+
37+
# 3.6.9, 3.7.5 (Ned Deily)
38+
retry 3 gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \
39+
0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
40+
41+
# 3.8.0 (Łukasz Langa)
42+
retry 3 gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \
43+
E3FF2839C048B25C084DEBE9B26995E310250568
44+
45+
#

.kokoro/docs/common.cfg

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
# Download trampoline resources.
11+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
12+
13+
# Use the trampoline script to run in docker.
14+
build_file: "python-bigquery-dataframes/.kokoro/trampoline_v2.sh"
15+
16+
# Configure the docker image for kokoro-trampoline.
17+
env_vars: {
18+
key: "TRAMPOLINE_IMAGE"
19+
value: "gcr.io/cloud-devrel-kokoro-resources/python-lib-docs"
20+
}
21+
env_vars: {
22+
key: "TRAMPOLINE_BUILD_FILE"
23+
value: "github/python-bigquery-dataframes/.kokoro/publish-docs.sh"
24+
}
25+
26+
env_vars: {
27+
key: "V2_STAGING_BUCKET"
28+
# Push google cloud library docs to the Cloud RAD bucket `docs-staging-v2`
29+
value: "docs-staging-v2"
30+
}
31+
32+
# It will upload the docker image after successful builds.
33+
env_vars: {
34+
key: "TRAMPOLINE_IMAGE_UPLOAD"
35+
value: "true"
36+
}
37+
38+
# It will always build the docker image.
39+
env_vars: {
40+
key: "TRAMPOLINE_DOCKERFILE"
41+
value: ".kokoro/docker/docs/Dockerfile"
42+
}
43+
44+
# Fetch the token needed for reporting release status to GitHub
45+
before_action {
46+
fetch_keystore {
47+
keystore_resource {
48+
keystore_config_id: 73713
49+
keyname: "yoshi-automation-github-key"
50+
}
51+
}
52+
}
53+
54+
before_action {
55+
fetch_keystore {
56+
keystore_resource {
57+
keystore_config_id: 73713
58+
keyname: "docuploader_service_account"
59+
}
60+
}
61+
}

.kokoro/docs/docs-presubmit.cfg

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "V2_STAGING_BUCKET"
5+
value: "gcloud-python-test"
6+
}
7+
8+
# We only upload the image in the main `docs` build.
9+
env_vars: {
10+
key: "TRAMPOLINE_IMAGE_UPLOAD"
11+
value: "false"
12+
}
13+
14+
env_vars: {
15+
key: "TRAMPOLINE_BUILD_FILE"
16+
value: "github/python-bigquery-dataframes/.kokoro/build.sh"
17+
}
18+
19+
# Only run this nox session.
20+
env_vars: {
21+
key: "NOX_SESSION"
22+
value: "docfx"
23+
}

.kokoro/docs/docs.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto

.kokoro/publish-docs.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
# Copyright 2023 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
18+
# Disable buffering, so that the logs stream through.
19+
export PYTHONUNBUFFERED=1
20+
21+
export PATH="${HOME}/.local/bin:${PATH}"
22+
23+
# Install nox
24+
python3 -m pip install --require-hashes -r .kokoro/requirements.txt
25+
python3 -m nox --version
26+
27+
# docfx yaml files
28+
nox -s docfx
29+
30+
# create metadata.
31+
python3 -m docuploader create-metadata \
32+
--name=$(jq --raw-output '.name // empty' .repo-metadata.json) \
33+
--version=$(python3 setup.py --version) \
34+
--language=$(jq --raw-output '.language // empty' .repo-metadata.json) \
35+
--distribution-name=$(python3 setup.py --name) \
36+
--product-page=$(jq --raw-output '.product_documentation // empty' .repo-metadata.json) \
37+
--github-repository=$(jq --raw-output '.repo // empty' .repo-metadata.json) \
38+
--issue-tracker=$(jq --raw-output '.issue_tracker // empty' .repo-metadata.json)
39+
40+
cat docs.metadata
41+
42+
# Replace toc.yml template file
43+
mv docs/templates/toc.yml docs/_build/html/docfx_yaml/toc.yml
44+
45+
# upload docs
46+
python3 -m docuploader upload docs/_build/html/docfx_yaml --metadata-file docs.metadata --destination-prefix docfx --staging-bucket "${V2_STAGING_BUCKET}"

0 commit comments

Comments
 (0)