Skip to content

Commit

Permalink
Remove flynt dependency (#6205)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanujkhattar committed Jul 17, 2023
1 parent 344d020 commit edc820a
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 24 deletions.
13 changes: 2 additions & 11 deletions check/format-incremental
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
# Usage:
# check/format-incremental [BASE_REVISION] [--apply] [--all]
#
# By default, the script runs flynt to convert old string literal formatting to f-strings
# and analyzes python files that have changed relative to the
# By default, the script analyzes python files that have changed relative to the
# base revision and determines whether they need to be formatted. If any changes
# are needed, it prints the diff and exits with code 1, otherwise it exits with
# code 0.
Expand Down Expand Up @@ -95,14 +94,6 @@ if (( ${#format_files[@]} == 0 )); then
exit 0
fi

flynt_args=("--quiet" "-f")
if (( only_print == 1 )); then
flynt_args+=("--dry-run")
fi

flynt "${format_files[@]}" "${flynt_args[@]}"
FLYNTSTATUS=$?

BLACKVERSION="$(black --version)"

echo "Running the black formatter... (version: $BLACKVERSION)"
Expand All @@ -115,7 +106,7 @@ fi
black "${args[@]}" "${format_files[@]}"
BLACKSTATUS=$?

if [[ "$FLYNTSTATUS" != "0" || "$BLACKSTATUS" != "0" ]]; then
if [[ "$BLACKSTATUS" != "0" ]]; then
exit 1
fi
exit 0
8 changes: 1 addition & 7 deletions dev_tools/packaging/isolated_packages_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@
from dev_tools import shell_tools
from dev_tools.modules import list_modules

PACKAGES = [
"-r",
"dev_tools/requirements/deps/pytest.txt",
"-r",
# one of the _compat_test.py tests uses flynt for testing metadata
"dev_tools/requirements/deps/flynt.txt",
]
PACKAGES = ["-r", "dev_tools/requirements/deps/pytest.txt"]


@pytest.mark.slow
Expand Down
1 change: 0 additions & 1 deletion dev_tools/requirements/deps/flynt.txt

This file was deleted.

1 change: 0 additions & 1 deletion dev_tools/requirements/deps/format.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
-r flynt.txt
black==23.3.0
4 changes: 0 additions & 4 deletions dev_tools/requirements/pytest-minimal.env.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
-r deps/cirq-all-no-contrib.txt
-r deps/ipython.txt

# one of the _compat_test.py tests uses flynt for testing metadata

-r deps/flynt.txt

# pylint is needed for invoking custom checkers

-r deps/pylint.txt

0 comments on commit edc820a

Please sign in to comment.