Repository navigation
[dateparser] Update to 1.5.* - #16741
Open
hoangchunghien wants to merge 1 commit into
Open
hoangchunghien wants to merge 1 commit into
hoangchunghien wants to merge 1 commit into
Conversation
Contributor
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
PartOfDayandPartsOfDay(re-exported fromdateparser, defined indateparser._parts_of_day),DateData.partsandDateData.part_of_day, and theSTRICT_DATE_ORDER,TIMEZONE_ABBREVIATIONS,PARTS_OF_DAYandUSE_GIVEN_LANGUAGE_ORDERsettings.DateData.periodcan now be"quarter"or"part_of_day".search_dates()takesdate_formatsandadd_period. The overloads cover the four tuple shapes thatadd_detected_languageandadd_periodproduce.dateparser.calendars.minguoanddateparser.calendars.french_republican. The French Republican module importsconvertdate, which stubtest does not install, so it joinshijriandjalaliin the allowlist.pop_tz_offset_from_string()takessettings, with the same two overloads as the runtime.Locale.to_parserinfo(),HijriDate.weekday(),_DateLocaleParser.parse()and_parser.parse().Settingsno longer caches instances, so the stub drops__new__.@deprecatedwhere 1.5.0 now emits aFutureWarning:Settings.get_key(),utils.registry(),convert_to_local_tz(),build_tz_offsets(),get_week_start(),get_week_end(), and callinggenerate_time_span()withoutbase_dateorsettings._NonGregorianDateprotocol uses read-only properties and dropsweekday(), because the Minguo parser usesdatetime.dateandHijriDateno longer hasweekday().One new allowlist entry,
PartOfDay.__new__: the runtime class is(str, Enum), so stubtest comparesstr.__new__in the stub withEnum.__new__at runtime.tests/stubtest_third_party.py dateparserpasses against 1.5.0;mypy_test.py,pyright_test.pyand pre-commit pass for the package.