Skip to content

Commit

Permalink
Merge pull request #727 from insanum/py310
Browse files Browse the repository at this point in the history
Bump requires-python to ">= 3.10"
  • Loading branch information
dbarnett authored Aug 29, 2024
2 parents 4dabc51 + dd0496f commit 2053a6e
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 31 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ jobs:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
os:
- ubuntu-latest
- macos-latest
Expand Down
10 changes: 5 additions & 5 deletions gcalcli/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# must have underscore so as not to shadow stdlib types.py

from datetime import datetime
from typing import Any, Dict, List, TYPE_CHECKING, TypedDict
from typing import Any, TYPE_CHECKING, TypedDict

if TYPE_CHECKING:
from googleapiclient._apis.calendar.v3.schemas import ( # type: ignore
Expand All @@ -22,8 +22,8 @@ class Event(GoogleEvent):
# XXX: having all_cals available as an invariant would be better than
# setting total=False
class Cache(TypedDict, total=False):
all_cals: List[CalendarListEntry]
all_cals: list[CalendarListEntry]
else:
CalendarListEntry = Dict[str, Any]
Event = Dict[str, Any]
Cache = Dict[str, Any]
CalendarListEntry = dict[str, Any]
Event = dict[str, Any]
Cache = dict[str, Any]
4 changes: 1 addition & 3 deletions gcalcli/conflicts.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from typing import List # python3.9: can just use `list`

from ._types import Event


class ShowConflicts:
active_events: List[Event] = []
active_events: list[Event] = []

def __init__(self, show):
if show:
Expand Down
4 changes: 2 additions & 2 deletions gcalcli/deprecations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import argparse
import functools
from typing import Any, Dict
from typing import Any

from .printer import Printer, valid_color_name

Expand Down Expand Up @@ -69,7 +69,7 @@ def __call__(self, parser, namespace, values, option_string=None):
'action': DeprecatedStoreTrue}}


OPTIONS: Dict[str, Dict[str, Any]] = {
OPTIONS: dict[str, dict[str, Any]] = {
'program': {
"--client_id": {'default': None},
"--client_secret": {'default': None},
Expand Down
3 changes: 1 addition & 2 deletions gcalcli/details.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from collections import OrderedDict
from datetime import datetime
from itertools import chain
from typing import List # python3.9: can just use `list`

from dateutil.parser import isoparse, parse

Expand Down Expand Up @@ -33,7 +32,7 @@ class Handler:
"""Handler for a specific detail of an event."""

# list of strings for fieldnames provided by this object
fieldnames: List[str] = []
fieldnames: list[str] = []

@classmethod
def get(cls, event):
Expand Down
4 changes: 2 additions & 2 deletions gcalcli/gcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import sys
import textwrap
import time
from typing import Iterable, List
from typing import Iterable
from unicodedata import east_asian_width

import googleapiclient.http
Expand Down Expand Up @@ -47,7 +47,7 @@
class GoogleCalendarInterface:

cache: Cache = {}
all_cals: List[CalendarListEntry] = []
all_cals: list[CalendarListEntry] = []
now = datetime.now(tzlocal())
agenda_length = 5
conflicts_lookahead_days = 30
Expand Down
8 changes: 4 additions & 4 deletions gcalcli/ics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import importlib.util
import io
from datetime import datetime
from typing import Any, Dict, List, Optional
from typing import Any, Optional

from gcalcli.printer import Printer
from gcalcli.utils import localize_datetime

EventBody = Dict[str, Any]
EventBody = dict[str, Any]


def has_vobject_support() -> bool:
Expand All @@ -17,10 +17,10 @@ def has_vobject_support() -> bool:

def get_events(
ics: io.TextIOBase, verbose: bool, default_tz: str, printer: Printer
) -> List[Optional[EventBody]]:
) -> list[Optional[EventBody]]:
import vobject

events: List[Optional[EventBody]] = []
events: list[Optional[EventBody]] = []
for v in vobject.readComponents(ics):
events.extend(
CreateEventFromVOBJ(
Expand Down
11 changes: 4 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "gcalcli"
dynamic = ["version"]
requires-python = ">= 3.8"
requires-python = ">= 3.10"
readme = "README.md"
license = { text = "MIT" }
authors = [
Expand All @@ -26,12 +26,12 @@ classifiers = [
"Programming Language :: Python :: 3",
]
dependencies = [
"python-dateutil",
"argcomplete",
"google-api-python-client>=1.4",
"httplib2",
"google_auth_oauthlib",
"httplib2",
"parsedatetime",
"argcomplete",
"python-dateutil",
# dev dependencies
"google-api-python-client-stubs",
"types-python-dateutil",
Expand Down Expand Up @@ -59,9 +59,6 @@ version_file = "gcalcli/_version.py"
[project.scripts]
gcalcli = "gcalcli.cli:main"

[tool.distutils.bdist_wheel]
universal = true

[tool.ruff]
line-length = 80
extend-exclude = ["tests/cli/"]
Expand Down
6 changes: 2 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
requires =
tox>=4
envlist = lint, type, py3{8,9,10,11,12}, cli
envlist = lint, type, py3{10,11,12}, cli

[testenv]
usedevelop=true
Expand Down Expand Up @@ -37,6 +37,4 @@ commands =
python =
3.12 = py312, lint, type, cli
3.11 = py311
3.10 = py310
3.9 = py39
3.8 = py38, type
3.10 = py310, type

0 comments on commit 2053a6e

Please sign in to comment.