Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,17 @@ replacements:
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff",
"check",
"--select",
"I",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

# 2. Check formatting
session.run(
"ruff",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,17 @@ replacements:
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff",
"check",
"--select",
"I",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

# 2. Check formatting
session.run(
"ruff",
Expand Down
11 changes: 11 additions & 0 deletions packages/django-google-spanner/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ def lint(session):
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff",
"check",
"--select",
"I",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

# 2. Check formatting
session.run(
"ruff",
Expand Down
9 changes: 9 additions & 0 deletions packages/gapic-generator/gapic/templates/noxfile.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ def lint(session):
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff", "check",
"--select", "I",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

# 2. Check formatting
session.run(
"ruff", "format",
Expand Down
11 changes: 11 additions & 0 deletions packages/gapic-generator/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,17 @@ def lint(session):

session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff",
"check",
"--select",
"I",
*LINT_PATHS,
"--exclude",
RUFF_EXCLUDES,
)

# 2. Check formatting
session.run(
"ruff",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ def lint(session):
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff", "check",
"--select", "I",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

# 2. Check formatting
session.run(
"ruff", "format",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ def lint(session):
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff", "check",
"--select", "I",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

# 2. Check formatting
session.run(
"ruff", "format",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ def lint(session):
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff", "check",
"--select", "I",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

# 2. Check formatting
session.run(
"ruff", "format",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ def lint(session):
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff", "check",
"--select", "I",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

# 2. Check formatting
session.run(
"ruff", "format",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ def lint(session):
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff", "check",
"--select", "I",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

# 2. Check formatting
session.run(
"ruff", "format",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ def lint(session):
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff", "check",
"--select", "I",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

# 2. Check formatting
session.run(
"ruff", "format",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ def lint(session):
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff", "check",
"--select", "I",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

# 2. Check formatting
session.run(
"ruff", "format",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ def lint(session):
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff", "check",
"--select", "I",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

# 2. Check formatting
session.run(
"ruff", "format",
Expand Down
11 changes: 11 additions & 0 deletions packages/gcp-sphinx-docfx-yaml/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,17 @@ def lint(session):
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff",
"check",
"--select",
"I",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88",
".",
)

# 2. Check formatting
session.run(
"ruff",
Expand Down
3 changes: 2 additions & 1 deletion packages/google-api-core/google/api_core/rest_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
import operator
from typing import Any, Dict, List, Optional, Tuple

from google.api_core import path_template
from google.protobuf import json_format

from google.api_core import path_template

__all__ = ["flatten_query_params", "transcode", "transcode_request"]


Expand Down
12 changes: 12 additions & 0 deletions packages/google-api-core/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ def lint(session):
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff",
"check",
"--select",
"I",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

# 2. Check formatting
session.run(
"ruff",
"format",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import pytest

from google.api_core import _feature_gating_helpers
from google.api_core._feature_gating_helpers import (
FeatureGatingError,
Expand Down
2 changes: 1 addition & 1 deletion packages/google-api-core/tests/unit/test_rest_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
from unittest import mock

import pytest
from google.protobuf import descriptor_pb2

from google.api_core import rest_helpers
from google.api_core.rest_helpers import transcode_request
from google.protobuf import descriptor_pb2


def test_flatten_simple_value():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1596,9 +1596,10 @@ async def test_call_metadata(self, include_app_profile, fn_name, fn_args, gapic_
# incomplete mutation, so an empty mock stream would retry until the
# operation timeout. Return a success entry for the single mutation
# so the operation completes after a single attempt.
from google.cloud.bigtable_v2.types import MutateRowsResponse
from google.rpc import status_pb2

from google.cloud.bigtable_v2.types import MutateRowsResponse

@CrossSync.convert
async def mutate_rows_stream(*args, **kwargs):
yield MutateRowsResponse(
Expand Down
11 changes: 11 additions & 0 deletions packages/google-cloud-ndb/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,17 @@ def lint(session):
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff",
"check",
"--select",
"I",
f"--target-version=py{ALL_INTERPRETERS[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

# 2. Check formatting
session.run(
"ruff",
Expand Down
11 changes: 11 additions & 0 deletions packages/google-cloud-spanner-dbapi-driver/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,17 @@ def lint(session):
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff",
"check",
"--select",
"I",
f"--target-version=py{DEFAULT_PYTHON_VERSION.replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

# 2. Check formatting
session.run(
"ruff",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""Helper functions for system tests."""

import os

import pytest

SPANNER_EMULATOR_HOST = os.environ.get("SPANNER_EMULATOR_HOST")
Expand Down
11 changes: 11 additions & 0 deletions packages/google-cloud-storage/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,17 @@ def lint(session):
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff",
"check",
"--select",
"I",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

# 2. Check formatting
session.run(
"ruff",
Expand Down
11 changes: 11 additions & 0 deletions packages/sqlalchemy-spanner/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,17 @@ def lint(session):
"""
session.install("flake8", RUFF_VERSION)

# 1. Check imports
session.run(
"ruff",
"check",
"--select",
"I",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88",
*LINT_PATHS,
)

# 2. Check formatting
session.run(
"ruff",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

from sqlalchemy import types
from sqlalchemy.testing import eq_, fixtures
from google.cloud.sqlalchemy_spanner.sqlalchemy_spanner import _type_map, SpannerDialect

from google.cloud.sqlalchemy_spanner.sqlalchemy_spanner import SpannerDialect, _type_map


class TokenlistTest(fixtures.TestBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

from uuid import UUID


from google.cloud.spanner_v1 import TypeCode
from sqlalchemy import Column, MetaData, Table, select, types
from sqlalchemy.orm import DeclarativeBase, Mapped, Session, mapped_column
Expand Down
Loading
Loading