Skip to content

Commit 1342d1c

Browse files
authored
Update autoflake to 1.7.5 (#247)
1 parent 2d15608 commit 1342d1c

File tree

4 files changed

+19
-25
lines changed

4 files changed

+19
-25
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ See [LICENSE][LICENSE_FILE] for the full license text.
138138
[pri]: https://github.com/asottile/reorder_python_imports
139139
[pyu]: https://github.com/asottile/pyupgrade
140140
[isort]: https://github.com/PyCQA/isort
141-
[autoflake]: https://github.com/myint/autoflake
141+
[autoflake]: https://github.com/PyCQA/autoflake
142142
[black]: https://github.com/psf/black
143143
[PEP585]: https://www.python.org/dev/peps/pep-0585/
144144
[PEP604]: https://www.python.org/dev/peps/pep-0604/

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ classifiers = [
2121
requires-python = ">=3.8"
2222
dependencies = [
2323
"aiofiles==22.1.0",
24-
# Custom autoflake version to parse 3.10 syntax
25-
"autoflake @ git+https://github.com/cdce8p/[email protected]",
24+
"autoflake==1.7.5",
2625
"isort==5.10.1",
2726
"pyupgrade==3.1.0",
2827
"reorder-python-imports==3.8.5",

python_typing_update/main.py

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -71,29 +71,24 @@ async def typing_update(
7171
return 2, filename
7272

7373
# Check for unused imports (autoflake)
74-
try:
75-
await loop.run_in_executor(
76-
None, autoflake_partial,
77-
[None, '-c', filename],
78-
)
79-
if (
80-
args.keep_updates is False
81-
and args.full_reorder is False
82-
and FileStatus.COMMENT_TYPING not in file_status
83-
):
84-
# -> No unused imports, revert changes
85-
return 2, filename
86-
except SystemExit:
87-
pass
74+
status_autoflake = await loop.run_in_executor(
75+
None, autoflake_partial,
76+
[None, '-c', filename],
77+
)
78+
if (
79+
status_autoflake == 0
80+
and args.keep_updates is False
81+
and args.full_reorder is False
82+
and FileStatus.COMMENT_TYPING not in file_status
83+
):
84+
# -> No unused imports, revert changes
85+
return 2, filename
8886

8987
# Remove unused imports (autoflake)
90-
try:
91-
await loop.run_in_executor(
92-
None, autoflake_partial,
93-
[None, '-i', filename],
94-
)
95-
except SystemExit:
96-
pass
88+
await loop.run_in_executor(
89+
None, autoflake_partial,
90+
[None, '-i', filename],
91+
)
9792

9893
# Run isort
9994
try:

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
aiofiles==22.1.0
2-
autoflake @ git+https://github.com/cdce8p/[email protected]
2+
autoflake==1.7.5
33
isort==5.10.1
44
pyupgrade==3.1.0
55
reorder-python-imports==3.8.5

0 commit comments

Comments
 (0)