Skip to content

[dateparser] Update to 1.5.* - #16741

Open
hoangchunghien wants to merge 1 commit into
python:mainfrom
hoangchunghien:dateparser-1.5
Open

hoangchunghien wants to merge 1 commit into
python:mainfrom
hoangchunghien:dateparser-1.5

Conversation

@hoangchunghien

Copy link
Copy Markdown
Contributor

Closes: #16701

stubtest failed on the stubsabot bump with 37 errors. 1.5.0 is a larger release than usual (two new calendars, parts of the day, new settings and several removals), so this updates the stubs to match:

  • New public names: PartOfDay and PartsOfDay (re-exported from dateparser, defined in dateparser._parts_of_day), DateData.parts and DateData.part_of_day, and the STRICT_DATE_ORDER, TIMEZONE_ABBREVIATIONS, PARTS_OF_DAY and USE_GIVEN_LANGUAGE_ORDER settings.
  • DateData.period can now be "quarter" or "part_of_day".
  • search_dates() takes date_formats and add_period. The overloads cover the four tuple shapes that add_detected_language and add_period produce.
  • New stubs for dateparser.calendars.minguo and dateparser.calendars.french_republican. The French Republican module imports convertdate, which stubtest does not install, so it joins hijri and jalali in the allowlist.
  • pop_tz_offset_from_string() takes settings, with the same two overloads as the runtime.
  • Removed upstream: Locale.to_parserinfo(), HijriDate.weekday(), _DateLocaleParser.parse() and _parser.parse(). Settings no longer caches instances, so the stub drops __new__.
  • Marked @deprecated where 1.5.0 now emits a FutureWarning: Settings.get_key(), utils.registry(), convert_to_local_tz(), build_tz_offsets(), get_week_start(), get_week_end(), and calling generate_time_span() without base_date or settings.
  • The _NonGregorianDate protocol uses read-only properties and drops weekday(), because the Minguo parser uses datetime.date and HijriDate no longer has weekday().

One new allowlist entry, PartOfDay.__new__: the runtime class is (str, Enum), so stubtest compares str.__new__ in the stub with Enum.__new__ at runtime.

tests/stubtest_third_party.py dateparser passes against 1.5.0; mypy_test.py, pyright_test.py and pre-commit pass for the package.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant