pyca / pynacl

Python binding to the Networking and Cryptography (NaCl) library
https://pynacl.readthedocs.io/
Apache License 2.0
1.05k stars 231 forks source link

PR #709 breaks python 3.6.1 compatibility #745

Open noamkremen opened 2 years ago

noamkremen commented 2 years ago

https://github.com/pyca/pynacl/pull/709 src/nacl/bindings/crypto_generichash.py:14 from typing import NoReturn, TypeVar

NoReturn was introduced in python 3.6.2, on 3.6.1 fails with: ImportError: cannot import name ‘NoReturn’

reaperhulk commented 2 years ago

Interesting -- what are you running on that has Python 3.6.1 out of curiosity?

reaperhulk commented 2 years ago

The two potential fixes are to drop NoReturn or drop support for < 3.6.2. I've been unable to find a Linux distribution under current support that ships 3.6.0/3.6.1, but I'm interested in your particular case.

noamkremen commented 2 years ago

An internal build environment, via pyenv. typing_extensions makes NoReturn available in python 3.6.1, if you are willing to introduce it as a dependency.

noamkremen commented 2 years ago

To give more context, my specific path to this error was via paramiko, which will pull in the latest (> 1.0.1) pynacl version by default during installation. https://github.com/paramiko/paramiko/blob/7714caf79a09dc455a32c6071dd22ba37c399758/setup.py

yuvalshirav commented 2 years ago

This is an issue with PyGithub (https://github.com/PyGithub/PyGithub) on 3.6.1.

reaperhulk commented 2 years ago

@yuvalshirav are you seeing a lot of 3.6.0/3.6.1 users? I'm inclined to just drop NoReturn but am still considering dropping < 3.6.2 if it's sufficiently rare.