Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to isort 4.3.4. #6166

Merged
merged 1 commit into from
Jul 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion 3rdparty/python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ fasteners==0.14.1
faulthandler==2.6
future==0.16.0
futures==3.0.5
isort==4.2.5
Markdown==2.1.1
mock==2.0.0
packaging==16.8
Expand Down
7 changes: 0 additions & 7 deletions contrib/python/src/python/pants/contrib/python/isort/BUILD

This file was deleted.

15 changes: 0 additions & 15 deletions contrib/python/src/python/pants/contrib/python/isort/isort.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/python/pants/backend/python/subsystems/isort.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class Isort(Script):
options_scope = 'isort'
default_version = '4.2.5'
default_version = '4.3.4'
suffix = '.pex'

replaces_scope = 'fmt.isort'
Expand Down
8 changes: 2 additions & 6 deletions src/python/pants/backend/python/tasks/python_isort.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@
class IsortPythonTask(FmtTaskMixin, Task):
"""Autoformats Python source files with isort.

isort binary is built at contrib/python/src/python/pants/contrib/python/isort,
then uploaded to
https://github.com/pantsbuild/binaries/tree/gh-pages/build-support/scripts

TODO: Explain why we don't invoke isort directly.

Behavior:
./pants fmt.isort <targets> -- <args, e.g. "--recursive ."> will sort the files only related
to specified targets, but the way of finding the config(s) is vanilla. If no target is
Expand Down Expand Up @@ -58,6 +52,8 @@ def execute(self, test_output_file=None):
cmd = [isort_script] + self.get_passthru_args() + sources
logging.debug(' '.join(cmd))

# NB: We execute isort out of process to avoid unwanted side-effects from importing it:
# https://github.com/timothycrosley/isort/issues/456
try:
subprocess.check_call(cmd, cwd=get_buildroot(),
stderr=test_output_file, stdout=test_output_file)
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/util/netrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import collections
import os
from builtins import object
from netrc import netrc as NetrcDb
from netrc import NetrcParseError
from netrc import netrc as NetrcDb


class Netrc(object):
Expand Down