Skip to content

Commit

Permalink
Run isort with new config
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrechevalier83 committed Sep 25, 2019
1 parent 767aa24 commit 6af958f
Show file tree
Hide file tree
Showing 102 changed files with 146 additions and 137 deletions.
3 changes: 2 additions & 1 deletion examples/src/python/example/tensorflow_custom_op/setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from setuptools import setup, find_packages
from setuptools import find_packages, setup


setup(
name='tensorflow_custom_op',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os

from pants.backend.jvm.ossrh_publication_metadata import (Developer, License,
OSSRHPublicationMetadata, Scm)
OSSRHPublicationMetadata, Scm,)
from pants.backend.jvm.repository import Repository
from pants.build_graph.build_file_aliases import BuildFileAliases

Expand Down
4 changes: 2 additions & 2 deletions src/python/pants/backend/codegen/thrift/python/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from pants.backend.codegen.thrift.python.apache_thrift_py_gen import ApacheThriftPyGen
from pants.backend.codegen.thrift.python.py_thrift_namespace_clash_check import \
PyThriftNamespaceClashCheck
from pants.backend.codegen.thrift.python.py_thrift_namespace_clash_check import (
PyThriftNamespaceClashCheck,)
from pants.backend.codegen.thrift.python.python_thrift_library import PythonThriftLibrary
from pants.build_graph.build_file_aliases import BuildFileAliases
from pants.goal.task_registrar import TaskRegistrar as task
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/jvm/ivy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from twitter.common.collections import OrderedSet

