Skip to content

Commit

Permalink
Use pylint/astroid pinned master to get 3.6 support, clean up new lints
Browse files Browse the repository at this point in the history
  • Loading branch information
EntilZha committed Feb 1, 2017
1 parent 7d5c488 commit 0b3dcf5
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ before_install:
- pip install codecov
install:
- pip install -q coverage
- pip install pylint
- pip install git+https://github.com/PyCQA/pylint.git@7daed7b8982480c868b0f642a5251f00ffb253c6
- pip install git+https://github.com/PyCQA/astroid.git@d0b5acdfebcdda5c949584c32a8cbc0f31d5cf25
- pip install -r requirements.txt
- pip install $EXTRA_INSTALLS

Expand Down
4 changes: 3 additions & 1 deletion functional/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def __iter__(self):
to __iter__ returns a new iterator independent of all others
:return: iterator over file
"""
# pylint: disable=no-member
with builtins.open(self.path,
mode=self.mode,
buffering=self.buffering,
Expand All @@ -58,6 +59,7 @@ def __iter__(self):
yield line

def read(self):
# pylint: disable=no-member
with builtins.open(self.path,
mode=self.mode,
buffering=self.buffering,
Expand Down Expand Up @@ -213,7 +215,7 @@ def get_read_function(filename, disable_compression):
def universal_write_open(path, mode, buffering=-1, encoding=None, errors=None, newline=None,
compresslevel=9, format=None, check=-1, preset=None, filters=None,
compression=None):
# pylint: disable=unexpected-keyword-arg
# pylint: disable=unexpected-keyword-arg,no-member
if compression is None:
return builtins.open(path, mode=mode, buffering=buffering, encoding=encoding, errors=errors,
newline=newline)
Expand Down
5 changes: 3 additions & 2 deletions functional/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, sequence, transform=None, engine=None, max_repr_items=None):
self._base_sequence = sequence._base_sequence
self._lineage = Lineage(prior_lineage=sequence._lineage,
engine=engine)
elif isinstance(sequence, list) or isinstance(sequence, tuple) or is_iterable(sequence):
elif isinstance(sequence, (list, tuple)) or is_iterable(sequence):
self._max_repr_items = max_repr_items
self._base_sequence = sequence
self._lineage = Lineage(engine=engine)
Expand Down Expand Up @@ -1558,6 +1558,7 @@ def to_sqlite3(self, conn, target, *args, **kwargs):
:param args: passed to sqlite3.connect
:param kwargs: passed to sqlite3.connect
"""
# pylint: disable=no-member
insert_regex = re.compile(r'(insert|update)\s+into', flags=re.IGNORECASE)
if insert_regex.match(target):
insert_f = self._to_sqlite3_by_query
Expand Down Expand Up @@ -1656,7 +1657,7 @@ def _wrap(value):
"""
if is_primitive(value):
return value
if isinstance(value, dict) or isinstance(value, set) or is_namedtuple(value):
if isinstance(value, (dict, set)) or is_namedtuple(value):
return value
elif isinstance(value, collections.Iterable):
return Sequence(value)
Expand Down
2 changes: 1 addition & 1 deletion functional/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, disable_compression=False, max_repr_items=100):
self.disable_compression = disable_compression
self.max_repr_items = max_repr_items

def __call__(self, *args):
def __call__(self, *args, **kwargs):
"""
Create a Sequence using a sequential ExecutionEngine.
Expand Down
10 changes: 3 additions & 7 deletions functional/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,9 @@ def is_primitive(val):
:param val: value to check
:return: True if value is a primitive, else False
"""
return isinstance(val, str) \
or isinstance(val, bool) \
or isinstance(val, six.string_types + (six.text_type,)) \
or isinstance(val, six.integer_types) \
or isinstance(val, float) \
or isinstance(val, complex) \
or isinstance(val, bytes)
return isinstance(val,
(str, bool, float, complex, bytes, six.text_type)
+ six.string_types + six.integer_types)


def is_namedtuple(val):
Expand Down
2 changes: 1 addition & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=E1608,W1627,E1601,E1603,E1602,E1605,E1604,E1607,E1606,W1621,W1620,W1623,W1622,W1625,W1624,W1609,W1608,W1607,W1606,W1605,W1604,W1603,W1602,W1601,W1639,W1640,I0021,W1638,I0020,W1618,W1619,W1630,W1626,W1637,W1634,W1635,W1610,W1611,W1612,W1613,W1614,W1615,W1616,W1617,W1632,W1633,W0704,W1628,W1629,W1636,missing-docstring,too-many-lines,redefined-builtin,too-many-public-methods,too-many-arguments,superfluous-parens
disable=E1608,W1627,E1601,E1603,E1602,E1605,E1604,E1607,E1606,W1621,W1620,W1623,W1622,W1625,W1624,W1609,W1608,W1607,W1606,W1605,W1604,W1603,W1602,W1601,W1639,W1640,I0021,W1638,I0020,W1618,W1619,W1630,W1626,W1637,W1634,W1635,W1610,W1611,W1612,W1613,W1614,W1615,W1616,W1617,W1632,W1633,W0704,W1628,W1629,W1636,missing-docstring,too-many-lines,redefined-builtin,too-many-public-methods,too-many-arguments,superfluous-parens,no-else-return,len-as-condition


[REPORTS]
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
except (IOError, ImportError):
long_description = open('README.md').read()

common_install_requires = ['future==0.15.2', 'six==1.10.0', 'dill==0.2.5', 'tabulate==0.7.5']
common_install_requires = ['future==0.16.0', 'six==1.10.0', 'dill==0.2.5', 'tabulate==0.7.7']
if sys.version_info.major == 2 or '__pypy__' in sys.builtin_module_names:
compression_requires = ['bz2file==0.98', 'backports.lzma==0.0.3']
compression_requires = ['bz2file==0.98', 'backports.lzma==0.0.6']
install_requires = common_install_requires
else:
compression_requires = []
Expand All @@ -27,7 +27,7 @@
license='MIT',
keywords='functional pipeline data collection chain rdd linq parallel',
packages=find_packages(exclude=['contrib', 'docs', 'tests*', 'test']),
version='0.8.0',
version='1.0.0',
install_requires=install_requires,
extras_requires={
'all': ['pandas'] + compression_requires,
Expand All @@ -41,6 +41,7 @@
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Natural Language :: English',
Expand Down

0 comments on commit 0b3dcf5

Please sign in to comment.