Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If applicable, add screenshots to help explain your problem.
**OS, version, khal version and how you installed it:**
- The output of khal --version: [e.g. `khal, version 0.11.2.dev20+g0c47162.d20230530` ]
- Installation method [e.g. PyPI, git, OS repo]
- python version [e.g. python 3.9]
- python version [e.g. python 3.10]
- OS [e.g. arch]
- Your khal config file
- The versions of your other python packages [e.g. the output of `pip freeze`]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
tox-test: ["default"]

steps:
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Package maintainers and users who have to manually update their installation
may want to subscribe to `GitHub's tag feed
<https://github.com/geier/khal/tags.atom>`_.

0.13.1
0.14.0
======
unreleased

Expand All @@ -18,6 +18,7 @@ unreleased
* NEW DEPENDENCY sphinxfeed-lsaffre
* DROPPED DEPENDENCY sphinxcontrib-newsfeed
* NEW support python 3.14
* DROPPED support for python versions < 3.10.

0.13.0
======
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Features
- fast and easy way to add new events
- ikhal (interactive khal) lets you browse and edit calendars and events
- no support for editing the timezones of events yet
- works with python 3.9+
- works with python 3.10+
- khal should run on all major operating systems [1]_

.. [1] except for Microsoft Windows
Expand Down
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Features
- ikhal (interactive khal) lets you browse and edit calendars and events
- only rudimentary support for creating and editing recursion rules
- you cannot edit the timezones of events
- works with python 3.9+
- works with python 3.10+
- khal should run on all major operating systems [1]_

.. [1] except for Microsoft Windows
Expand Down
4 changes: 2 additions & 2 deletions doc/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ or better::

in the unpacked distribution folder.

Since version 0.12.0, *khal* **only supports python 3.9+**. If you have
Since version 0.14.0, *khal* **only supports python 3.10+**. If you have
python 2 and 3 installed in parallel you might need to use `pip3` instead of
`pip` and `python3` instead of `python`. In case your operating system cannot
deal with python 2 and 3 packages concurrently, we suggest installing *khal* in
Expand Down Expand Up @@ -122,7 +122,7 @@ gained.
Requirements
------------

*khal* is written in python and can run on Python 3.9+. It requires a Python
*khal* is written in python and can run on Python 3.10+. It requires a Python
with ``sqlite3`` support enabled (which is usually the case).

If you are installing python via *pip* or from source, be aware that since
Expand Down
8 changes: 0 additions & 8 deletions khal/_compat.py

This file was deleted.

15 changes: 7 additions & 8 deletions khal/calendar_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import calendar
import datetime as dt
from locale import LC_ALL, LC_TIME, getlocale, setlocale
from typing import Optional, Union

from click import style

Expand Down Expand Up @@ -82,7 +81,7 @@ def get_color_list(
def str_highlight_day(
day: dt.date,
calendars: list[str],
hmethod: Optional[str],
hmethod: str | None,
default_color: str,
multiple: str,
multiple_on_overflow: bool,
Expand Down Expand Up @@ -122,8 +121,8 @@ def str_highlight_day(
def str_week(
week: list[dt.date],
today: dt.date,
collection: Optional[CalendarCollection]=None,
hmethod: Optional[str]=None,
collection: CalendarCollection | None=None,
hmethod: str | None=None,
default_color: str='',
multiple: str='',
multiple_on_overflow: bool=False,
Expand Down Expand Up @@ -165,10 +164,10 @@ def str_week(
return strweek


def vertical_month(month: Optional[int]=None,
year: Optional[int]=None,
today: Optional[dt.date]=None,
weeknumber: Union[bool, str]=False,
def vertical_month(month: int | None=None,
year: int | None=None,
today: dt.date | None=None,
weeknumber: bool | str=False,
count: int=3,
firstweekday: int=0,
monthdisplay: str='firstday',
Expand Down
14 changes: 7 additions & 7 deletions khal/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import re
import textwrap
from collections import OrderedDict, defaultdict
from collections.abc import Callable
from shutil import get_terminal_size
from typing import Callable, Optional

import pytz
from click import confirm, echo, prompt, style
Expand Down Expand Up @@ -237,16 +237,16 @@ def get_events_between(

def khal_list(
collection,
daterange: Optional[list[str]] = None,
conf: Optional[dict] = None,
daterange: list[str] | None = None,
conf: dict | None = None,
agenda_format=None,
day_format: Optional[str]=None,
day_format: str | None=None,
once=False,
notstarted: bool = False,
width: Optional[int] = None,
width: int | None = None,
env=None,
datepoint=None,
json: Optional[list] = None,
json: list | None = None,
):
"""returns a list of all events in `daterange`"""
assert daterange is not None or datepoint is not None
Expand Down Expand Up @@ -438,7 +438,7 @@ def new_from_dict(
event_args: EventCreationTypes,
collection: CalendarCollection,
conf,
calendar_name: Optional[str]=None,
calendar_name: str | None=None,
format=None,
env=None,
json=None,
Expand Down
18 changes: 9 additions & 9 deletions khal/custom_types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import datetime as dt
import os
from typing import Literal, Optional, Protocol, TypedDict, Union
from typing import Literal, Protocol, TypedDict

import pytz

Expand All @@ -23,14 +23,14 @@ class LocaleConfiguration(TypedDict):
longdateformat: str
datetimeformat: str
longdatetimeformat: str
weeknumbers: Union[str, bool]
weeknumbers: str | bool
firstweekday: int
unicode_symbols: bool


class SupportsRaw(Protocol):
@property
def uid(self) -> Optional[str]:
def uid(self) -> str | None:
...

@property
Expand All @@ -42,8 +42,8 @@ def raw(self) -> str:
EventTuple = tuple[
str,
str,
Union[dt.date, dt.datetime],
Union[dt.date, dt.datetime],
dt.date | dt.datetime,
dt.date | dt.datetime,
str,
str,
str,
Expand All @@ -68,16 +68,16 @@ class EventCreationTypes(TypedDict):
summary: str
description: str
allday: bool
location: Optional[str]
categories: Optional[Union[str, list[str]]]
repeat: Optional[str]
location: str | None
categories: str | list[str] | None
repeat: str | None
until: str
alarms: str
timezone: pytz.BaseTzInfo
url: str


PathLike = Union[str, os.PathLike]
PathLike = str| os.PathLike

WeekNumbersType = Literal['left', 'right', False]
MonthDisplayType = Literal['firstday', 'firstfullweek']
17 changes: 8 additions & 9 deletions khal/icalendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import logging
from collections import defaultdict
from hashlib import sha256
from typing import Optional, Union

import dateutil.rrule
import icalendar
Expand Down Expand Up @@ -94,15 +93,15 @@ def new_vevent(locale,
dtstart: dt.date,
dtend: dt.date,
summary: str,
timezone: Optional[pytz.BaseTzInfo]=None,
timezone: pytz.BaseTzInfo | None=None,
allday: bool=False,
description: Optional[str]=None,
location: Optional[str]=None,
categories: Optional[Union[list[str], str]]=None,
repeat: Optional[str]=None,
description: str | None=None,
location: str | None=None,
categories: list[str] | str | None=None,
repeat: str | None=None,
until=None,
alarms: Optional[str]=None,
url: Optional[str]=None,
alarms: str | None=None,
url: str | None=None,
) -> icalendar.Event:
"""create a new event

Expand Down Expand Up @@ -217,7 +216,7 @@ def ics_from_list(
def expand(
vevent: icalendar.Event,
href: str='',
) -> Optional[list[tuple[dt.datetime, dt.datetime]]]:
) -> list[tuple[dt.datetime, dt.datetime]] | None:
"""
Constructs a list of start and end dates for all recurring instances of the
event defined in vevent.
Expand Down
16 changes: 8 additions & 8 deletions khal/khalendar/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from collections.abc import Iterable, Iterator
from enum import IntEnum
from os import makedirs, path
from typing import Any, Optional, Union
from typing import Any

import icalendar
import icalendar.cal
Expand Down Expand Up @@ -76,7 +76,7 @@ class SQLiteDb:

def __init__(self,
calendars: Iterable[str],
db_path: Optional[str],
db_path: str | None,
locale: LocaleConfiguration,
) -> None:
assert db_path is not None
Expand Down Expand Up @@ -203,7 +203,7 @@ def update(self,
vevent_str: str,
href: str,
etag: str='',
calendar: Optional[str]=None,
calendar: str | None=None,
) -> None:
"""insert a new or update an existing event into the db

Expand Down Expand Up @@ -252,7 +252,7 @@ def update(self,
self.sql_ex(sql_s, stuple)

def update_vcf_dates(self, vevent_str: str, href: str, etag: str='',
calendar: Optional[str]=None) -> None:
calendar: str | None=None) -> None:
"""insert events from a vcard into the db

This is will parse BDAY, ANNIVERSARY, X-ANNIVERSARY and X-ABDATE fields.
Expand Down Expand Up @@ -408,7 +408,7 @@ def _update_impl(self, vevent: icalendar.cal.Event, href: str, calendar: str) ->
stuple_n = (dbstart, dbend, href, ref, dtype, rec_inst, calendar)
self.sql_ex(recs_sql_s, stuple_n)

def get_ctag(self, calendar: str) -> Optional[str]:
def get_ctag(self, calendar: str) -> str | None:
stuple = (calendar, )
sql_s = 'SELECT ctag FROM calendars WHERE calendar = ?;'
try:
Expand All @@ -423,7 +423,7 @@ def set_ctag(self, ctag: str, calendar: str) -> None:
self.sql_ex(sql_s, stuple)
self.conn.commit()

def get_etag(self, href: str, calendar: str) -> Optional[str]:
def get_etag(self, href: str, calendar: str) -> str | None:
"""get etag for href

return: etag
Expand Down Expand Up @@ -548,8 +548,8 @@ def get_floating(self, start: dt.datetime, end: dt.datetime) -> Iterable[EventTu
"""return floating events between `start` and `end`"""
assert start.tzinfo is None
assert end.tzinfo is None
start_dt: Union[dt.datetime, dt.date]
end_dt: Union[dt.datetime, dt.date]
start_dt: dt.datetime | dt.date
end_dt: dt.datetime | dt.date

start_u = utils.to_unix_time(start)
end_u = utils.to_unix_time(end)
Expand Down
Loading
Loading