Skip to content

Commit

Permalink
maintenance: focus on Python 3.8+ (#153)
Browse files Browse the repository at this point in the history
* maintenance: focus on modern Python versions

* fix errors
  • Loading branch information
adbar authored Jun 13, 2024
1 parent 7aee7b6 commit dbcc2eb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions htmldate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
3 changes: 1 addition & 2 deletions htmldate/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 3 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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={
Expand Down

0 comments on commit dbcc2eb

Please sign in to comment.