Skip to content

Commit

Permalink
Port task (pantsbuild#6200)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Arellano authored and Chris Livingston committed Aug 27, 2018
1 parent 15861c6 commit 5dae917
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/python/pants/task/goal_options_mixin.py
Expand Up @@ -4,6 +4,8 @@

from __future__ import absolute_import, division, print_function, unicode_literals

from builtins import object

from pants.option.optionable import Optionable
from pants.option.scope import ScopeInfo

Expand Down
1 change: 1 addition & 0 deletions src/python/pants/task/mutex_task_mixin.py
Expand Up @@ -5,6 +5,7 @@
from __future__ import absolute_import, division, print_function, unicode_literals

from abc import abstractmethod
from builtins import filter
from collections import defaultdict

from pants.base.exceptions import TaskError
Expand Down
1 change: 1 addition & 0 deletions src/python/pants/task/scm_publish_mixin.py
Expand Up @@ -7,6 +7,7 @@
import re
import traceback
from abc import abstractmethod
from builtins import object, range

from pants.base.exceptions import TaskError
from pants.scm.scm import Scm
Expand Down
1 change: 1 addition & 0 deletions src/python/pants/task/simple_codegen_task.py
Expand Up @@ -7,6 +7,7 @@
import logging
import os
from abc import abstractmethod
from builtins import zip
from collections import OrderedDict

from future.utils import text_type
Expand Down
2 changes: 2 additions & 0 deletions src/python/pants/task/target_restriction_mixins.py
Expand Up @@ -4,6 +4,8 @@

from __future__ import absolute_import, division, print_function, unicode_literals

from builtins import object

from pants.task.goal_options_mixin import GoalOptionsMixin, GoalOptionsRegistrar


Expand Down
3 changes: 2 additions & 1 deletion src/python/pants/task/task.py
Expand Up @@ -7,6 +7,7 @@
import os
import sys
from abc import abstractmethod
from builtins import filter, map, object, str, zip
from contextlib import contextmanager
from hashlib import sha1
from itertools import repeat
Expand Down Expand Up @@ -231,7 +232,7 @@ def get_targets(self, predicate=None):
:API: public
"""
return (self.context.targets(predicate) if self.act_transitively
else filter(predicate, self.context.target_roots))
else list(filter(predicate, self.context.target_roots)))

@memoized_property
def workdir(self):
Expand Down
1 change: 1 addition & 0 deletions src/python/pants/task/testrunner_task_mixin.py
Expand Up @@ -8,6 +8,7 @@
import re
import xml.etree.ElementTree as ET
from abc import abstractmethod
from builtins import filter, next, object, str

from pants.base.exceptions import ErrorWhileTesting, TaskError
from pants.build_graph.files import Files
Expand Down
4 changes: 4 additions & 0 deletions tests/python/pants_test/task/BUILD
Expand Up @@ -5,6 +5,7 @@ python_tests(
name = 'console_task',
sources = ['test_console_task.py'],
dependencies = [
'3rdparty/python:future',
'src/python/pants/task',
'tests/python/pants_test:task_test_base',
]
Expand Down Expand Up @@ -35,6 +36,7 @@ python_tests(
name = 'simple_codegen_task',
sources = ['test_simple_codegen_task.py'],
dependencies = [
'3rdparty/python:future',
'src/python/pants/base:payload',
'src/python/pants/build_graph',
'src/python/pants/task',
Expand All @@ -57,6 +59,7 @@ python_tests(
python_tests(
sources=['test_task.py'],
dependencies=[
'3rdparty/python:future',
'src/python/pants/base:build_environment',
'src/python/pants/base:exceptions',
'src/python/pants/build_graph',
Expand All @@ -71,6 +74,7 @@ python_tests(
name='testrunner_task_mixin',
sources=['test_testrunner_task_mixin.py'],
dependencies=[
'3rdparty/python:future',
'3rdparty/python:mock',
'src/python/pants/task',
'src/python/pants/util:process_handler',
Expand Down
2 changes: 1 addition & 1 deletion tests/python/pants_test/task/test_console_task.py
Expand Up @@ -6,7 +6,7 @@

import os
import threading
from Queue import Empty, Queue
from queue import Empty, Queue

from pants.task.console_task import ConsoleTask
from pants_test.task_test_base import TaskTestBase
Expand Down
1 change: 1 addition & 0 deletions tests/python/pants_test/task/test_simple_codegen_task.py
Expand Up @@ -5,6 +5,7 @@
from __future__ import absolute_import, division, print_function, unicode_literals

import os
from builtins import str
from textwrap import dedent

from pants.base.payload import Payload
Expand Down
1 change: 1 addition & 0 deletions tests/python/pants_test/task/test_task.py
Expand Up @@ -5,6 +5,7 @@
from __future__ import absolute_import, division, print_function, unicode_literals

import os
from builtins import str

from pants.base.build_environment import get_buildroot
from pants.base.exceptions import TaskError
Expand Down
1 change: 1 addition & 0 deletions tests/python/pants_test/task/test_testrunner_task_mixin.py
Expand Up @@ -6,6 +6,7 @@

import collections
import os
from builtins import next, object
from contextlib import contextmanager
from unittest import TestCase
from xml.etree.ElementTree import ParseError
Expand Down

0 comments on commit 5dae917

Please sign in to comment.