Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Sep 3, 2018
1 parent 47500a0 commit 0c72d76
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 16 deletions.
4 changes: 1 addition & 3 deletions src/python/pants/engine/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
from pants.engine.rules import RootRule
from pants.option.custom_types import GlobExpansionConjunction
from pants.option.global_options import GlobMatchErrorBehavior
from pants.util.objects import Collection
from pants.util.objects import DatatypeFieldDecl as F
from pants.util.objects import convert, datatype
from pants.util.objects import Collection, convert, datatype


class FileContent(datatype([('path', text_type), ('content', binary_type)])):
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 @@ -12,7 +12,7 @@
from pants.engine.rules import RootRule, rule
from pants.engine.selectors import Select
from pants.util.objects import DatatypeFieldDecl as F
from pants.util.objects import Exactly, TypeCheckError, convert, convert_default, datatype, optional
from pants.util.objects import Exactly, convert, convert_default, datatype, optional


logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/engine/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from pants.engine.objects import Serializable
from pants.engine.parser import Parser
from pants.util.memo import memoized_property
from pants.util.objects import SubclassesOf, convert, convert_default, datatype
from pants.util.objects import SubclassesOf, convert_default, datatype


class MappingError(Exception):
Expand Down
3 changes: 1 addition & 2 deletions src/python/pants/engine/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

from pants.engine.selectors import Get, type_or_constraint_repr
from pants.util.meta import AbstractClass
from pants.util.objects import DatatypeFieldDecl as F
from pants.util.objects import Exactly, convert, convert_default, datatype


Expand Down Expand Up @@ -138,7 +137,7 @@ def input_selectors(self):


class TaskRule(datatype([
('output_constraint', convert(Exactly, create_func=Exactly, should_have_default=False)),
('output_constraint', convert(Exactly, should_have_default=False)),
('input_selectors', convert(tuple, should_have_default=False)),
'func',
('input_gets', convert_default(tuple)),
Expand Down
2 changes: 0 additions & 2 deletions src/python/pants/option/scope.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

from collections import namedtuple

from pants.util.objects import SubclassesOf, datatype, optional


Expand Down
3 changes: 1 addition & 2 deletions src/python/pants/util/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
from future.utils import PY2, text_type
from twitter.common.collections import OrderedSet

from pants.util.memo import (memoized, memoized_classmethod, memoized_classproperty,
memoized_property)
from pants.util.memo import memoized, memoized_classmethod, memoized_classproperty
from pants.util.meta import AbstractClass, classproperty


Expand Down
8 changes: 3 additions & 5 deletions tests/python/pants_test/util/test_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
from future.utils import PY3, text_type

from pants.util.objects import DatatypeFieldDecl as F
from pants.util.objects import (Exactly, SubclassesOf, SuperclassesOf, TypeCheckError,
TypeConstraintError, TypedDatatypeInstanceConstructionError,
convert, convert_default, datatype, enum, non_empty, not_none,
optional)
from pants.util.objects import (Exactly, SubclassesOf, SuperclassesOf, TypeCheckError, convert,
convert_default, datatype, enum, non_empty, not_none, optional)
from pants_test.test_base import TestBase


Expand Down Expand Up @@ -396,7 +394,7 @@ class MultipleSameNameWithType(datatype([
class InvalidTypeSpec(datatype([('a_field', 2)])): pass

def test_class_construction_default_value(self):
with self.assertRaises(ValueError) as cm:
with self.assertRaises(ValueError):
class WithEmptyTuple(datatype([()])): pass

# Check that the default value is still checked against the
Expand Down

0 comments on commit 0c72d76

Please sign in to comment.