Skip to content

Commit

Permalink
setup fix: make backports-datetime-fromisoformat optional
Browse files Browse the repository at this point in the history
  • Loading branch information
adbar committed Sep 5, 2023
1 parent b304b79 commit 4eb5310
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion htmldate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
from .core import find_date


if version_info.minor < 11:
try:
from backports.datetime_fromisoformat import MonkeyPatch # type: ignore

MonkeyPatch.patch_fromisoformat()
except ImportError:

Check notice

Code scanning / CodeQL

Empty except Note

'except' clause does nothing but pass and there is no explanatory comment.
pass

logging.getLogger(__name__).addHandler(logging.NullHandler())
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# some problems with installation solved this way
extras = {
"speed": [
"backports-datetime-fromisoformat; python_version < '3.11'",
"cchardet >= 2.1.7; python_version < '3.11'", # build issue
"faust-cchardet >= 2.1.19; python_version >= '3.11'", # fix for build
"urllib3[brotli]",
Expand Down Expand Up @@ -114,7 +115,6 @@ def get_version(package):
include_package_data=True,
python_requires=">=3.6",
install_requires=[
"backports-datetime-fromisoformat; python_version < '3.11'",
"charset_normalizer >= 3.0.1; python_version < '3.7'",
"charset_normalizer >= 3.2.0; python_version >= '3.7'",
"dateparser >= 1.1.2", # 1.1.3+ slower
Expand Down

0 comments on commit 4eb5310

Please sign in to comment.