[BUG] Package not working for python < 3.8 #98
- I have read and understood the FAQ
Describe the bug
The latest version (1.0.7) can't be used on an environment with python < 3.8 due to an import error.
- Set-up an environment with python 3.7.
python -m pip install py3-validate-email
- Create a python file with code
from validate_email import validate_email is_valid = validate_email( firstname.lastname@example.org', check_format=True, check_blacklist=True, check_dns=True, dns_timeout=10, check_smtp=True, smtp_timeout=10, smtp_helo_host='my.host.name', email@example.com', smtp_skip_tls=False, smtp_tls_context=None, smtp_debug=False, address_types=frozenset([IPv4Address, IPv6Address]))
- Execute the script
My debug output
from typing import List, Literal, FrozenSet, Union, Type ImportError: cannot import name 'Literal' from 'typing' (/usr/local/lib/python3.7/typing.py)
The script runs on python 3.6 & python 3.7
Please complete the following information:
- OS: Linux
- Your exact
py3-validate-emailmodule version: 1.0.7
- https://docs.python.org/3/library/typing.html#typing.Literal is only available in python 3.8
Damn, thanks for the report.
Is there a way for you to use a newer python version? I'd like to keep the
Literal import and bump the minimum required version for python.
If not, I need to remove the import (or make it optional).
Another option would be to require typing_extensions for this project, which is kinda an overreach: https://pypi.org/project/typing-extensions/
For now we are using version 1.0.5, which does not have this import yet, thus works, but we won't be able to upgrade then...
We will upgrade to python >= 3.8 eventually, but not posible short term.
py3-validate-email 1.0.8 is now available at your convenience.
Please consider upgrading your python version ASAP, since I plan to deprecate older python versions over time, as I can't guarantee keeping them supported in the future.
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?