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.

Commit d1b7fc0

Browse filesBrowse files
chore(python): drop flake8-import-order in samples noxfile [autoapprove] (#124)
Source-Link: https://togithub.com/googleapis/synthtool/commit/6ed3a831cb9ff69ef8a504c353e098ec0192ad93 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:3abfa0f1886adaf0b83f07cb117b24a639ea1cb9cffe56d43280b977033563eb
1 parent e5a9800 commit d1b7fc0
Copy full SHA for d1b7fc0

File tree

Expand file treeCollapse file tree

2 files changed

+4
-24
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+4
-24
lines changed

‎.github/.OwlBot.lock.yaml

Copy file name to clipboardExpand all lines: .github/.OwlBot.lock.yaml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# limitations under the License.
1414
docker:
1515
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
16-
digest: sha256:e6cbd61f1838d9ff6a31436dfc13717f372a7482a82fc1863ca954ec47bff8c8
16+
digest: sha256:3abfa0f1886adaf0b83f07cb117b24a639ea1cb9cffe56d43280b977033563eb

‎.kokoro/noxfile.py

Copy file name to clipboardExpand all lines: .kokoro/noxfile.py
+3-23Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import os
1919
from pathlib import Path
2020
import sys
21-
from typing import Callable, Dict, List, Optional
21+
from typing import Callable, Dict, Optional
2222

2323
import nox
2424

@@ -108,22 +108,6 @@ def get_pytest_env_vars() -> Dict[str, str]:
108108
#
109109

110110

111-
def _determine_local_import_names(start_dir: str) -> List[str]:
112-
"""Determines all import names that should be considered "local".
113-
114-
This is used when running the linter to insure that import order is
115-
properly checked.
116-
"""
117-
file_ext_pairs = [os.path.splitext(path) for path in os.listdir(start_dir)]
118-
return [
119-
basename
120-
for basename, extension in file_ext_pairs
121-
if extension == ".py"
122-
or os.path.isdir(os.path.join(start_dir, basename))
123-
and basename not in ("__pycache__")
124-
]
125-
126-
127111
# Linting with flake8.
128112
#
129113
# We ignore the following rules:
@@ -138,7 +122,6 @@ def _determine_local_import_names(start_dir: str) -> List[str]:
138122
"--show-source",
139123
"--builtin=gettext",
140124
"--max-complexity=20",
141-
"--import-order-style=google",
142125
"--exclude=.nox,.cache,env,lib,generated_pb2,*_pb2.py,*_pb2_grpc.py",
143126
"--ignore=E121,E123,E126,E203,E226,E24,E266,E501,E704,W503,W504,I202",
144127
"--max-line-length=88",
@@ -148,14 +131,11 @@ def _determine_local_import_names(start_dir: str) -> List[str]:
148131
@nox.session
149132
def lint(session: nox.sessions.Session) -> None:
150133
if not TEST_CONFIG["enforce_type_hints"]:
151-
session.install("flake8", "flake8-import-order")
134+
session.install("flake8")
152135
else:
153-
session.install("flake8", "flake8-import-order", "flake8-annotations")
136+
session.install("flake8", "flake8-annotations")
154137

155-
local_names = _determine_local_import_names(".")
156138
args = FLAKE8_COMMON_ARGS + [
157-
"--application-import-names",
158-
",".join(local_names),
159139
".",
160140
]
161141
session.run("flake8", *args)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.