Skip to content
This repository has been archived by the owner on Mar 27, 2021. It is now read-only.

Commit

Permalink
Merge 6d8da69 into 8f339c4
Browse files Browse the repository at this point in the history
  • Loading branch information
Za Wilgustus committed Jan 11, 2018
2 parents 8f339c4 + 6d8da69 commit c18e1e7
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions rcli/autodetect.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def egg_info_writer(cmd, basename, filename):
config = dict(parser.items('rcli'))
for k, v in six.iteritems(config):
if v.lower() in ('y', 'yes', 'true'):
config[k] = True
config[k] = True # type: ignore
elif v.lower() in ('n', 'no', 'false'):
config[k] = False
config[k] = False # type: ignore
else:
try:
config[k] = json.loads(v)
Expand Down
3 changes: 2 additions & 1 deletion rcli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import types
import typing

from typingplus.types import Singleton
from typet import Singleton
import pkg_resources
import setuptools # noqa: F401 pylint: disable=unused-import
import six
Expand Down Expand Up @@ -104,6 +104,7 @@ def distribution(self):
"""The distribution containing the currently active entry point."""
if self.entry_point:
return self.entry_point.dist
return None

def __getattr__(self, attr):
# type: (str) -> typing.Any
Expand Down
4 changes: 3 additions & 1 deletion rcli/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import logging
import sys
import types # noqa: F401 pylint: disable=unused-import
import typing # noqa: F401 pylint: disable=unused-import

import typingplus as typing # noqa: F401 pylint: disable=unused-import

from docopt import docopt
import colorama
Expand All @@ -26,6 +27,7 @@
)
from .config import settings

typing.upgrade_typing()

_LOGGER = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion rcli/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def print_status(msg, color):
raise e.exc # pylint: disable=raising-bad-type
except (KeyboardInterrupt, EOFError):
raise
except:
except Exception:
print_status('FAILED', Fore.RED)
raise
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ warn_no_return = False
ignore_errors = True

[pylint]
disable = ungrouped-imports,no-name-in-module,too-few-public-methods,invalid-sequence-index,bad-continuation,import-error,invalid-name,no-member,locally-disabled,locally-enabled,redefined-outer-name,redefined-variable-type
disable = ungrouped-imports,no-name-in-module,too-few-public-methods,invalid-sequence-index,bad-continuation,import-error,invalid-name,no-member,locally-disabled,locally-enabled,redefined-outer-name,redefined-variable-type,stop-iteration-return
reports = no
known-standard-library = typing
19 changes: 8 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
if os.path.isdir('rcli.egg-info'):
try:
shutil.rmtree('rcli.egg-info')
except: # pylint: disable=bare-except
except IOError:
pass

with open('README.rst') as readme_fp:
readme = readme_fp.read()

common_requires = ['docopt >= 0.6.2, < 1',
'six >= 1.10.0']
setup(
name='rcli',
use_scm_version=True,
Expand All @@ -32,22 +34,17 @@
license='MIT',
packages=find_packages(exclude=['tests', 'docs']),
install_requires=[
'typingplus >= 1.0.2, < 2',
'typet >= 0.3.4, < 4',
'backports.shutil_get_terminal_size',
'colorama >= 0.3.6, < 1',
'tqdm >= 4.9.0, < 5',
'docopt >= 0.6.2, < 1',
'six >= 1.10.0'
],
'tqdm >= 4.9.0, < 5'
] + common_requires,
setup_requires=[
'six >= 1.10.0',
'packaging',
'appdirs',
'pytest-runner',
'setuptools_scm',
'typingplus >= 1.0.2, < 2',
'docopt >= 0.6.2, < 1'
],
'setuptools_scm'
] + common_requires,
tests_require=[
'pytest >= 3.0'
],
Expand Down
1 change: 1 addition & 0 deletions tests/test_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def test_py2_annotations(create_project, run):
"""Test type hinting with Python 2 annotations."""
with create_project('''
def types(str1, num):
# type: (str, int) -> None
"""usage: say types <str1> <num>"""
print(type(str1))
print(type(num))
Expand Down

0 comments on commit c18e1e7

Please sign in to comment.