Skip to content

Commit

Permalink
Update to dateparse 2.9.0post0 (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarans authored Jun 12, 2024
1 parent 3b19b81 commit 62676cf
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 17 deletions.
8 changes: 4 additions & 4 deletions .config/pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
default_language_version:
python: python3.11
python: python3.12
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
exclude: test_loader.py
- id: end-of-file-fixer
exclude: (test_csv_processing_blanks.csv|test.txt)
- id: check-ast
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.2
rev: v0.4.8
hooks:
# Run the linter.
- id: ruff
Expand All @@ -19,7 +19,7 @@ repos:
- id: ruff-format
args: [--config, .config/ruff.toml]
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.1.38
rev: 0.2.10
hooks:
# Run the pip compile
- id: pip-compile
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ dependencies = [
"jsonlines>=4.0.0",
# /end frictionless extras
"loguru",
"python-dateutil==2.8.2",
"python-dateutil==2.9.0.post0",
"ratelimit",
"requests-file",
"ruamel.yaml",
Expand Down
36 changes: 29 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ attrs==23.2.0
# jsonschema
# referencing
beautifulsoup4==4.12.3
# via hdx-python-utilities (pyproject.toml)
certifi==2024.6.2
# via requests
cfgv==3.4.0
Expand All @@ -26,12 +27,15 @@ distlib==0.3.8
dnspython==2.6.1
# via email-validator
email-validator==2.1.1
# via hdx-python-utilities (pyproject.toml)
et-xmlfile==1.1.0
# via openpyxl
filelock==3.14.0
# via virtualenv
frictionless==5.17.0
# via hdx-python-utilities (pyproject.toml)
html5lib==1.1
# via hdx-python-utilities (pyproject.toml)
humanize==4.9.0
# via frictionless
identify==2.5.36
Expand All @@ -40,22 +44,26 @@ idna==3.7
# via
# email-validator
# requests
ijson==3.2.3
ijson==3.3.0
# via hdx-python-utilities (pyproject.toml)
iniconfig==2.0.0
# via pytest
isodate==0.6.1
# via frictionless
jinja2==3.1.4
# via frictionless
jsonlines==4.0.0
# via hdx-python-utilities (pyproject.toml)
jsonschema==4.22.0
# via
# frictionless
# tableschema-to-template
jsonschema-specifications==2023.12.1
# via jsonschema
loguru==0.7.2
# via pytest-loguru
# via
# hdx-python-utilities (pyproject.toml)
# pytest-loguru
markdown-it-py==3.0.0
# via rich
marko==2.0.3
Expand All @@ -67,7 +75,8 @@ mdurl==0.1.2
nodeenv==1.9.1
# via pre-commit
openpyxl==3.1.3
packaging==24.0
# via hdx-python-utilities (pyproject.toml)
packaging==24.1
# via pytest
petl==1.7.15
# via frictionless
Expand All @@ -76,18 +85,25 @@ platformdirs==4.2.2
pluggy==1.5.0
# via pytest
pre-commit==3.7.1
# via hdx-python-utilities (pyproject.toml)
pydantic==2.7.3
# via frictionless
pydantic-core==2.18.4
# via pydantic
pygments==2.18.0
# via rich
pytest==8.2.2
# via pytest-cov
# via
# hdx-python-utilities (pyproject.toml)
# pytest-cov
pytest-cov==5.0.0
# via hdx-python-utilities (pyproject.toml)
pytest-loguru==0.4.0
python-dateutil==2.8.2
# via frictionless
# via hdx-python-utilities (pyproject.toml)
python-dateutil==2.9.0.post0
# via
# hdx-python-utilities (pyproject.toml)
# frictionless
python-slugify==8.0.4
# via frictionless
pyyaml==6.0.1
Expand All @@ -96,6 +112,7 @@ pyyaml==6.0.1
# pre-commit
# tableschema-to-template
ratelimit==2.2.1
# via hdx-python-utilities (pyproject.toml)
referencing==0.35.1
# via
# jsonschema
Expand All @@ -105,6 +122,7 @@ requests==2.32.3
# frictionless
# requests-file
requests-file==2.1.0
# via hdx-python-utilities (pyproject.toml)
rfc3986==2.0.0
# via frictionless
rich==13.7.1
Expand All @@ -114,6 +132,7 @@ rpds-py==0.18.1
# jsonschema
# referencing
ruamel-yaml==0.18.6
# via hdx-python-utilities (pyproject.toml)
ruamel-yaml-clib==0.2.8
# via ruamel-yaml
shellingham==1.5.4
Expand All @@ -130,13 +149,14 @@ soupsieve==2.5
stringcase==1.2.0
# via frictionless
tableschema-to-template==0.0.13
# via hdx-python-utilities (pyproject.toml)
tabulate==0.9.0
# via frictionless
text-unidecode==1.3
# via python-slugify
typer==0.12.3
# via frictionless
typing-extensions==4.12.1
typing-extensions==4.12.2
# via
# frictionless
# pydantic
Expand All @@ -151,6 +171,8 @@ virtualenv==20.26.2
webencodings==0.5.1
# via html5lib
xlrd==2.0.1
# via hdx-python-utilities (pyproject.toml)
xlsxwriter==3.2.0
# via tableschema-to-template
xlwt==1.3.0
# via hdx-python-utilities (pyproject.toml)
14 changes: 9 additions & 5 deletions src/hdx/utilities/dateparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,10 @@ def append(self, val, label=None):
self.ystridx = len(self) - 1

def _resolve_from_stridxs(self, strids):
"""Try to resolve the identities of year/month/day elements using
ystridx, mstridx, and dstridx, if enough of these are specified."""
"""
Try to resolve the identities of year/month/day elements using
ystridx, mstridx, and dstridx, if enough of these are specified.
"""
if len(self) == 3 and len(strids) == 2:
# we can back out the remaining stridx value
missing = [x for x in range(3) if x not in strids.values()]
Expand Down Expand Up @@ -301,8 +303,9 @@ def _parse(
fuzzy=False,
fuzzy_with_tokens=False,
):
"""Private method which performs the heavy lifting of parsing, called
from ``parse()``, which passes on its ``kwargs`` to this function.
"""
Private method which performs the heavy lifting of parsing, called from
``parse()``, which passes on its ``kwargs`` to this function.
:param timestr:
The string to parse.
Expand Down Expand Up @@ -553,7 +556,8 @@ def _recombine_skipped_date(self, tokens, skipped_idxs):
def parse(
timestr, default=None, ignoretz=False, tzinfos=None, **kwargs
): # pragma: no cover
"""Parse the date/time string into a :class:`datetime.datetime` object.
"""
Parse the date/time string into a :class:`datetime.datetime` object.
:param timestr:
Any date/time string using the supported formats.
Expand Down

0 comments on commit 62676cf

Please sign in to comment.