from pants.backend.jvm.subsystems.jar_dependency_management import (JarDependencyManagement,
PinnedJarArtifactSet)
PinnedJarArtifactSet,)
from pants.backend.jvm.targets.exportable_jvm_library import ExportableJvmLibrary
from pants.backend.jvm.targets.jar_library import JarLibrary
from pants.base.generator import Generator, TemplateData
Expand Down
6 changes: 3 additions & 3 deletions src/python/pants/backend/jvm/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from pants.backend.jvm.artifact import Artifact
from pants.backend.jvm.ossrh_publication_metadata import (Developer, License,
OSSRHPublicationMetadata, Scm)
OSSRHPublicationMetadata, Scm,)
from pants.backend.jvm.repository import Repository as repo
from pants.backend.jvm.scala_artifact import ScalaArtifact
from pants.backend.jvm.subsystems.jar_dependency_management import JarDependencyManagementSetup
Expand All @@ -22,7 +22,7 @@
from pants.backend.jvm.targets.jvm_binary import Duplicate, JarRules, JvmBinary, Skip
from pants.backend.jvm.targets.jvm_prep_command import JvmPrepCommand
from pants.backend.jvm.targets.managed_jar_dependencies import (ManagedJarDependencies,
ManagedJarLibraries)
ManagedJarLibraries,)
from pants.backend.jvm.targets.scala_exclude import ScalaExclude
from pants.backend.jvm.targets.scala_jar_dependency import ScalaJarDependency
from pants.backend.jvm.targets.scala_library import ScalaLibrary
Expand Down Expand Up @@ -59,7 +59,7 @@
from pants.backend.jvm.tasks.provide_tools_jar import ProvideToolsJar
from pants.backend.jvm.tasks.run_jvm_prep_command import (RunBinaryJvmPrepCommand,
RunCompileJvmPrepCommand,
RunTestJvmPrepCommand)
RunTestJvmPrepCommand,)
from pants.backend.jvm.tasks.scala_repl import ScalaRepl
from pants.backend.jvm.tasks.scaladoc_gen import ScaladocGen
from pants.backend.jvm.tasks.scalafix import ScalaFixCheck, ScalaFixFix
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/jvm/targets/jvm_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pants.base.exceptions import TargetDefinitionException
from pants.base.payload import Payload
from pants.base.payload_field import (ExcludesField, FingerprintedField, FingerprintedMixin,
PrimitiveField)
PrimitiveField,)
from pants.base.validation import assert_list
from pants.java.jar.exclude import Exclude

Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/jvm/tasks/coursier_resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from pants.backend.jvm.ivy_utils import IvyUtils
from pants.backend.jvm.subsystems.jar_dependency_management import (JarDependencyManagement,
PinnedJarArtifactSet)
PinnedJarArtifactSet,)
from pants.backend.jvm.subsystems.resolve_subsystem import JvmResolveSubsystem
from pants.backend.jvm.targets.jar_library import JarLibrary
from pants.backend.jvm.targets.jvm_target import JvmTarget
Expand Down
10 changes: 5 additions & 5 deletions src/python/pants/backend/jvm/tasks/jvm_compile/jvm_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
from pants.backend.jvm.targets.javac_plugin import JavacPlugin
from pants.backend.jvm.targets.scalac_plugin import ScalacPlugin
from pants.backend.jvm.tasks.classpath_products import ClasspathEntry
from pants.backend.jvm.tasks.jvm_compile.class_not_found_error_patterns import \
CLASS_NOT_FOUND_ERROR_PATTERNS
from pants.backend.jvm.tasks.jvm_compile.class_not_found_error_patterns import (
CLASS_NOT_FOUND_ERROR_PATTERNS,)
from pants.backend.jvm.tasks.jvm_compile.compile_context import CompileContext
from pants.backend.jvm.tasks.jvm_compile.execution_graph import (ExecutionFailure, ExecutionGraph,
Job)
Job,)
from pants.backend.jvm.tasks.jvm_compile.missing_dependency_finder import (CompileErrorExtractor,
MissingDependencyFinder)
MissingDependencyFinder,)
from pants.backend.jvm.tasks.jvm_dependency_analyzer import JvmDependencyAnalyzer
from pants.backend.jvm.tasks.nailgun_task import NailgunTaskBase
from pants.base.build_environment import get_buildroot
Expand All @@ -35,7 +35,7 @@
from pants.reporting.reporting_utils import items_to_report_element
from pants.util.contextutil import Timer, temporary_dir
from pants.util.dirutil import (fast_relpath, read_file, safe_delete, safe_file_dump, safe_mkdir,
safe_rmtree)
safe_rmtree,)
from pants.util.fileutil import create_size_estimators
from pants.util.memo import memoized_method, memoized_property

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from pants.base.workunit import WorkUnitLabel
from pants.build_graph.mirrored_target_option_mixin import MirroredTargetOptionMixin
from pants.engine.fs import (EMPTY_DIRECTORY_DIGEST, DirectoryToMaterialize, PathGlobs,
PathGlobsAndRoot)
PathGlobsAndRoot,)
from pants.engine.isolated_process import ExecuteProcessRequest, FallibleExecuteProcessResult
from pants.java.jar.jar_dependency import JarDependency
from pants.reporting.reporting_utils import items_to_report_element
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/jvm/tasks/jvmdoc_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from pants.base.exceptions import TaskError
from pants.build_graph.target_scopes import Scopes
from pants.task.target_restriction_mixins import (HasSkipAndTransitiveOptionsMixin,
SkipAndTransitiveOptionsRegistrar)
SkipAndTransitiveOptionsRegistrar,)
from pants.util import desktop
from pants.util.dirutil import safe_mkdir, safe_walk
from pants.util.memo import memoized_property
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/native/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from pants.backend.native.subsystems.native_toolchain import create_native_toolchain_rules
from pants.backend.native.subsystems.xcode_cli_tools import create_xcode_cli_tools_rules
from pants.backend.native.targets.external_native_library import (ConanRequirement,
ExternalNativeLibrary)
ExternalNativeLibrary,)
from pants.backend.native.targets.native_artifact import NativeArtifact
from pants.backend.native.targets.native_library import CLibrary, CppLibrary
from pants.backend.native.targets.packaged_native_library import PackagedNativeLibrary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


from pants.backend.native.config.environment import (Assembler, CCompiler, CppCompiler,
CppToolchain, CToolchain, Linker, Platform)
CppToolchain, CToolchain, Linker, Platform,)
from pants.backend.native.subsystems.binaries.binutils import Binutils
from pants.backend.native.subsystems.binaries.gcc import GCC
from pants.backend.native.subsystems.binaries.llvm import LLVM
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/native/tasks/native_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pants.backend.native.subsystems.native_build_settings import NativeBuildSettings
from pants.backend.native.subsystems.native_build_step import NativeBuildStep
from pants.backend.native.subsystems.native_toolchain import (NativeToolchain,
ToolchainVariantRequest)
ToolchainVariantRequest,)
from pants.backend.native.targets.native_library import NativeLibrary
from pants.backend.native.targets.packaged_native_library import PackagedNativeLibrary
from pants.build_graph.dependency_context import DependencyContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import unittest

from pants.backend.project_info.rules.source_file_validator import (Matcher, MultiMatcher,
RegexMatchResult)
RegexMatchResult,)


# Note that some parts of these tests are just exercising various capabilities of the regex engine.
Expand Down
14 changes: 7 additions & 7 deletions src/python/pants/backend/python/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@
from pants.backend.python.python_requirement import PythonRequirement
from pants.backend.python.python_requirements import PythonRequirements
from pants.backend.python.rules import (create_requirements_pex, download_pex_bin, inject_init,
python_test_runner)
python_test_runner,)
from pants.backend.python.subsystems.python_native_code import PythonNativeCode
from pants.backend.python.subsystems.python_native_code import rules as python_native_code_rules
from pants.backend.python.subsystems.subprocess_environment import SubprocessEnvironment
from pants.backend.python.subsystems.subprocess_environment import \
rules as subprocess_environment_rules
from pants.backend.python.subsystems.subprocess_environment import (
rules as subprocess_environment_rules,)
from pants.backend.python.targets.python_app import PythonApp
from pants.backend.python.targets.python_binary import PythonBinary
from pants.backend.python.targets.python_distribution import PythonDistribution
from pants.backend.python.targets.python_library import PythonLibrary
from pants.backend.python.targets.python_requirement_library import PythonRequirementLibrary
from pants.backend.python.targets.python_tests import PythonTests
from pants.backend.python.targets.unpacked_whls import UnpackedWheels
from pants.backend.python.tasks.build_local_python_distributions import \
BuildLocalPythonDistributions
from pants.backend.python.tasks.build_local_python_distributions import (
BuildLocalPythonDistributions,)
from pants.backend.python.tasks.gather_sources import GatherSources
from pants.backend.python.tasks.isort_prep import IsortPrep
from pants.backend.python.tasks.isort_run import IsortRun
from pants.backend.python.tasks.local_python_distribution_artifact import \
LocalPythonDistributionArtifact
from pants.backend.python.tasks.local_python_distribution_artifact import (
LocalPythonDistributionArtifact,)
from pants.backend.python.tasks.pytest_prep import PytestPrep
from pants.backend.python.tasks.pytest_run import PytestRun
from pants.backend.python.tasks.python_binary_create import PythonBinaryCreate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pants.backend.python.subsystems.python_setup import PythonSetup
from pants.engine.fs import Digest
from pants.engine.isolated_process import (ExecuteProcessRequest, ExecuteProcessResult,
MultiPlatformExecuteProcessRequest)
MultiPlatformExecuteProcessRequest,)
from pants.engine.platform import Platform, PlatformConstraint
from pants.engine.rules import optionable_rule, rule
from pants.engine.selectors import Get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from pants.backend.python.rules.create_requirements_pex import (RequirementsPex,
RequirementsPexRequest)
RequirementsPexRequest,)
from pants.backend.python.rules.inject_init import InjectedInitDigest
from pants.backend.python.subsystems.pytest import PyTest
from pants.backend.python.subsystems.python_setup import PythonSetup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from pants.backend.python.python_requirement import PythonRequirement
from pants.backend.python.subsystems.pex_build_util import is_local_python_dist
from pants.backend.python.subsystems.python_native_code import (BuildSetupRequiresPex,
PythonNativeCode)
PythonNativeCode,)
from pants.backend.python.targets.python_requirement_library import PythonRequirementLibrary
from pants.base.build_environment import get_buildroot
from pants.base.exceptions import TargetDefinitionException, TaskError
Expand Down
7 changes: 5 additions & 2 deletions src/python/pants/backend/python/tasks/coverage/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

from __future__ import absolute_import, division, print_function, unicode_literals

# NB: This file must keep Python 2 support because it is a resource that may be run with Python 2.

import json
import os

Expand All @@ -16,6 +14,11 @@
from coverage.python import PythonFileReporter


# NB: This file must keep Python 2 support because it is a resource that may be run with Python 2.




class SimpleFileTracer(FileTracer):
def __init__(self, filename):
super(SimpleFileTracer, self).__init__()
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/python/tasks/gather_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from twitter.common.collections import OrderedSet

from pants.backend.python.subsystems.pex_build_util import (PexBuilderWrapper, has_python_sources,
has_resources, is_python_target)
has_resources, is_python_target,)
from pants.base.exceptions import TaskError
from pants.invalidation.cache_manager import VersionedTargetSet
from pants.task.task import Task
Expand Down
7 changes: 5 additions & 2 deletions src/python/pants/backend/python/tasks/pytest/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@

from __future__ import absolute_import, division, print_function, unicode_literals

# NB: This file must keep Python 2 support because it is a resource that may be run with Python 2.

import json
import os
from zlib import crc32

import pytest


# NB: This file must keep Python 2 support because it is a resource that may be run with Python 2.




