From 4bbfab1f450c2ec1d489f18a0434f04c080cb3e0 Mon Sep 17 00:00:00 2001 From: Mariatta Wijaya Date: Thu, 24 Nov 2022 09:46:00 -0800 Subject: [PATCH 1/2] fix: Pin flake8 to v < 6.0.0 flake8 v 6.0.0 introduces backward incompatible change. flake8-import-order is broken because of it. Until there is an updated version of flake8-import-order, we will need to pin flake8 to v<6.0.0 --- synthtool/gcp/templates/python_samples/noxfile.py.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synthtool/gcp/templates/python_samples/noxfile.py.j2 b/synthtool/gcp/templates/python_samples/noxfile.py.j2 index 0398d72ff..777b98a3d 100644 --- a/synthtool/gcp/templates/python_samples/noxfile.py.j2 +++ b/synthtool/gcp/templates/python_samples/noxfile.py.j2 @@ -149,9 +149,9 @@ FLAKE8_COMMON_ARGS = [ @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<6.0.0", "flake8-import-order") else: - session.install("flake8", "flake8-import-order", "flake8-annotations") + session.install("flake8<6.0.0", "flake8-import-order", "flake8-annotations") local_names = _determine_local_import_names(".") args = FLAKE8_COMMON_ARGS + [ From 8c311c373515804e8c8a1c4aec9a92e4c626e883 Mon Sep 17 00:00:00 2001 From: Mariatta Wijaya Date: Thu, 24 Nov 2022 13:07:05 -0800 Subject: [PATCH 2/2] Remove flake8-import-order --- synthtool/gcp/templates/python_samples/noxfile.py.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synthtool/gcp/templates/python_samples/noxfile.py.j2 b/synthtool/gcp/templates/python_samples/noxfile.py.j2 index 777b98a3d..df72ebab8 100644 --- a/synthtool/gcp/templates/python_samples/noxfile.py.j2 +++ b/synthtool/gcp/templates/python_samples/noxfile.py.j2 @@ -149,9 +149,9 @@ FLAKE8_COMMON_ARGS = [ @nox.session def lint(session: nox.sessions.Session) -> None: if not TEST_CONFIG["enforce_type_hints"]: - session.install("flake8<6.0.0", "flake8-import-order") + session.install("flake8") else: - session.install("flake8<6.0.0", "flake8-import-order", "flake8-annotations") + session.install("flake8", "flake8-annotations") local_names = _determine_local_import_names(".") args = FLAKE8_COMMON_ARGS + [