hyper icon indicating copy to clipboard operation
hyper copied to clipboard

python 3.7

Open peterbe opened this issue 5 years ago • 2 comments

I'm getting a suppressed traceback though:

Full tox -e py37 output ▶ tox -e py37 GLOB sdist-make: /Users/peterbe/dev/PYTHON/hyper/setup.py py37 inst-nodeps: /Users/peterbe/dev/PYTHON/hyper/.tox/.tmp/package/1/hyper-0.8.0.dev0.zip py37 installed: apipkg==1.5,atomicwrites==1.3.0,attrs==19.1.0,brotlipy==0.7.0,certifi==2019.3.9,cffi==1.12.3,chardet==3.0.4,coverage==4.5.3,execnet==1.6.0,h2==2.6.2,hpack==3.0.0,hyper==0.8.0.dev0,hyperframe==3.2.0,idna==2.8,mock==2.0.0,more-itertools==7.0.0,pbr==5.1.3,pluggy==0.9.0,py==1.8.0,pycparser==2.19,pytest==4.4.1,pytest-cov==2.6.1,pytest-forked==1.0.2,pytest-xdist==1.28.0,requests==2.21.0,rfc3986==1.3.1,six==1.12.0,urllib3==1.24.2 py37 run-test-pre: PYTHONHASHSEED='2726258995' py37 run-test: commands[0] | coverage run -m py.test /Users/peterbe/dev/PYTHON/hyper/test/ ================================================================================================ test session starts ================================================================================================ platform darwin -- Python 3.7.3, pytest-4.4.1, py-1.8.0, pluggy-0.9.0 cachedir: .tox/py37/.pytest_cache rootdir: /Users/peterbe/dev/PYTHON/hyper plugins: xdist-1.28.0, forked-1.0.2, cov-2.6.1 collected 303 items

test/test_SSLContext.py ..... [ 1%] test/test_abstraction.py .... [ 2%] test/test_cli.py ................................ [ 13%] test/test_headers.py ............................ [ 22%] test/test_http11.py ............................................................. [ 42%] test/test_http20.py . [ 43%] test/test_hyper.py ....Exception in thread Thread-1: Traceback (most recent call last): File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/Users/peterbe/dev/PYTHON/hyper/test/server.py", line 103, in run self.server = self._start_server() File "/Users/peterbe/dev/PYTHON/hyper/test/server.py", line 96, in _start_server self.socket_handler(sock) File "/Users/peterbe/dev/PYTHON/hyper/test/test_http20.py", line 21, in socket_handler sock = listener.accept()[0] File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 1166, in accept server_side=True) File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 412, in wrap_socket session=session File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 853, in _create self.do_handshake() File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 1117, in do_handshake self._sslobj.do_handshake() ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1056)

.................................................................................... [ 72%] test/test_hyper_SSLContext.py s [ 72%] test/test_import.py s. [ 73%] test/test_integration.py ................................... [ 84%] test/test_integration_http11.py ............ [ 88%] test/test_parser.py .... [ 90%] test/test_socket.py ................. [ 95%] test/test_ssl_socket.py ... [ 96%] test/test_windowmanager.py .......... [100%]

================================================================================================= warnings summary ================================================================================================== hyper/http11/connection.py:13 hyper/http11/connection.py:13 /Users/peterbe/dev/PYTHON/hyper/hyper/http11/connection.py:13: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working from collections import Iterable, Mapping

.tox/py37/lib/python3.7/site-packages/hyperframe/flags.py:14 /Users/peterbe/dev/PYTHON/hyper/.tox/py37/lib/python3.7/site-packages/hyperframe/flags.py:14: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working class Flags(collections.MutableSet):

hyper/common/headers.py:13 /Users/peterbe/dev/PYTHON/hyper/hyper/common/headers.py:13: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working class HTTPHeaderMap(collections.MutableMapping):

test/test_hyper.py::TestHyperConnection::test_closed_connections_are_reset /Users/peterbe/dev/PYTHON/hyper/hyper/http20/connection.py:465: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead log.warn("GoAway frame could not be sent: %s" % e)

test/test_hyper.py::TestServerPush::test_reset_pushed_streams_when_push_disabled test/test_hyper.py::TestUpgradingPush::test_reset_pushed_streams_when_push_disabled /Users/peterbe/dev/PYTHON/hyper/hyper/http20/connection.py:843: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead stream_id, e)

-- Docs: https://docs.pytest.org/en/latest/warnings.html ================================================================================ 301 passed, 2 skipped, 7 warnings in 10.24 seconds ================================================================================= py37 run-test: commands[1] | coverage report Name Stmts Miss Cover Missing

hyper/init.py 13 0 100% hyper/cli.py 143 0 100% hyper/common/init.py 1 0 100% hyper/common/bufsocket.py 89 0 100% hyper/common/connection.py 34 0 100% hyper/common/decoder.py 21 0 100% hyper/common/exceptions.py 25 0 100% hyper/common/headers.py 94 0 100% hyper/common/util.py 27 0 100% hyper/contrib.py 77 0 100% hyper/http11/init.py 1 0 100% hyper/http11/connection.py 200 0 100% hyper/http11/parser.py 35 0 100% hyper/http11/response.py 146 0 100% hyper/http20/init.py 1 0 100% hyper/http20/connection.py 291 0 100% hyper/http20/errors.py 23 0 100% hyper/http20/exceptions.py 14 0 100% hyper/http20/response.py 91 0 100% hyper/http20/stream.py 131 0 100% hyper/http20/util.py 21 0 100% hyper/http20/window.py 27 0 100% hyper/tls.py 47 0 100%

TOTAL 1552 0 100% ______________________________________________________________________________________________________ summary ______________________________________________________________________________________________________ py37: commands succeeded congratulations :)

peterbe avatar Apr 24 '19 13:04 peterbe

For the record, to make that warning go away you just...

▶ pip install ndg-httpsclient
Collecting ndg-httpsclient
...
Requirement already satisfied: pycparser in /Users/peterbe/virtualenvs/hyper/lib/python3.7/site-packages (from cffi!=1.11.3,>=1.8->cryptography>=2.3->PyOpenSSL->ndg-httpsclient) (2.19)
Installing collected packages: asn1crypto, cryptography, PyOpenSSL, pyasn1, ndg-httpsclient
Successfully installed PyOpenSSL-19.0.0 asn1crypto-0.24.0 cryptography-2.6.1 ndg-httpsclient-0.5.1 pyasn1-0.4.5

So what does that mean? That ndg-httpsclient needs to be mentioned as a requirement in setup.py?

peterbe avatar Apr 24 '19 13:04 peterbe

Also, I didn't do any extensive manual usage/testing BEFORE adding ngd-httpsclient (and its peers) but I was able to use hyper for a simple GET before on a https:// site.

peterbe avatar Apr 24 '19 13:04 peterbe