diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8de8361d..26552981 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,10 +21,6 @@ jobs: env: [{ MINIMAL: "true" }, { MINIMAL: "false" }] include: # custom python versions - - os: ubuntu-20.04 - python-version: 3.6 - - os: ubuntu-latest - python-version: 3.7 - os: macos-latest python-version: 3.8 - os: macos-latest diff --git a/htmldate/__init__.py b/htmldate/__init__.py index fbee7dc9..123c1a87 100644 --- a/htmldate/__init__.py +++ b/htmldate/__init__.py @@ -14,14 +14,6 @@ from datetime import datetime -try: - datetime.fromisoformat # type: ignore[attr-defined] -# Python 3.6 -except AttributeError: # pragma: no cover - from backports.datetime_fromisoformat import MonkeyPatch # type: ignore - - MonkeyPatch.patch_fromisoformat() - from .core import find_date logging.getLogger(__name__).addHandler(logging.NullHandler()) diff --git a/htmldate/validators.py b/htmldate/validators.py index f298eca7..77111fda 100644 --- a/htmldate/validators.py +++ b/htmldate/validators.py @@ -64,8 +64,7 @@ def is_valid_format(outputformat: str) -> bool: dateobject = datetime(2017, 9, 1, 0, 0) try: dateobject.strftime(outputformat) - # other than ValueError: Python < 3.7 only - except (NameError, TypeError, ValueError) as err: + except (TypeError, ValueError) as err: LOGGER.error("wrong output format or type: %s %s", outputformat, err) return False # test in abstracto (could be the only test) diff --git a/setup.py b/setup.py index c0e8d33d..7597cdd9 100644 --- a/setup.py +++ b/setup.py @@ -80,8 +80,6 @@ def get_version(package): "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -113,18 +111,15 @@ def get_version(package): license="Apache-2.0", packages=["htmldate"], include_package_data=True, - python_requires=">=3.6", + python_requires=">=3.8", install_requires=[ - "backports-datetime-fromisoformat; python_version < '3.7'", - "charset_normalizer >= 3.0.1; python_version < '3.7'", - "charset_normalizer >= 3.3.2; python_version >= '3.7'", + "charset_normalizer >= 3.3.2", "dateparser >= 1.1.2", # 1.1.3+ slower # see tests on Github Actions "lxml == 4.9.2 ; platform_system == 'Darwin' and python_version <= '3.8'", "lxml >= 5.2.2, < 6 ; platform_system != 'Darwin' or python_version > '3.8'", "python-dateutil >= 2.8.2", - "urllib3 >= 1.26, < 2; python_version < '3.7'", - "urllib3 >= 1.26, < 3; python_version >= '3.7'", + "urllib3 >= 1.26, < 3", ], extras_require=extras, entry_points={