Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: googleapis/python-storage
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.30.0
Choose a base ref
...
head repository: googleapis/python-storage
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.31.0
Choose a head ref
  • 19 commits
  • 21 files changed
  • 7 contributors

Commits on Jul 29, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4ed5666 View commit details
  2. tests: fix system tests (#219)

    Co-authored-by: Tres Seaver <tseaver@palladion.com>
    HemangChothani and tseaver authored Jul 29, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e089b28 View commit details

Commits on Aug 5, 2020

  1. testing: fix / skip systests broken by dependency releases (#227)

    See #226.  This PR doesn't *fix* the issue, because the KMS breakage
    still exists:  it just skips the KMS systests under Python3, until we have
    dropped support for Python2.
    tseaver authored Aug 5, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9895bdf View commit details
  2. docs: update docs build (via synth) (#222)

    * migrate to Trampoline V2
    * add docs-presubmit job
    * create docfx yaml files and upload them to another bucket
    
    Source-Author: Takashi Matsuo <tmatsuo@google.com>
    Source-Date: Thu Jul 30 18:26:35 2020 -0700
    Source-Repo: googleapis/synthtool
    Source-Sha: 39b527a39f5cd56d4882b3874fc08eed4756cebe
    Source-Link: googleapis/synthtool@39b527a
    
    Source-Author: Takashi Matsuo <tmatsuo@google.com>
    Source-Date: Fri Jul 31 16:17:13 2020 -0700
    Source-Repo: googleapis/synthtool
    Source-Sha: bfcdbe0da977b2de6c1c0471bb6dc2f1e13bf669
    Source-Link: googleapis/synthtool@bfcdbe0
    
    Co-authored-by: Tres Seaver <tseaver@palladion.com>
    yoshi-automation and tseaver authored Aug 5, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4c5adfa View commit details
  3. feat: pass 'client_options' to base class ctor (#225)

    packaging: pin 'google-cloud-core >= 1.4.0'
    
    Closes #210
    tseaver authored Aug 5, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e1f91fc View commit details

Commits on Aug 10, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e8a8638 View commit details
  2. feat: rename 'Blob.download_as_{string,bytes}', add 'Blob.download_as…

    …_text' (#182)
    
    Leave 'Blob.download_as_string' as a deprecated alias for 'download_as_bytes'.
    
    Co-authored-by: Tres Seaver <tseaver@palladion.com>
    HemangChothani and tseaver authored Aug 10, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    73107c3 View commit details

Commits on Aug 11, 2020

  1. chore(py_library): add some excludes in docs/conf.py (#233)

    This should fix build failures in python-bigquery.
    Example:
    googleapis/python-bigquery#205
    
    Source-Author: Takashi Matsuo <tmatsuo@google.com>
    Source-Date: Mon Aug 3 15:08:00 2020 -0700
    Source-Repo: googleapis/synthtool
    Source-Sha: 4f8f5dc24af79694887385015294e4dbb214c352
    Source-Link: googleapis/synthtool@4f8f5dc
    
    Co-authored-by: Tres Seaver <tseaver@palladion.com>
    yoshi-automation and tseaver authored Aug 11, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3514132 View commit details

Commits on Aug 13, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    acea15b View commit details

Commits on Aug 14, 2020

  1. fix: extract hashes correctly during download (#238)

    Co-authored-by: Tres Seaver <tseaver@palladion.com>
    HemangChothani and tseaver authored Aug 14, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    23cfb65 View commit details

Commits on Aug 17, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cd95200 View commit details

Commits on Aug 24, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    413f7b5 View commit details

Commits on Aug 25, 2020

  1. feat(storage): add support of daysSinceNoncurrentTime and noncurrentT…

    …imeBefore (#162)
    
    * feat(storage): add support of daysSinceNoncurrentTime and noncurrentTimeBefore
    
    * feat(storage): fix code coverage
    
    * feat(storage): add custom method to convert datetime to string
    
    * feat(storage): remove custom method as server support microsec
    
    * feat(storage): change the return type of noncurrent_time_before
    
    * feat(storage): change non_current_time type from datetime to date
    
    * feat: nit
    
    Co-authored-by: Jonathan Lui <jonathanlui@google.com>
    Co-authored-by: Frank Natividad <frankyn@users.noreply.github.com>
    3 people authored Aug 25, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    136c097 View commit details
  2. fix: change datetime.now to utcnow (#251)

    Fixes #228  🦕
    
    I think it's related to #244 issue so changed datetime.now() to datetime.utcnow()
    HemangChothani authored Aug 25, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3465d08 View commit details

Commits on Aug 26, 2020

  1. feat: error message return from api (#235)

    * feat(storage): error message retyrn from api
    
    * feat: add comment for clarification
    
    * fix: remove unknown error
    
    Co-authored-by: Tres Seaver <tseaver@palladion.com>
    Co-authored-by: Frank Natividad <frankyn@users.noreply.github.com>
    3 people authored Aug 26, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a8de586 View commit details
  2. feat: add support for 'Blob.custom_time' and lifecycle rules (#199)

    * feat(storage): add support of custom time metadata and timestamp
    
    * feat(storage): change the return type of custom_time_before
    
    * feat(storage): add setter method
    
    * feat(storage): add test for None value
    
    * feat(storage): changes in unittest
    
    * feat(storage): change custom_time type to date
    
    * feat: change custom_time to datetime
    
    * feat: nit
    
    Co-authored-by: Jonathan Lui <jonathanlui@google.com>
    Co-authored-by: Tres Seaver <tseaver@palladion.com>
    Co-authored-by: Frank Natividad <frankyn@users.noreply.github.com>
    4 people authored Aug 26, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    180873d View commit details
  3. feat: add configurable checksumming for blob uploads and downloads (#246

    )
    
    Co-authored-by: Tres Seaver <tseaver@palladion.com>
    Co-authored-by: Frank Natividad <frankyn@users.noreply.github.com>
    3 people authored Aug 26, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    23b7d1c View commit details
  4. fix: repair mal-formed docstring (#255)

    Co-authored-by: Frank Natividad <frankyn@users.noreply.github.com>
    tseaver and frankyn authored Aug 26, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e722376 View commit details
  5. chore: release 1.31.0 (#231)

    * chore: updated CHANGELOG.md [ci skip]
    
    * chore: updated setup.cfg [ci skip]
    
    * chore: updated setup.py
    
    Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
    release-please[bot] authored Aug 26, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    22eeb2f View commit details
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@ pip-log.txt
# Built documentation
docs/_build
bigquery/docs/generated
docs.metadata

# Virtual environment
env/
@@ -57,4 +58,4 @@ system_tests/local_test_setup

# Make sure a generated file isn't accidentally committed.
pylintrc
pylintrc.test
pylintrc.test
8 changes: 7 additions & 1 deletion .kokoro/build.sh
Original file line number Diff line number Diff line change
@@ -36,4 +36,10 @@ python3.6 -m pip uninstall --yes --quiet nox-automation
python3.6 -m pip install --upgrade --quiet nox
python3.6 -m nox --version

python3.6 -m nox
# If NOX_SESSION is set, it only runs the specified session,
# otherwise run all the sessions.
if [[ -n "${NOX_SESSION:-}" ]]; then
python3.6 -m nox -s "${NOX_SESSION:-}"
else
python3.6 -m nox
fi
98 changes: 98 additions & 0 deletions .kokoro/docker/docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ubuntu:20.04

ENV DEBIAN_FRONTEND noninteractive

# Ensure local Python is preferred over distribution Python.
ENV PATH /usr/local/bin:$PATH

# Install dependencies.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-transport-https \
build-essential \
ca-certificates \
curl \
dirmngr \
git \
gpg-agent \
graphviz \
libbz2-dev \
libdb5.3-dev \
libexpat1-dev \
libffi-dev \
liblzma-dev \
libreadline-dev \
libsnappy-dev \
libssl-dev \
libsqlite3-dev \
portaudio19-dev \
redis-server \
software-properties-common \
ssh \
sudo \
tcl \
tcl-dev \
tk \
tk-dev \
uuid-dev \
wget \
zlib1g-dev \
&& add-apt-repository universe \
&& apt-get update \
&& apt-get -y install jq \
&& apt-get clean autoclean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /var/cache/apt/archives/*.deb


COPY fetch_gpg_keys.sh /tmp
# Install the desired versions of Python.
RUN set -ex \
&& export GNUPGHOME="$(mktemp -d)" \
&& echo "disable-ipv6" >> "${GNUPGHOME}/dirmngr.conf" \
&& /tmp/fetch_gpg_keys.sh \
&& for PYTHON_VERSION in 3.7.8 3.8.5; do \
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" \
&& 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" \
&& gpg --batch --verify python-${PYTHON_VERSION}.tar.xz.asc python-${PYTHON_VERSION}.tar.xz \
&& rm -r python-${PYTHON_VERSION}.tar.xz.asc \
&& mkdir -p /usr/src/python-${PYTHON_VERSION} \
&& tar -xJC /usr/src/python-${PYTHON_VERSION} --strip-components=1 -f python-${PYTHON_VERSION}.tar.xz \
&& rm python-${PYTHON_VERSION}.tar.xz \
&& cd /usr/src/python-${PYTHON_VERSION} \
&& ./configure \
--enable-shared \
# This works only on Python 2.7 and throws a warning on every other
# version, but seems otherwise harmless.
--enable-unicode=ucs4 \
--with-system-ffi \
--without-ensurepip \
&& make -j$(nproc) \
&& make install \
&& ldconfig \
; done \
&& rm -rf "${GNUPGHOME}" \
&& rm -rf /usr/src/python* \
&& rm -rf ~/.cache/

RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
&& python3.7 /tmp/get-pip.py \
&& python3.8 /tmp/get-pip.py \
&& rm /tmp/get-pip.py

CMD ["python3.7"]
45 changes: 45 additions & 0 deletions .kokoro/docker/docs/fetch_gpg_keys.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# A script to fetch gpg keys with retry.
# Avoid jinja parsing the file.
#

function retry {
if [[ "${#}" -le 1 ]]; then
echo "Usage: ${0} retry_count commands.."
exit 1
fi
local retries=${1}
local command="${@:2}"
until [[ "${retries}" -le 0 ]]; do
$command && return 0
if [[ $? -ne 0 ]]; then
echo "command failed, retrying"
((retries--))
fi
done
return 1
}

# 3.6.9, 3.7.5 (Ned Deily)
retry 3 gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \
0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D

# 3.8.0 (Łukasz Langa)
retry 3 gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \
E3FF2839C048B25C084DEBE9B26995E310250568

#
21 changes: 19 additions & 2 deletions .kokoro/docs/common.cfg
Original file line number Diff line number Diff line change
@@ -11,12 +11,12 @@ action {
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "python-storage/.kokoro/trampoline.sh"
build_file: "python-storage/.kokoro/trampoline_v2.sh"

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/python-multi"
value: "gcr.io/cloud-devrel-kokoro-resources/python-lib-docs"
}
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
@@ -28,6 +28,23 @@ env_vars: {
value: "docs-staging"
}

env_vars: {
key: "V2_STAGING_BUCKET"
value: "docs-staging-v2-staging"
}

# It will upload the docker image after successful builds.
env_vars: {
key: "TRAMPOLINE_IMAGE_UPLOAD"
value: "true"
}

# It will always build the docker image.
env_vars: {
key: "TRAMPOLINE_DOCKERFILE"
value: ".kokoro/docker/docs/Dockerfile"
}

# Fetch the token needed for reporting release status to GitHub
before_action {
fetch_keystore {
17 changes: 17 additions & 0 deletions .kokoro/docs/docs-presubmit.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "STAGING_BUCKET"
value: "gcloud-python-test"
}

env_vars: {
key: "V2_STAGING_BUCKET"
value: "gcloud-python-test"
}

# We only upload the image in the main `docs` build.
env_vars: {
key: "TRAMPOLINE_IMAGE_UPLOAD"
value: "false"
}
39 changes: 24 additions & 15 deletions .kokoro/publish-docs.sh
Original file line number Diff line number Diff line change
@@ -18,26 +18,16 @@ set -eo pipefail
# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1

cd github/python-storage

# Remove old nox
python3.6 -m pip uninstall --yes --quiet nox-automation
export PATH="${HOME}/.local/bin:${PATH}"

# Install nox
python3.6 -m pip install --upgrade --quiet nox
python3.6 -m nox --version
python3 -m pip install --user --upgrade --quiet nox
python3 -m nox --version

# build docs
nox -s docs

python3 -m pip install gcp-docuploader

# install a json parser
sudo apt-get update
sudo apt-get -y install software-properties-common
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get -y install jq
python3 -m pip install --user gcp-docuploader

# create metadata
python3 -m docuploader create-metadata \
@@ -52,4 +42,23 @@ python3 -m docuploader create-metadata \
cat docs.metadata

# upload docs
python3 -m docuploader upload docs/_build/html --metadata-file docs.metadata --staging-bucket docs-staging
python3 -m docuploader upload docs/_build/html --metadata-file docs.metadata --staging-bucket "${STAGING_BUCKET}"


# docfx yaml files
nox -s docfx

# create metadata.
python3 -m docuploader create-metadata \
--name=$(jq --raw-output '.name // empty' .repo-metadata.json) \
--version=$(python3 setup.py --version) \
--language=$(jq --raw-output '.language // empty' .repo-metadata.json) \
--distribution-name=$(python3 setup.py --name) \
--product-page=$(jq --raw-output '.product_documentation // empty' .repo-metadata.json) \
--github-repository=$(jq --raw-output '.repo // empty' .repo-metadata.json) \
--issue-tracker=$(jq --raw-output '.issue_tracker // empty' .repo-metadata.json)

cat docs.metadata

# upload docs
python3 -m docuploader upload docs/_build/html/docfx_yaml --metadata-file docs.metadata --destination-prefix docfx --staging-bucket "${V2_STAGING_BUCKET}"
Loading