-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust for and require icalendar>=6.0.0
#1364
base: master
Are you sure you want to change the base?
Conversation
|
3f42fc4
to
d38921d
Compare
For timezone functionalities icalendar can use both pytz and zoneinfo, preferring zoneinfo. We rely on pytz for several attributes, stick to it. Fixes pimutils#1361. Should obsolete pimutils#1363.
Per "Hacking" document.
d38921d
to
31884be
Compare
In icalendar-6.0.0 windows_to_olson is part of icalendar.timezone.
icalendar>=6.0.0
The «docs/readthedocs.org:khal — Read the Docs build failed!» failures are probably unrelated to that. That's also tracked via #1356. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
icalendar 6.0.0 was only released at the end of September, so may not have propagated as far as we'd like.
Other than that, I like it.
Mmm, that's a good point. Maybe we can try to do some dance as follows... For try:
icalendar.use_pytz()
except AttributeError:
# assumes icalendar<6.0.0, only pytz is used
pass While for try:
from icalendar.timezone import windows_to_olson
except ImportError:
from icalendar import windows_to_olson ...and then replace the (Beware, both only written as comment, not really tested!) But, in particular the latter... IMHO is not very nice! However, if you think it's worth to be more version agnostic I'm happy to adjust the patch as described in this comment!
Thank you! |
Those could certainly work. Remembering to take them about later would be a pain. There's nothing strictly wrong with "New khal needs icalendar >=6. If you don't have it stick with the last version of khal" I think it's best to see if Christian or Hugo have an opinion on this (deliberately not tagging them for now) |
This was submitted upstream but hasn't been merged yet because they are trying to figure out how to maintain backwards compatibility with older py3-icalendar versions. pimutils/khal#1364
This PR makes khal compatible with icalendar 6.0.0 and newer (and start to require it!).
In particular:
icalendar
can use bothpytz
andzoneinfo
, preferringzoneinfo
. We rely onpytz
for several attributes, stick to it. This fixes Support icalendar v6 #1361 and should obsolete Replace tz.localize with date.replace #1363.icalendar.windows_to_olson
is no longer available, we need to refer to it asicalendar.timezone.windows_to_olson
With this PR all the tests passes again with icalendar>=6.0.0.