Skip to content

Commit

Permalink
Merge pull request #634 from kloczek/main
Browse files Browse the repository at this point in the history
drop python<=3.7 support
  • Loading branch information
niccokunzmann committed Jun 25, 2024
2 parents 53cfd78 + f287455 commit 6122447
Show file tree
Hide file tree
Showing 20 changed files with 14 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
matrix:
config:
# [Python version, tox env]
- ["3.7", "py37"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- ["3.10", "py310"]
- ["pypy-3.9", "pypy3"]
- ["3.10", "docs"]
- ["3.11", "py311"]
- ["3.12", "py312"]

runs-on: ubuntu-latest
name: ${{ matrix.config[1] }}
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
'pytz',
# install requirements depending on python version
# see https://www.python.org/dev/peps/pep-0508/#environment-markers
'backports.zoneinfo; python_version == "3.7" or python_version == "3.8"',
'backports.zoneinfo; python_version < "3.9"',
'tzdata'
]

Expand All @@ -39,11 +39,11 @@
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
Expand All @@ -57,7 +57,7 @@
package_dir={'': 'src'},
include_package_data=True,
zip_safe=False,
python_requires=">=3.7",
python_requires=">=3.8",
install_requires=install_requires,
entry_points = {'console_scripts': ['icalendar = icalendar.cli:main']},
extras_require={
Expand Down
3 changes: 2 additions & 1 deletion src/icalendar/cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
from icalendar.prop import vText, vDDDLists
from icalendar.timezone import tzp
from typing import Tuple, List
import dateutil.rrule, dateutil.tz
import dateutil.rrule
import dateutil.tz
import os


Expand Down
2 changes: 1 addition & 1 deletion src/icalendar/prop.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def __init__(self, dt):
self.params = Parameters({'value': 'PERIOD'})

tzid = tzid_from_dt(dt) if isinstance(dt, (datetime, time)) else None
if not tzid is None and tzid != 'UTC':
if tzid is not None and tzid != 'UTC':
self.params.update({'TZID': tzid})

self.dt = dt
Expand Down
3 changes: 1 addition & 2 deletions src/icalendar/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
import pytest
import icalendar
import pytz
from datetime import datetime
from dateutil import tz
from icalendar.cal import Component, Calendar, Event, ComponentFactory
from icalendar.cal import Component, Calendar
from icalendar.timezone import tzp as _tzp
from icalendar.timezone import TZP
from pathlib import Path
Expand Down
5 changes: 0 additions & 5 deletions src/icalendar/tests/prop/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
from datetime import timedelta
from icalendar.parser import Parameters
import unittest
from icalendar.prop import vDatetime, vDDDTypes
from icalendar.timezone.windows_to_olson import WINDOWS_TO_OLSON
import pytest
from copy import deepcopy
from dateutil import tz


class TestProp(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion src/icalendar/tests/test_cli_tool.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest

from datetime import tzinfo, datetime
from datetime import datetime
from icalendar import Calendar, cli
try:
import zoneinfo
Expand Down
3 changes: 1 addition & 2 deletions src/icalendar/tests/test_components_break_on_bad_ics.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest

from icalendar import Event, Calendar

def test_ignore_exceptions_on_broken_events_issue_104(events):
''' Issue #104 - line parsing error in a VEVENT
Expand All @@ -23,7 +22,7 @@ def test_rdate_dosent_become_none_on_invalid_input_issue_464(events):
https://github.com/collective/icalendar/issues/464
'''
assert ('RDATE', 'Expected period format, got: 199709T180000Z/PT5H30M') in events.issue_464_invalid_rdate.errors
assert not b'RDATE:None' in events.issue_464_invalid_rdate.to_ical()
assert b'RDATE:None' not in events.issue_464_invalid_rdate.to_ical()

@pytest.mark.parametrize('calendar_name', [
'big_bad_calendar',
Expand Down
3 changes: 0 additions & 3 deletions src/icalendar/tests/test_icalendar.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import icalendar
import os
import textwrap
from ..parser import Contentlines, Contentline, Parameters, foldline
from ..parser import q_join, q_split, dquote
from ..prop import vText
Expand Down
5 changes: 0 additions & 5 deletions src/icalendar/tests/test_issue_116.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import unittest

import datetime
import icalendar
import os
import pytest
from dateutil import tz


def test_issue_116():
Expand Down
1 change: 0 additions & 1 deletion src/icalendar/tests/test_issue_165_missing_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
https://github.com/collective/icalendar/issues/165
'''
from icalendar import Calendar

def test_issue_165_missing_event(calendars):
events = list(calendars.issue_165_missing_event.walk('VEVENT'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
https://github.com/collective/icalendar/issues/168
'''
from icalendar import Calendar

def test_issue_168_parsing_inavlid_calendars_no_warning(calendars):
expected_error = (None, "Content line could not be parsed into parts: 'X-APPLE-RADIUS=49.91307046514149': X-APPLE-RADIUS=49.91307046514149")
Expand Down
1 change: 0 additions & 1 deletion src/icalendar/tests/test_issue_27_period.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
https://github.com/collective/icalendar/issues/27
'''
from icalendar import Calendar

def test_issue_27_multiple_periods(calendars):
free_busy = list(calendars.issue_27_multiple_periods_in_freebusy_multiple_freebusies.walk('VFREEBUSY'))[0]
Expand Down
1 change: 0 additions & 1 deletion src/icalendar/tests/test_issue_350.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
https://github.com/collective/icalendar/issues/350
'''
from icalendar import Calendar

def test_issue_350(calendars):
calendar = list(calendars.issue_350.walk('X-COMMENT'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

def test_vBoolean_can_be_used_as_parameter_issue_500(events):
'''https://github.com/collective/icalendar/issues/500'''
attendee = vCalAddress(f'mailto:someone@example.com')
attendee = vCalAddress('mailto:someone@example.com')
attendee.params['rsvp'] = vBoolean(True)
event = Event()
event.add('attendee', attendee)
Expand Down
1 change: 0 additions & 1 deletion src/icalendar/tests/test_multiple.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""An example with multiple VCALENDAR components"""
from icalendar import Calendar
from icalendar.prop import vText


Expand Down
2 changes: 0 additions & 2 deletions src/icalendar/tests/test_property_params.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import pytest
from icalendar import Calendar, Event, Parameters, vCalAddress

import unittest
import icalendar
import re

@pytest.mark.parametrize('parameter, expected', [
Expand Down
2 changes: 0 additions & 2 deletions src/icalendar/tests/test_timezoned.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import unittest

import datetime
import dateutil.parser
import icalendar
import os
from icalendar.prop import tzid_from_dt


Expand Down
5 changes: 2 additions & 3 deletions src/icalendar/tests/test_unit_cal.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import itertools
from datetime import datetime
from datetime import timedelta
import unittest

import pytest

import icalendar
import re
from icalendar.cal import Component, Calendar, Event, ComponentFactory
from icalendar import prop, cal
from icalendar.cal import Component, Calendar, Event
from icalendar import prop
from icalendar.prop import tzid_from_dt


Expand Down
5 changes: 1 addition & 4 deletions src/icalendar/tests/test_with_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_docstring_of_python_file(module_name):
if filename.lower().endswith(".rst")
]
except FileNotFoundError:
raise EnvironmentError("Could not find the documentation - remove the build folder and try again.")
raise OSError("Could not find the documentation - remove the build folder and try again.")

@pytest.mark.parametrize("filename", [
"README.rst",
Expand All @@ -73,6 +73,3 @@ def test_documentation_file(document, zoneinfo_only, env_for_doctest):

def test_can_import_zoneinfo(env_for_doctest):
"""Allow importing zoneinfo for tests."""
import pytz
import zoneinfo
from dateutil import tz

0 comments on commit 6122447

Please sign in to comment.