Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

chore(python): add nox session to sort python imports #80

Merged
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
4 changes: 2 additions & 2 deletions 4 .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163
# created: 2022-04-06T10:30:21.687684602Z
digest: sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416
# created: 2022-04-20T23:42:53.970438194Z
2 changes: 1 addition & 1 deletion 2 docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import shlex
import sys

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down
18 changes: 9 additions & 9 deletions 18 google/cloud/source_context/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
#


from google.cloud.source_context_v1.types.source_context import AliasContext
from google.cloud.source_context_v1.types.source_context import CloudRepoSourceContext
from google.cloud.source_context_v1.types.source_context import CloudWorkspaceId
from google.cloud.source_context_v1.types.source_context import (
AliasContext,
CloudRepoSourceContext,
CloudWorkspaceId,
CloudWorkspaceSourceContext,
ExtendedSourceContext,
GerritSourceContext,
GitSourceContext,
ProjectRepoId,
RepoId,
SourceContext,
)
from google.cloud.source_context_v1.types.source_context import ExtendedSourceContext
from google.cloud.source_context_v1.types.source_context import GerritSourceContext
from google.cloud.source_context_v1.types.source_context import GitSourceContext
from google.cloud.source_context_v1.types.source_context import ProjectRepoId
from google.cloud.source_context_v1.types.source_context import RepoId
from google.cloud.source_context_v1.types.source_context import SourceContext

__all__ = (
"AliasContext",
Expand Down
22 changes: 12 additions & 10 deletions 22 google/cloud/source_context_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@
#


from .types.source_context import AliasContext
from .types.source_context import CloudRepoSourceContext
from .types.source_context import CloudWorkspaceId
from .types.source_context import CloudWorkspaceSourceContext
from .types.source_context import ExtendedSourceContext
from .types.source_context import GerritSourceContext
from .types.source_context import GitSourceContext
from .types.source_context import ProjectRepoId
from .types.source_context import RepoId
from .types.source_context import SourceContext
from .types.source_context import (
AliasContext,
CloudRepoSourceContext,
CloudWorkspaceId,
CloudWorkspaceSourceContext,
ExtendedSourceContext,
GerritSourceContext,
GitSourceContext,
ProjectRepoId,
RepoId,
SourceContext,
)

__all__ = (
"AliasContext",
Expand Down
1 change: 0 additions & 1 deletion 1 google/cloud/source_context_v1/types/source_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#
import proto # type: ignore


__protobuf__ = proto.module(
package="google.devtools.source.v1",
manifest={
Expand Down
28 changes: 25 additions & 3 deletions 28 noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# Generated by synthtool. DO NOT EDIT!

from __future__ import absolute_import

import os
import pathlib
import shutil
Expand All @@ -25,7 +26,8 @@
import nox

BLACK_VERSION = "black==22.3.0"
BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
ISORT_VERSION = "isort==5.10.1"
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]

DEFAULT_PYTHON_VERSION = "3.8"

Expand Down Expand Up @@ -83,7 +85,7 @@ def lint(session):
session.run(
"black",
"--check",
*BLACK_PATHS,
*LINT_PATHS,
)
session.run("flake8", "google", "tests")

Expand All @@ -94,7 +96,27 @@ def blacken(session):
session.install(BLACK_VERSION)
session.run(
"black",
*BLACK_PATHS,
*LINT_PATHS,
)


@nox.session(python=DEFAULT_PYTHON_VERSION)
def format(session):
"""
Run isort to sort imports. Then run black
to format code to uniform standard.
"""
session.install(BLACK_VERSION, ISORT_VERSION)
# Use the --fss option to sort imports using strict alphabetical order.
# See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections
session.run(
"isort",
"--fss",
*LINT_PATHS,
)
session.run(
"black",
*LINT_PATHS,
)


Expand Down
1 change: 0 additions & 1 deletion 1 setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import setuptools


name = "google-cloud-source-context"
description = "Python client for Source Context"
version = "1.2.2"
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.