Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

231 address first mypy errors #359

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ matrix:
- python: 2.7
env: TOXENV=py27
- python: 2.7
env: TOXENV=pep8
env: TOXENV=lint
- python: 3.4
env: TOXENV=py34
- python: 3.5
Expand Down
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ Anna Martelli Ravenscroft <annaraven@gmail.com>
Sumana Harihareswara <sh@changeset.nyc>
Dustin Ingram <di@di.codes> (https://di.codes)
Jesse Jarzynka <jesse@jessejoe.com> (http://jessejoe.com)
Frances Hocutt <frances.hocutt@gmail.com>
Tathagata Dasgupta <tathagatadg@gmail.com>
3 changes: 2 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
try:
import builtins
except ImportError:
import __builtin__ as builtins
# https://github.com/python/mypy/issues/1153
import __builtin__ as builtins # type: ignore

import pytest

Expand Down
14 changes: 9 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27,pypy,py33,py34,py35,py36,docs,pep8
envlist = lint,py27,pypy,py33,py34,py35,py36,docs

[testenv]
deps =
Expand Down Expand Up @@ -28,7 +28,11 @@ commands =
python setup.py -q bdist_wheel sdist
twine upload --skip-existing dist/*

[testenv:pep8]
basepython = python2.7
deps = flake8
commands = flake8 twine/ tests/ docs/
[testenv:lint]
basepython = python3.6
deps =
flake8
mypy
commands =
flake8 twine/ tests/
mypy -s twine/ tests/
2 changes: 1 addition & 1 deletion twine/commands/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,4 @@ def main(args):


if __name__ == "__main__":
sys.exit(main())
sys.exit(main(None))
3 changes: 2 additions & 1 deletion twine/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
from hashlib import blake2b
except ImportError:
try:
from pyblake2 import blake2b
# https://github.com/python/mypy/issues/1153
from pyblake2 import blake2b # type: ignore
except ImportError:
blake2b = None

Expand Down
6 changes: 4 additions & 2 deletions twine/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
try:
import configparser
except ImportError: # pragma: no cover
import ConfigParser as configparser
# https://github.com/python/mypy/issues/1153
import ConfigParser as configparser # type: ignore

try:
from urlparse import urlparse, urlunparse
Expand All @@ -40,7 +41,8 @@
if sys.version_info > (3,):
input_func = input
else:
input_func = raw_input
# Ignore "undefined name" for flake8/python3
input_func = raw_input # noqa: F821


DEFAULT_REPOSITORY = "https://upload.pypi.org/legacy/"
Expand Down