class NodeRenamerPlugin(object):
"""A pytest plugin to modify the console output of test names.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from pants.backend.python.subsystems.pex_build_util import (PexBuilderWrapper,
has_python_requirements,
has_python_sources, has_resources,
is_python_target)
is_python_target,)
from pants.backend.python.subsystems.python_native_code import PythonNativeCode
from pants.backend.python.targets.python_binary import PythonBinary
from pants.backend.python.targets.python_requirement_library import PythonRequirementLibrary
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/bin/daemon_pants_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from pants.init.logging import encapsulated_global_logger
from pants.init.util import clean_global_runtime_state
from pants.java.nailgun_io import (NailgunStreamStdinReader, NailgunStreamWriterError,
PipedNailgunStreamWriter)
PipedNailgunStreamWriter,)
from pants.java.nailgun_protocol import ChunkType, MaybeShutdownSocket, NailgunProtocol
from pants.util.contextutil import hermetic_environment_as, stdio_as
from pants.util.socket import teardown_socket
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/binaries/binary_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from pants.util.memo import memoized_method, memoized_property
from pants.util.objects import datatype
from pants.util.osutil import (SUPPORTED_PLATFORM_NORMALIZED_NAMES,
get_closest_mac_host_platform_pair)
get_closest_mac_host_platform_pair,)


logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/build_graph/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from pants.build_graph.build_file_aliases import BuildFileAliases
from pants.build_graph.files import Files
from pants.build_graph.intransitive_dependency import (IntransitiveDependencyFactory,
ProvidedDependencyFactory)
ProvidedDependencyFactory,)
from pants.build_graph.prep_command import PrepCommand
from pants.build_graph.remote_sources import RemoteSources
from pants.build_graph.resources import Resources
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/cache/local_artifact_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pants.cache.artifact_cache import ArtifactCache, UnreadableArtifact
from pants.util.contextutil import temporary_file
from pants.util.dirutil import (safe_delete, safe_mkdir, safe_mkdir_for,
safe_rm_oldest_items_in_dir, safe_rmtree)
safe_rm_oldest_items_in_dir, safe_rmtree,)


logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/core_tasks/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from pants.core_tasks.reporting_server_kill import ReportingServerKill
from pants.core_tasks.reporting_server_run import ReportingServerRun
from pants.core_tasks.run_prep_command import (RunBinaryPrepCommand, RunCompilePrepCommand,
RunTestPrepCommand)
RunTestPrepCommand,)
from pants.core_tasks.substitute_aliased_targets import SubstituteAliasedTargets
from pants.core_tasks.targets_help import TargetsHelp
from pants.goal.goal import Goal
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/engine/isolated_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pants.engine.platform import PlatformConstraint
from pants.engine.rules import RootRule, rule
from pants.util.objects import (Exactly, TypedCollection, datatype, hashable_string_list,
string_optional)
string_optional,)


logger = logging.getLogger(__name__)
Expand Down
4 changes: 2 additions & 2 deletions src/python/pants/engine/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
from pants.build_graph.address import Address
from pants.engine.fs import (Digest, DirectoriesToMerge, DirectoryToMaterialize,
DirectoryWithPrefixToStrip, FileContent, FilesContent,
InputFilesContent, PathGlobs, PathGlobsAndRoot, Snapshot, UrlToFetch)
InputFilesContent, PathGlobs, PathGlobsAndRoot, Snapshot, UrlToFetch,)
from pants.engine.isolated_process import (FallibleExecuteProcessResult,
MultiPlatformExecuteProcessRequest)
MultiPlatformExecuteProcessRequest,)
from pants.engine.native import Function, TypeId
from pants.engine.nodes import Return, Throw
from pants.engine.objects import Collection
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/goal/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from pants.base.workunit import WorkUnit, WorkUnitLabel
from pants.build_graph.target import Target
from pants.engine.isolated_process import (FallibleExecuteProcessResult, ProductDescription,
fallible_to_exec_result_or_raise)
fallible_to_exec_result_or_raise,)
from pants.goal.products import Products
from pants.goal.workspace import ScmWorkspace
from pants.process.lock import OwnerPrintingInterProcessFileLock
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/help/help_printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from pants.help.help_formatter import HelpFormatter
from pants.help.scope_info_iterator import ScopeInfoIterator
from pants.option.arg_splitter import (GLOBAL_SCOPE, GoalsHelp, NoGoalHelp, OptionsHelp,
UnknownGoalHelp, VersionHelp)
UnknownGoalHelp, VersionHelp,)
from pants.option.scope import ScopeInfo


Expand Down
Loading

0 comments on commit 6af958f

Please sign in to comment.