Skip to content

Commit 227e9b5

Browse files
authored
MAINT: actually bumping minimum python to 3.9 (#126)
* MAINT: actually bumping minimum python to 3.9 * MAINT: making ruff happy, not clear why it didn't complained earlier
1 parent 83a1c5c commit 227e9b5

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55
[project]
66
name = "yaml2ics"
77
version = "0.3rc1.dev0"
8-
requires-python = ">=3.8"
8+
requires-python = ">=3.9"
99
authors = [{name = "Scientific Python Developers"}]
1010
readme = "README.md"
1111
license = {file = "LICENSE"}

tests/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import datetime
22
import io
33
import os
4+
import zoneinfo
45

56
import pytest
6-
import zoneinfo
77

88
from yaml2ics import event_from_yaml, files_to_events, main
99

yaml2ics.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
import datetime
99
import os
1010
import sys
11+
import zoneinfo
1112

1213
import dateutil
1314
import dateutil.rrule
1415
import ics
1516
import yaml
16-
import zoneinfo
1717
from dateutil.tz import gettz as _gettz
1818

1919
interval_type = {
@@ -70,6 +70,7 @@ def event_from_yaml(event_yaml: dict, tz: datetime.tzinfo = None) -> ics.Event:
7070

7171
if tz is None:
7272
tz = dateutil.tz.UTC
73+
7374
if "timezone" in d:
7475
tzname = d.pop("timezone")
7576
tz = gettz(tzname)
@@ -95,6 +96,9 @@ def event_from_yaml(event_yaml: dict, tz: datetime.tzinfo = None) -> ics.Event:
9596
# or it was inferred from event start time.
9697
tz = event.timespan.begin_time.tzinfo
9798

99+
if not tz:
100+
tz = dateutil.tz.UTC
101+
98102
# Handle all-day events
99103
if not ("duration" in d or "end" in d):
100104
event.make_all_day()

0 commit comments

Comments
 (0)