Remove iso8601 dependency#2213
Open
waketzheng wants to merge 2 commits into
Open
Conversation
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.
Description
This removes the runtime dependency on
iso8601and replaces the fallback datetime parsing path with an internal parser basedon the Python standard library.
The new behavior is:
ciso8601.parse_datetimewhen the optionalaccelextra is installed.tortoise.timezone._parse_datetimewhenciso8601is unavailable.ciso8601, includingZ/zUTC suffixes, compact datetime strings, week dates,and ordinal dates such as
2020-230and2020230.This also updates the lockfile, removes
iso8601from tests, and adds a Windows CI smoke job for theaccelextra now thatciso8601is no longer excluded on Windows.Motivation and Context
iso8601was only used as a fallback parser whenciso8601was unavailable. That makes it a runtime dependency for a narrowpath that can now be covered by Python's standard library on Tortoise ORM's supported Python versions.
Keeping
iso8601has become hard to justify:datetime.fromisoformat().wrapper.
ciso8601, while non-accelerated installs depend on a separatethird-party parser with subtly different behavior.
This change keeps the fast path unchanged for users who install
accel, while making the non-accelerated path self-containedand easier to audit. The fallback parser intentionally preserves the common
ciso8601formats that matter for existing TortoiseORM behavior, so removing
iso8601should not narrow normal datetime input support.The
ciso8601platform marker was also relaxed to allow Windows CPython installs. A Windows CI smoke job was added to verifythat the
accelextra installs and that the accelerated parser is actually selected on Windows.How Has This Been Tested?
Tested locally on macOS with Python 3.14.2.
Commands run: