Skip to content
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

fix: use floating events if not tz is set #133

Merged
merged 5 commits into from
Sep 8, 2024

Conversation

eigenmannmartin
Copy link
Member

@eigenmannmartin eigenmannmartin commented Aug 29, 2024

What was done:

Copy link

codecov bot commented Sep 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.82%. Comparing base (32848e4) to head (45aaf61).
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #133      +/-   ##
==========================================
+ Coverage   91.22%   91.82%   +0.59%     
==========================================
  Files           4        4              
  Lines         376      379       +3     
  Branches       98      100       +2     
==========================================
+ Hits          343      348       +5     
+ Misses         14       13       -1     
+ Partials       19       18       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -22,7 +22,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry==1.1.11
pip install poetry==1.8.3
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why: updated poetry

@@ -179,7 +180,16 @@ def create_event(component, utc_default):
event.start = component.get("dtstart").dt
# The RFC specifies that the TZID parameter must be specified for datetime or time
# Otherwise we set a default timezone (if only one is set with VTIMEZONE) or utc
event.floating = type(component.get("dtstart").dt) == date and utc_default
if not strict:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why: allow backward compatibility

@@ -323,15 +333,14 @@ def parse_events(

found = []

def add_if_not_exception(event):
def is_not_exception(date):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why: less out of scope variable access

if not event.recurrence_id and (event.uid, event.start) in [
(f.uid, f.recurrence_id) for f in found
]:
if not event.recurrence_id and (
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why: black wanted it to reformat

@@ -795,3 +835,29 @@ def test_multi_exdate_same_line(self):
self.assertEqual(evs[3].start, datetime(2022, 4, 22, 11, 0, 0, tzinfo=tz))
self.assertEqual(evs[4].start, datetime(2022, 4, 29, 11, 0, 0, tzinfo=tz))
# parsing stops at 2022-05-01

def test_google_2024(self):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why: google changed it's ics output and now includes timezones

@eigenmannmartin eigenmannmartin merged commit 593e026 into master Sep 8, 2024
4 checks passed
@eigenmannmartin eigenmannmartin deleted the feat/broken-floating branch September 8, 2024 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant