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

typing_extensions not available in Python 3.8 #421

Closed
blshkv opened this issue Mar 30, 2020 · 3 comments
Closed

typing_extensions not available in Python 3.8 #421

blshkv opened this issue Mar 30, 2020 · 3 comments

Comments

@blshkv
Copy link

blshkv commented Mar 30, 2020

The following line is incorrect:
https://github.com/nabla-c0d3/sslyze/blob/master/setup.py#L95
it should be:

"typing_extensions ; python_version<'3.7'"

typing_extensions does not support python3.7:

The typing module was added to the standard library in Python 3.5 on a provisional basis and will no longer be provisional in Python 3.7.
```
@nabla-c0d3
Copy link
Owner

This part of the documentation seems inaccurate. SSLyze uses specific types introduced in Python 3.8 (Literal and TypedDict) that can only be used in 3.7 via the typing_extensions module:

The typing_extensions module contains both backports of these changes as well as experimental types that will eventually be added to the typing module, such as Protocol or TypedDict.

These types are needed to make the results nicer and easier to process, both for the Python API and the JSON output.

@svengo
Copy link
Contributor

svengo commented Mar 31, 2020

Sslyze doesn't run under python 3.8.2 because typing_extensions is missing.

Using docker:

$ docker run -it --rm python:3.8 bash
root@52909f6cf4d6:/# pip install --upgrade setuptools
Collecting setuptools
  Downloading setuptools-46.1.3-py3-none-any.whl (582 kB)
     |████████████████████████████████| 582 kB 10.5 MB/s
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 45.2.0
    Uninstalling setuptools-45.2.0:
      Successfully uninstalled setuptools-45.2.0
Successfully installed setuptools-46.1.3
root@52909f6cf4d6:/# pip install --upgrade sslyze
Collecting sslyze
  Downloading sslyze-3.0.0.tar.gz (1.0 MB)
     |████████████████████████████████| 1.0 MB 7.7 MB/s
Collecting nassl<3.2.0,>=3.0.0
  Downloading nassl-3.0.0-cp38-cp38-manylinux2010_x86_64.whl (3.2 MB)
     |████████████████████████████████| 3.2 MB 27.6 MB/s
Collecting cryptography==2.5
  Downloading cryptography-2.5-cp34-abi3-manylinux1_x86_64.whl (2.4 MB)
     |████████████████████████████████| 2.4 MB 34.4 MB/s
Collecting tls-parser<1.3.0,>=1.2.0
  Downloading tls_parser-1.2.1.tar.gz (7.6 kB)
Collecting cffi!=1.11.3,>=1.8
  Downloading cffi-1.14.0-cp38-cp38-manylinux1_x86_64.whl (409 kB)
     |████████████████████████████████| 409 kB 33.2 MB/s
Collecting six>=1.4.1
  Downloading six-1.14.0-py2.py3-none-any.whl (10 kB)
Collecting asn1crypto>=0.21.0
  Downloading asn1crypto-1.3.0-py2.py3-none-any.whl (103 kB)
     |████████████████████████████████| 103 kB 41.5 MB/s
Collecting pycparser
  Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)
     |████████████████████████████████| 112 kB 46.9 MB/s
Building wheels for collected packages: sslyze, tls-parser
  Building wheel for sslyze (setup.py) ... done
  Created wheel for sslyze: filename=sslyze-3.0.0-py3-none-any.whl size=1028834 sha256=c8d19b7674db30263f0977d6c991df8065b07eec72f3cb4231de15bfb14e758d
  Stored in directory: /root/.cache/pip/wheels/f0/c0/18/1748b34887f7f9c3ccce857d2313f19f2f986d0e8a79d5bb45
  Building wheel for tls-parser (setup.py) ... done
  Created wheel for tls-parser: filename=tls_parser-1.2.1-py3-none-any.whl size=11382 sha256=a21e4c8c7e8c72a5084cb9dc91abd72e6ac6ff8404c04c3741aabd8509565bed
  Stored in directory: /root/.cache/pip/wheels/d9/74/24/3dec4668265120b22a8b39a35a7d1a289620e3b21692d4f6f7
Successfully built sslyze tls-parser
Installing collected packages: nassl, pycparser, cffi, six, asn1crypto, cryptography, tls-parser, sslyze
Successfully installed asn1crypto-1.3.0 cffi-1.14.0 cryptography-2.5 nassl-3.0.0 pycparser-2.20 six-1.14.0 sslyze-3.0.0 tls-parser-1.2.1
root@52909f6cf4d6:/# python -m sslyze --regular www.yahoo.com:443 www.google.com "[2607:f8b0:400a:807::2004]:443"
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 184, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/local/lib/python3.8/runpy.py", line 143, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/local/lib/python3.8/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/usr/local/lib/python3.8/site-packages/sslyze/__init__.py", line 25, in <module>
    from sslyze.plugins.scan_commands import ScanCommand, ScanCommandType
  File "/usr/local/lib/python3.8/site-packages/sslyze/plugins/scan_commands.py", line 3, in <module>
    from typing_extensions import Literal
ModuleNotFoundError: No module named 'typing_extensions'
root@52909f6cf4d6:/# exit

blshkv pushed a commit to pentoo/pentoo-overlay that referenced this issue Mar 31, 2020
@nabla-c0d3 nabla-c0d3 reopened this Apr 2, 2020
@nabla-c0d3 nabla-c0d3 changed the title typing_extensions: migrate away typing_extensions not available in Python 3.8 Apr 2, 2020
@nabla-c0d3
Copy link
Owner

Fixed in 3.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants