Skip to content

Commit

Permalink
Merge branch 'main' into fileio-closed-property
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsg committed Dec 6, 2022
2 parents 427cfb2 + 1ca0233 commit c7c708e
Show file tree
Hide file tree
Showing 8 changed files with 215 additions and 196 deletions.
2 changes: 1 addition & 1 deletion .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:7a40313731a7cb1454eef6b33d3446ebb121836738dc3ab3d2d3ded5268c35b6
digest: sha256:3abfa0f1886adaf0b83f07cb117b24a639ea1cb9cffe56d43280b977033563eb
12 changes: 6 additions & 6 deletions .kokoro/docker/docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /var/cache/apt/archives/*.deb

###################### Install python 3.8.11
###################### Install python 3.9.13

# Download python 3.8.11
RUN wget https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tgz
# Download python 3.9.13
RUN wget https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tgz

# Extract files
RUN tar -xvf Python-3.8.11.tgz
RUN tar -xvf Python-3.9.13.tgz

# Install python 3.8.11
RUN ./Python-3.8.11/configure --enable-optimizations
# Install python 3.9.13
RUN ./Python-3.9.13/configure --enable-optimizations
RUN make altinstall

###################### Install pip
Expand Down
4 changes: 3 additions & 1 deletion .kokoro/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ typing-extensions
twine
wheel
setuptools
nox
nox
charset-normalizer<3
click<8.1.0
354 changes: 193 additions & 161 deletions .kokoro/requirements.txt

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def default(session):
session.run(
"py.test",
"--quiet",
f"--junitxml=unit_{session.python}_sponge_log.xml",
"--cov=google.cloud.storage",
"--cov=google.cloud",
"--cov=tests.unit",
Expand Down Expand Up @@ -161,6 +162,7 @@ def system(session):
session.run(
"py.test",
"--quiet",
f"--junitxml=system_{session.python}_sponge_log.xml",
"--reruns={}".format(rerun_count),
system_test_path,
*session.posargs,
Expand All @@ -169,6 +171,7 @@ def system(session):
session.run(
"py.test",
"--quiet",
f"--junitxml=system_{session.python}_sponge_log.xml",
"--reruns={}".format(rerun_count),
system_test_folder_path,
*session.posargs,
Expand Down Expand Up @@ -217,7 +220,7 @@ def cover(session):
session.run("coverage", "erase")


@nox.session(python=DEFAULT_PYTHON_VERSION)
@nox.session(python="3.9")
def docs(session):
"""Build the docs for this library."""

Expand All @@ -239,7 +242,7 @@ def docs(session):
)


@nox.session(python=DEFAULT_PYTHON_VERSION)
@nox.session(python="3.9")
def docfx(session):
"""Build the docfx yaml files for this library."""

Expand Down
26 changes: 3 additions & 23 deletions samples/snippets/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import os
from pathlib import Path
import sys
from typing import Callable, Dict, List, Optional
from typing import Callable, Dict, Optional

import nox

Expand Down Expand Up @@ -109,22 +109,6 @@ def get_pytest_env_vars() -> Dict[str, str]:
#


def _determine_local_import_names(start_dir: str) -> List[str]:
"""Determines all import names that should be considered "local".
This is used when running the linter to insure that import order is
properly checked.
"""
file_ext_pairs = [os.path.splitext(path) for path in os.listdir(start_dir)]
return [
basename
for basename, extension in file_ext_pairs
if extension == ".py"
or os.path.isdir(os.path.join(start_dir, basename))
and basename not in ("__pycache__")
]


# Linting with flake8.
#
# We ignore the following rules:
Expand All @@ -139,7 +123,6 @@ def _determine_local_import_names(start_dir: str) -> List[str]:
"--show-source",
"--builtin=gettext",
"--max-complexity=20",
"--import-order-style=google",
"--exclude=.nox,.cache,env,lib,generated_pb2,*_pb2.py,*_pb2_grpc.py",
"--ignore=E121,E123,E126,E203,E226,E24,E266,E501,E704,W503,W504,I202",
"--max-line-length=88",
Expand All @@ -149,14 +132,11 @@ def _determine_local_import_names(start_dir: str) -> List[str]:
@nox.session
def lint(session: nox.sessions.Session) -> None:
if not TEST_CONFIG["enforce_type_hints"]:
session.install("flake8", "flake8-import-order")
session.install("flake8")
else:
session.install("flake8", "flake8-import-order", "flake8-annotations")
session.install("flake8", "flake8-annotations")

local_names = _determine_local_import_names(".")
args = FLAKE8_COMMON_ARGS + [
"--application-import-names",
",".join(local_names),
".",
]
session.run("flake8", *args)
Expand Down
2 changes: 1 addition & 1 deletion samples/snippets/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
google-cloud-pubsub==2.13.11
google-cloud-storage==2.6.0
pandas===1.3.5; python_version == '3.7'
pandas==1.5.1; python_version >= '3.8'
pandas==1.5.2; python_version >= '3.8'
4 changes: 3 additions & 1 deletion tests/system/test_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ def test_bucket_w_retention_period(
buckets_to_delete,
blobs_to_delete,
):
period_secs = 10
period_secs = 3
bucket_name = _helpers.unique_name("w-retention-period")
bucket = _helpers.retry_429_503(storage_client.create_bucket)(bucket_name)
buckets_to_delete.append(bucket)
Expand Down Expand Up @@ -679,6 +679,8 @@ def test_bucket_w_retention_period(
assert not other.temporary_hold
assert other.retention_expiration_time is None

# Object can be deleted once it reaches the age defined in the retention policy.
_helpers.await_config_changes_propagate(sec=period_secs)
other.delete()
blobs_to_delete.pop()

Expand Down

0 comments on commit c7c708e

Please sign in to comment.