Install Mypy in Nox, add Ezzeri Esa to contributors
MODIFY
.travis.yml
.travis.yml
@@ -33,9 +33,9 @@ jobs:
- python: nightly
include:
# Lint & documentation.
- - python: 3.6
+ - python: 3.8
env: NOX_SESSION=lint
- - python: 3.6
+ - python: 3.8
env: NOX_SESSION=docs
# Unit tests

MODIFY
CONTRIBUTORS.txt
CONTRIBUTORS.txt
@@ -303,5 +303,8 @@ In chronological order:
* [Bastiaan Bakker] <https://github.com/bastiaanb>
* Support for logging session keys via environment variable ``SSLKEYLOGFILE`` (Python 3.8+)
+* [Ezzeri Esa] <https://github.com/savarin>
+ * Ports and extends on types from typeshed
+
* [Your name or handle] <[email or website]>
* [Brief summary of your changes]

MODIFY
noxfile.py
noxfile.py
@@ -95,29 +95,28 @@ def blacken(session):
@nox.session
def lint(session):
- session.install("flake8", "black")
+ session.install("flake8", "black", "mypy")
session.run("flake8", "--version")
session.run("black", "--version")
+ session.run("mypy", "--version")
session.run(
"black", "--check", "src", "dummyserver", "test", "noxfile.py", "setup.py"
)
session.run("flake8", "setup.py", "docs", "dummyserver", "src", "test")
+ session.log("mypy --strict src/urllib3")
errors = []
- popen = subprocess.Popen(
- "mypy --strict src/urllib3",
+ process = subprocess.run(
+ ["mypy", "--strict", "src/urllib3"],
env=session.env,
- shell=True,
+ text=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
+ # Ensure that mypy itself ran succesfully
+ assert process.returncode in (0, 1)
- mypy_output = ""
- while popen.poll() is None:
- mypy_output += popen.stdout.read(8192).decode()
- mypy_output += popen.stdout.read().decode()
-
- for line in mypy_output.split("\n"):
+ for line in process.stdout.split("\n"):
filepath = line.partition(":")[0]
if filepath in STUB_FILES:
errors.append(line)

Install Mypy in Nox, add Ezzeri Esa to contributors