Skip to content

Commit

Permalink
use autopep8 to automatically fix (some) flake8 failures; get rid of …
Browse files Browse the repository at this point in the history
…old handmade script

Signed-off-by: Giampaolo Rodola <[email protected]>
  • Loading branch information
giampaolo committed Apr 6, 2022
1 parent 3b52ce5 commit 48a036c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 191 deletions.
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ include scripts/internal/clinter.py
include scripts/internal/convert_readme.py
include scripts/internal/download_wheels_appveyor.py
include scripts/internal/download_wheels_github.py
include scripts/internal/fix_flake8.py
include scripts/internal/generate_manifest.py
include scripts/internal/git_pre_commit.py
include scripts/internal/print_access_denied.py
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ TSCRIPT = psutil/tests/runner.py
# Internal.
DEPS = \
argparse \
autopep8 \
check-manifest \
concurrencytest \
coverage \
Expand Down Expand Up @@ -206,8 +207,8 @@ lint: ## Run all linters
# Fixers
# ===================================================================

fix-flake8: ## Attempt to automatically fix some Python flake8 issues.
@git ls-files | grep \\.py$ | xargs $(PYTHON) -m flake8 --exit-zero | $(PYTHON) scripts/internal/fix_flake8.py
fix-flake8: ## Run autopep8, fix some Python flake8 / pep8 issues.
@git ls-files | grep \\.py$ | xargs $(PYTHON) -m autopep8 --in-place --jobs 0 --global-config=.flake8

fix-imports: ## Fix imports with isort.
@git ls-files '*.py' | xargs $(PYTHON) -m isort --settings=.isort.cfg
Expand Down
6 changes: 3 additions & 3 deletions psutil/tests/test_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ def get_ipv6_addresses(ifname):
fields = line.split()
if fields[-1] == ifname:
all_fields.append(fields)
if len(all_fields) ==0:

if len(all_fields) == 0:
raise ValueError("could not find interface %r" % ifname)

for i in range(0, len(all_fields)):
Expand Down Expand Up @@ -956,7 +956,7 @@ def test_ips(self):
# of the network interface.
address = addr.address.split('%')[0]
self.assertIn(address, get_ipv6_addresses(name))

# XXX - not reliable when having virtual NICs installed by Docker.
# @unittest.skipIf(not which('ip'), "'ip' utility not available")
# def test_net_if_names(self):
Expand Down
185 changes: 0 additions & 185 deletions scripts/internal/fix_flake8.py

This file was deleted.

0 comments on commit 48a036c

Please sign in to comment.