Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Merge from master (October 30th, 2019) #136

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
31db282
Preserve chunked argument in urlopen() retry (#1715)
lmvlmv Oct 29, 2019
15e64de
Retry failed dummyserver tests once (#1718)
pquentin Oct 29, 2019
9fca285
Remove Python 3.1 workaround (#1716)
pquentin Oct 29, 2019
42a3ef3
Prefer pytest.raises over Testcase.fail (#1712)
pquentin Oct 29, 2019
1733719
Speed up queue test by using timeout=0 (#1711)
pquentin Oct 29, 2019
11d68ef
Update urllib3/requests GitHub URLs (#1719)
pquentin Oct 29, 2019
3cff0a5
Restore comment next to its intended line (#1720)
pquentin Oct 30, 2019
da5e605
Remove pkginfo which was only needed for twine
pquentin Oct 28, 2019
c0a51cc
Remove lazy-object-proxy pin after upstream fix
pquentin Oct 28, 2019
b2f2077
Extract wheel from dev-requirements.txt
pquentin Oct 28, 2019
3bc0baa
Upgrade dev dependencies
pquentin Oct 28, 2019
6c7e87c
Place pytest before the pytest plugins
pquentin Oct 29, 2019
9d29469
Upgrade PySocks version
pquentin Oct 28, 2019
639dfda
Remove unused certs and keys (#1721)
pquentin Oct 30, 2019
0e31f59
Switch noxfile to Unix line endings
pquentin Oct 30, 2019
cfcf6e2
Show failed tests in pytest report
pquentin Oct 30, 2019
cf0eda9
Tell pytest to show native tracebacks
pquentin Oct 30, 2019
4de9315
Merge commit '31db28210facc24b96afecbc3b41588d0dc6fded' into merge-fr…
pquentin Nov 11, 2019
e04d2c1
Merge commit '15e64de5a67a87f5350538cff1f011cb03ffde03' into merge-fr…
pquentin Nov 11, 2019
26a1628
Merge commit '9fca285a9b674034e8bb4e242a6942cecf8ec732' into merge-fr…
pquentin Nov 11, 2019
0b86709
Merge commit '42a3ef3ce763ec8434a6ae48bac59434e1b0c9b1' into merge-fr…
pquentin Nov 12, 2019
44a8734
Merge commit '1733719676ea30f62dae29ab837c29b548108926' into merge-fr…
pquentin Nov 12, 2019
a0571f1
Merge commit '11d68efa7c150823472f0e5309c3a08a1a10c2f2' into merge-fr…
pquentin Nov 12, 2019
143ba71
Merge commit '3cff0a5620a1da136f08b4e1f5435e35528dd771' into merge-fr…
pquentin Nov 12, 2019
61f3b8c
Merge commit '9d2946995b4c34f661e2a1103fc03e28a32a6680' into merge-fr…
pquentin Nov 12, 2019
4fb3dcd
Merge commit '639dfda9bb042a433ad046b331868f42ab89d35a' into merge-fr…
pquentin Nov 12, 2019
b2e6bd8
Merge commit 'cf0eda9b45579376b121406bbea2e866f1a1c533' into merge-fr…
pquentin Nov 12, 2019
18aebad
Fix lint
pquentin Nov 12, 2019
f331ec4
appveyor: fix broken build
pquentin Nov 12, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion _travis/deploy.sh
Expand Up @@ -2,6 +2,6 @@

set -exo pipefail

python3 -m pip install --upgrade twine
python3 -m pip install --upgrade twine wheel
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/* -u $PYPI_USERNAME -p $PYPI_PASSWORD --skip-existing
16 changes: 8 additions & 8 deletions dev-requirements.txt
@@ -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'
2 changes: 1 addition & 1 deletion docs/index.rst
Expand Up @@ -43,7 +43,7 @@ urllib3 can be installed with `pip <https://pip.pypa.io>`_::

Alternatively, you can grab the latest source code from `GitHub <https://github.com/urllib3/urllib3>`_::

$ git clone git://github.com/shazow/urllib3.git
$ git clone git://github.com/urllib3/urllib3.git
$ python setup.py install

Usage
Expand Down
23 changes: 0 additions & 23 deletions dummyserver/certs/client.csr

This file was deleted.

15 changes: 0 additions & 15 deletions dummyserver/certs/client.key

This file was deleted.

21 changes: 0 additions & 21 deletions dummyserver/certs/client.pem

This file was deleted.

15 changes: 0 additions & 15 deletions dummyserver/certs/intermediate.key

This file was deleted.

18 changes: 0 additions & 18 deletions dummyserver/certs/intermediate.pem

This file was deleted.

12 changes: 2 additions & 10 deletions dummyserver/server.py
Expand Up @@ -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"dummy@test.local",
),
}
DEFAULT_CLIENT_NO_INTERMEDIATE_CERTS = {
"certfile": os.path.join(CERTS_PATH, "client_no_intermediate.pem"),
Expand Down Expand Up @@ -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)
Expand All @@ -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")
Expand Down
9 changes: 7 additions & 2 deletions dummyserver/testcase.py
Expand Up @@ -15,8 +15,13 @@


def consume_socket(sock, chunks=65536):
while not sock.recv(chunks).endswith(b"\r\n\r\n"):
pass
consumed = bytearray()
while True:
b = sock.recv(chunks)
consumed += b
if b.endswith(b"\r\n\r\n"):
break
return consumed


class SocketDummyServerTestCase(object):
Expand Down
188 changes: 95 additions & 93 deletions noxfile.py
@@ -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")
2 changes: 1 addition & 1 deletion src/urllib3/_async/connection.py
Expand Up @@ -402,7 +402,7 @@ async def _wrap_socket(self, sock, ssl_context, fingerprint, assert_hostname):
"back to check for a `commonName` for now. This "
"feature is being removed by major browsers and "
"deprecated by RFC 2818. (See "
"https://github.com/shazow/urllib3/issues/497 for "
"https://github.com/urllib3/urllib3/issues/497 for "
"details.)".format(self._host)
),
SubjectAltNameWarning,
Expand Down