Skip to content

Commit

Permalink
Resolve merge conflicts from removal of tasks2
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Livingston committed Jan 30, 2018
1 parent 7f757c0 commit 0b82067
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 30 deletions.
15 changes: 5 additions & 10 deletions src/python/pants/backend/python/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,12 @@
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.tasks2.build_local_python_distributions import \
from pants.backend.python.tasks.build_local_python_distributions import \
BuildLocalPythonDistributions
from pants.backend.python.tasks2.gather_sources import GatherSources
from pants.backend.python.tasks2.pytest_prep import PytestPrep
from pants.backend.python.tasks2.pytest_run import PytestRun
from pants.backend.python.tasks2.python_binary_create import PythonBinaryCreate
from pants.backend.python.tasks2.python_repl import PythonRepl
from pants.backend.python.tasks2.python_run import PythonRun
from pants.backend.python.tasks2.resolve_requirements import ResolveRequirements
from pants.backend.python.tasks2.select_interpreter import SelectInterpreter
from pants.backend.python.tasks2.setup_py import SetupPy
from pants.backend.python.tasks.gather_sources import GatherSources
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
from pants.backend.python.tasks.python_isort import IsortPythonTask
from pants.backend.python.tasks.python_repl import PythonRepl
from pants.backend.python.tasks.python_run import PythonRun
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

from pex.interpreter import PythonInterpreter

from pants.backend.python.tasks2.pex_build_util import is_local_python_dist
from pants.backend.python.tasks2.setup_py import SetupPyRunner
from pants.backend.python.tasks.pex_build_util import is_local_python_dist
from pants.backend.python.tasks.setup_py import SetupPyRunner
from pants.base.build_environment import get_buildroot
from pants.base.exceptions import TargetDefinitionException, TaskError
from pants.base.fingerprint_strategy import DefaultFingerprintStrategy
Expand Down Expand Up @@ -41,7 +41,7 @@ def cache_target_dirs(self):
def execute(self):
dist_targets = self.context.targets(is_local_python_dist)
built_dists = set()

if dist_targets:
with self.invalidated(dist_targets,
fingerprint_strategy=DefaultFingerprintStrategy(),
Expand Down
4 changes: 2 additions & 2 deletions src/python/pants/backend/python/tasks/python_binary_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
from pex.pex_info import PexInfo

from pants.backend.python.targets.python_binary import PythonBinary
from pants.backend.python.tasks2.build_local_python_distributions import \
from pants.backend.python.tasks.build_local_python_distributions import \
BuildLocalPythonDistributions
from pants.backend.python.tasks2.pex_build_util import (build_req_libs_provided_by_setup_file,
from pants.backend.python.tasks.pex_build_util import (build_req_libs_provided_by_setup_file,
dump_requirements, dump_sources,
has_python_requirements, has_python_sources,
has_resources)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
from pants.backend.python.targets.python_distribution import PythonDistribution
from pants.backend.python.targets.python_requirement_library import PythonRequirementLibrary
from pants.backend.python.targets.python_target import PythonTarget
from pants.backend.python.tasks2.gather_sources import GatherSources
from pants.backend.python.tasks2.pex_build_util import has_python_sources
from pants.backend.python.tasks2.resolve_requirements import ResolveRequirements
from pants.backend.python.tasks2.resolve_requirements_task_base import ResolveRequirementsTaskBase
from pants.backend.python.tasks.gather_sources import GatherSources
from pants.backend.python.tasks.pex_build_util import has_python_sources
from pants.backend.python.tasks.resolve_requirements import ResolveRequirements
from pants.backend.python.tasks.resolve_requirements_task_base import ResolveRequirementsTaskBase
from pants.build_graph.address import Address
from pants.build_graph.files import Files
from pants.invalidation.cache_manager import VersionedTargetSet
Expand Down
10 changes: 6 additions & 4 deletions src/python/pants/backend/python/tasks/resolve_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)

from pants.backend.python.tasks2.pex_build_util import has_python_requirements
from pants.backend.python.tasks2.resolve_requirements_task_base import ResolveRequirementsTaskBase
from pants.backend.python.tasks.pex_build_util import has_python_requirements, is_local_python_dist
from pants.backend.python.tasks.resolve_requirements_task_base import ResolveRequirementsTaskBase


class ResolveRequirements(ResolveRequirementsTaskBase):
Expand All @@ -19,5 +19,7 @@ def product_types(cls):

def execute(self):
req_libs = self.context.targets(has_python_requirements)
pex = self.resolve_requirements(req_libs)
self.context.products.register_data(self.REQUIREMENTS_PEX, pex)
dist_tgts = self.context.targets(is_local_python_dist)
if req_libs or dist_tgts:
pex = self.resolve_requirements(req_libs)
self.context.products.register_data(self.REQUIREMENTS_PEX, pex)
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
from pex.pex import PEX
from pex.pex_builder import PEXBuilder

from pants.backend.python.tasks2.build_local_python_distributions import \
from pants.backend.python.tasks.build_local_python_distributions import \
BuildLocalPythonDistributions
from pants.backend.python.tasks2.pex_build_util import (build_req_libs_provided_by_setup_file,
from pants.backend.python.tasks.pex_build_util import (build_req_libs_provided_by_setup_file,
dump_requirements, is_local_python_dist)
from pants.invalidation.cache_manager import VersionedTargetSet
from pants.task.task import Task
Expand Down
4 changes: 2 additions & 2 deletions src/python/pants/backend/python/tasks/setup_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
from pants.backend.python.targets.python_binary import PythonBinary
from pants.backend.python.targets.python_requirement_library import PythonRequirementLibrary
from pants.backend.python.targets.python_target import PythonTarget
from pants.backend.python.tasks2.gather_sources import GatherSources
from pants.backend.python.tasks2.pex_build_util import is_local_python_dist
from pants.backend.python.tasks.gather_sources import GatherSources
from pants.backend.python.tasks.pex_build_util import is_local_python_dist
from pants.base.build_environment import get_buildroot
from pants.base.exceptions import TargetDefinitionException, TaskError
from pants.base.specs import SiblingAddresses
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from textwrap import dedent

from pants.backend.python.targets.python_distribution import PythonDistribution
from pants.backend.python.tasks2.build_local_python_distributions import \
from pants.backend.python.tasks.build_local_python_distributions import \
BuildLocalPythonDistributions
from pants_test.backend.python.tasks.python_task_test_base import PythonTaskTestBase

Expand Down Expand Up @@ -39,8 +39,8 @@ def setUp(self):
for rel_path, content in self.filemap.items():
self.create_file(rel_path, content)

self.python_dist_tgt = self.make_target(spec='src/python/dist:my_dist',
target_type=PythonDistribution,
self.python_dist_tgt = self.make_target(spec='src/python/dist:my_dist',
target_type=PythonDistribution,
sources=sources)

def test_python_create_distributions(self):
Expand Down

0 comments on commit 0b82067

Please sign in to comment.