This repository has been archived by the owner on Apr 14, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from pquentin/merge-from-master-2019-10-30
Merge from master (October 30th, 2019)
- Loading branch information
Showing
25 changed files
with
241 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
mock==2.0.0 | ||
mock==3.0.5 | ||
coverage~=4.5 | ||
wheel==0.30.0 | ||
tornado==5.1.1 | ||
PySocks==1.6.8 | ||
pkginfo==1.4.2 | ||
PySocks==1.7.1 | ||
# https://github.com/Anorov/PySocks/issues/131 | ||
win-inet-pton==1.1.0 | ||
pytest==4.6.6 | ||
pytest-random-order==1.0.4;python_version>="3.5" | ||
pytest-timeout==1.3.3 | ||
pytest==4.6.4 | ||
pytest-cov==2.7.1 | ||
h11==0.8.0 | ||
cryptography==2.6.1 | ||
|
||
# https://github.com/ionelmc/python-lazy-object-proxy/issues/30 | ||
lazy-object-proxy==1.4.0 | ||
flaky==3.6.1 | ||
|
||
# https://github.com/GoogleCloudPlatform/python-repo-tools/issues/23 | ||
pylint<2.0;python_version<="2.7" | ||
gcp-devrel-py-tools | ||
|
||
# optional dependencies, only intended for use with Python 3.5+ | ||
trio==0.3.0; python_version >= "3.5" | ||
# https://github.com/mhammond/pywin32/issues/1439 | ||
pywin32!=226; python_version >= "3.5" and os_name == 'nt' | ||
twisted[tls]==19.2.0; python_version >= "3.5" and os_name != 'nt' | ||
twisted[tls,windows_platform]==19.2.0; python_version >= "3.5" and os_name == 'nt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,14 +37,6 @@ | |
DEFAULT_CLIENT_CERTS = { | ||
"certfile": os.path.join(CERTS_PATH, "client_intermediate.pem"), | ||
"keyfile": os.path.join(CERTS_PATH, "client_intermediate.key"), | ||
"subject": dict( | ||
countryName=u"FI", | ||
stateOrProvinceName=u"dummy", | ||
organizationName=u"dummy", | ||
organizationalUnitName=u"dummy", | ||
commonName=u"SnakeOilClient", | ||
emailAddress=u"[email protected]", | ||
), | ||
} | ||
DEFAULT_CLIENT_NO_INTERMEDIATE_CERTS = { | ||
"certfile": os.path.join(CERTS_PATH, "client_no_intermediate.pem"), | ||
|
@@ -86,7 +78,7 @@ def _has_ipv6(host): | |
# has_ipv6 returns true if cPython was compiled with IPv6 support. | ||
# It does not tell us if the system has IPv6 support enabled. To | ||
# determine that we must bind to an IPv6 address. | ||
# https://github.com/shazow/urllib3/pull/611 | ||
# https://github.com/urllib3/urllib3/pull/611 | ||
# https://bugs.python.org/issue658327 | ||
try: | ||
sock = socket.socket(socket.AF_INET6) | ||
|
@@ -102,7 +94,7 @@ def _has_ipv6(host): | |
|
||
# Some systems may have IPv6 support but DNS may not be configured | ||
# properly. We can not count that localhost will resolve to ::1 on all | ||
# systems. See https://github.com/shazow/urllib3/pull/611 and | ||
# systems. See https://github.com/urllib3/urllib3/pull/611 and | ||
# https://bugs.python.org/issue18792 | ||
HAS_IPV6_AND_DNS = _has_ipv6("localhost") | ||
HAS_IPV6 = _has_ipv6("::1") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,95 @@ | ||
import os | ||
import shutil | ||
|
||
import nox | ||
|
||
|
||
def tests_impl(session, extras="socks,secure,brotli"): | ||
# Install deps and the package itself. | ||
session.install("-r", "dev-requirements.txt") | ||
session.install(".[{extras}]".format(extras=extras)) | ||
|
||
# Show the pip version. | ||
session.run("pip", "--version") | ||
# Print the Python version and bytesize. | ||
session.run("python", "--version") | ||
session.run("python", "-c", "import struct; print(struct.calcsize('P') * 8)") | ||
# Print OpenSSL information. | ||
session.run("python", "-m", "OpenSSL.debug") | ||
|
||
session.run( | ||
"pytest", | ||
"-r", | ||
"a", | ||
"--cov=urllib3", | ||
*(session.posargs or ("test/",)), | ||
env={"PYTHONWARNINGS": "always::DeprecationWarning"} | ||
) | ||
session.run("coverage", "xml") | ||
session.run("python", "cleancov.py", "coverage.xml") | ||
|
||
|
||
@nox.session(python=["2.7", "3.4", "3.5", "3.6", "3.7", "3.8", "pypy"]) | ||
def test(session): | ||
tests_impl(session) | ||
|
||
|
||
@nox.session(python=["2", "3"]) | ||
def google_brotli(session): | ||
# https://pypi.org/project/Brotli/ is the Google version of brotli, so | ||
# install it separately and don't install our brotli extra (which installs | ||
# brotlipy). | ||
session.install("brotli") | ||
tests_impl(session, extras="socks,secure") | ||
|
||
|
||
@nox.session(python="2.7") | ||
def app_engine(session): | ||
session.install("-r", "dev-requirements.txt") | ||
session.install(".") | ||
session.run( | ||
"coverage", | ||
"run", | ||
"--parallel-mode", | ||
"-m", | ||
"pytest", | ||
"-r", | ||
"sx", | ||
"test/appengine", | ||
*session.posargs | ||
) | ||
session.run("coverage", "combine") | ||
session.run("coverage", "report", "-m") | ||
|
||
|
||
@nox.session() | ||
def blacken(session): | ||
"""Run black code formater.""" | ||
session.install("black") | ||
session.run("black", "src", "dummyserver", "test", "noxfile.py", "setup.py") | ||
|
||
lint(session) | ||
|
||
|
||
@nox.session | ||
def lint(session): | ||
session.install("flake8", "black") | ||
session.run("flake8", "--version") | ||
session.run("black", "--version") | ||
session.run( | ||
"black", "--check", "src", "dummyserver", "test", "noxfile.py", "setup.py" | ||
) | ||
session.run("flake8", "setup.py", "docs", "dummyserver", "src", "test") | ||
|
||
|
||
@nox.session | ||
def docs(session): | ||
session.install("-r", "docs/requirements.txt") | ||
session.install(".[socks,secure,brotli]") | ||
|
||
session.chdir("docs") | ||
if os.path.exists("_build"): | ||
shutil.rmtree("_build") | ||
session.run("sphinx-build", "-W", ".", "_build/html") | ||
import os | ||
import shutil | ||
|
||
import nox | ||
|
||
|
||
def tests_impl(session, extras="socks,secure,brotli"): | ||
# Install deps and the package itself. | ||
session.install("-r", "dev-requirements.txt") | ||
session.install(".[{extras}]".format(extras=extras)) | ||
|
||
# Show the pip version. | ||
session.run("pip", "--version") | ||
# Print the Python version and bytesize. | ||
session.run("python", "--version") | ||
session.run("python", "-c", "import struct; print(struct.calcsize('P') * 8)") | ||
# Print OpenSSL information. | ||
session.run("python", "-m", "OpenSSL.debug") | ||
|
||
session.run( | ||
"pytest", | ||
"-r", | ||
"a", | ||
"--tb=native", | ||
"--cov=urllib3", | ||
"--no-success-flaky-report", | ||
*(session.posargs or ("test/",)), | ||
env={"PYTHONWARNINGS": "always::DeprecationWarning"} | ||
) | ||
session.run("coverage", "xml") | ||
session.run("python", "cleancov.py", "coverage.xml") | ||
|
||
|
||
@nox.session(python=["2.7", "3.4", "3.5", "3.6", "3.7", "3.8", "pypy"]) | ||
def test(session): | ||
tests_impl(session) | ||
|
||
|
||
@nox.session(python=["2", "3"]) | ||
def google_brotli(session): | ||
# https://pypi.org/project/Brotli/ is the Google version of brotli, so | ||
# install it separately and don't install our brotli extra (which installs | ||
# brotlipy). | ||
session.install("brotli") | ||
tests_impl(session, extras="socks,secure") | ||
|
||
|
||
@nox.session(python="2.7") | ||
def app_engine(session): | ||
session.install("-r", "dev-requirements.txt") | ||
session.install(".") | ||
session.run( | ||
"coverage", | ||
"run", | ||
"--parallel-mode", | ||
"-m", | ||
"pytest", | ||
"-r", | ||
"sx", | ||
"test/appengine", | ||
*session.posargs | ||
) | ||
session.run("coverage", "combine") | ||
session.run("coverage", "report", "-m") | ||
|
||
|
||
@nox.session() | ||
def blacken(session): | ||
"""Run black code formater.""" | ||
session.install("black") | ||
session.run("black", "src", "dummyserver", "test", "noxfile.py", "setup.py") | ||
|
||
lint(session) | ||
|
||
|
||
@nox.session | ||
def lint(session): | ||
session.install("flake8", "black") | ||
session.run("flake8", "--version") | ||
session.run("black", "--version") | ||
session.run( | ||
"black", "--check", "src", "dummyserver", "test", "noxfile.py", "setup.py" | ||
) | ||
session.run("flake8", "setup.py", "docs", "dummyserver", "src", "test") | ||
|
||
|
||
@nox.session | ||
def docs(session): | ||
session.install("-r", "docs/requirements.txt") | ||
session.install(".[socks,secure,brotli]") | ||
|
||
session.chdir("docs") | ||
if os.path.exists("_build"): | ||
shutil.rmtree("_build") | ||
session.run("sphinx-build", "-W", ".", "_build/html") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.