This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Making icalendar.from_ical independent of pytz and usable with all timezone implementations #441
Labels
You can continue the conversation there. Go to discussion →
At the present moment v5.0.0a2, I understand that icalendar components can be constructed as objects with any timezone implementation (
pytz
,zoneinfo
,tz
).As pytz is more and more outdated,
I would like to be able to choose the timezone implementation that we use when we parse an ICS file.
At the moment, I believe that this is the step forward to make the icalendar step in up to the advances Python developers have made with the latest timezone implementations.
Proposal 1
Proposal for the interface:
Any object returned from these calls should not use pytz but the timezone specified.
Proposal 2
As icalendar has a global state to parse timezones set to pytz, we could set an other global default:
The global default will be something like a lazy pytz (as proposed by #294) that imports pytz only if no other implementation is set.
Calling
icalendar.set_timezone_implementation
will set the default parameter from Proposal 1.Implementation
As we use pytest to run the tests and @jacadzaca is already heavily refactoring the tests, see #400, we can use a parameter for parsing to pass the desired timezone implementation.
Parametrizing timezone implementations shows that pytz will stand out and always look a bit different.
The recurring-ical-events library shows that test parametrization can be used to run all tests for pytz and zoneinfo.
Datetime/Timezone implementations
These timezone implementations should be supported:
pytz
zoneinfo
/backports.zoneinfo
arrow
library #181Related
Comments and ideas are very much appreciated on this as this is a deep change - feels like it to me. Also, I wrote this now without reading through all the related issues. Please comment.
The text was updated successfully, but these errors were encountered: