Skip to content

Commit ac98646

Browse files
snopokeclaude
andcommitted
align Python version support with CI matrix
Python 3.9 reached end-of-life in October 2025. CI already tests 3.10 through 3.14, but pyproject still declared support starting at 3.9 and classified up to 3.12 only. - Bump requires-python to >=3.10 and update classifiers to 3.10-3.14 - Drop now-dead conditional deps (importlib-metadata < 3.8, typing-extensions <= 3.9) - Bump ruff target-version to py310 (autofixes Optional[X] -> X | None) - Simplify ParamSpec import in safe_sdk (now in typing on 3.10+) - Simplify importlib.metadata import in __init__.py (no fallback needed) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f39f170 commit ac98646

4 files changed

Lines changed: 23 additions & 263 deletions

File tree

pyproject.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "taskbadger"
33
version = "1.7.0"
44
description = "The official Python SDK for Task Badger"
5-
requires-python = ">=3.9"
5+
requires-python = ">=3.10"
66
authors = []
77
readme = "README.md"
88
classifiers = [
@@ -11,10 +11,11 @@ classifiers = [
1111
"Intended Audience :: Developers",
1212
"Operating System :: OS Independent",
1313
"Programming Language :: Python",
14-
"Programming Language :: Python :: 3.9",
1514
"Programming Language :: Python :: 3.10",
1615
"Programming Language :: Python :: 3.11",
1716
"Programming Language :: Python :: 3.12",
17+
"Programming Language :: Python :: 3.13",
18+
"Programming Language :: Python :: 3.14",
1819
"Topic :: Software Development :: Libraries :: Python Modules",
1920
]
2021

@@ -23,8 +24,6 @@ dependencies = [
2324
"attrs >=21.3.0",
2425
"python-dateutil >=2.8.0",
2526
"tomlkit >=0.12.5",
26-
"importlib-metadata >=1.0; python_version < '3.8'",
27-
"typing-extensions >=4.7.1; python_version <= '3.9'",
2827
]
2928

3029
[build-system]
@@ -86,7 +85,7 @@ exclude = [
8685
]
8786
line-length = 120
8887
indent-width = 4
89-
target-version = "py39"
88+
target-version = "py310"
9089

9190
[tool.ruff.lint]
9291
select = ["E", "F", "I", "UP", "DJ", "PT"]

taskbadger/__init__.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,11 @@
2323
"update_task",
2424
]
2525

26-
try:
27-
import importlib.metadata as importlib_metadata
28-
except ModuleNotFoundError:
29-
import importlib_metadata
30-
26+
from importlib.metadata import PackageNotFoundError, version
3127

3228
try:
33-
__version__ = importlib_metadata.version(__name__)
34-
except importlib_metadata.PackageNotFoundError:
29+
__version__ = version(__name__)
30+
except PackageNotFoundError:
3531
__version__ = "dev"
3632

3733

taskbadger/safe_sdk.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import logging
2-
from typing import Optional
3-
4-
try:
5-
from typing import ParamSpec
6-
except ImportError:
7-
from typing_extensions import ParamSpec
2+
from typing import ParamSpec
83

94
from .mug import Badger
105
from .sdk import Task, create_task, update_task
@@ -14,7 +9,7 @@
149
log = logging.getLogger("taskbadger")
1510

1611

17-
def create_task_safe(name: str, **kwargs: P.kwargs) -> Optional[Task]:
12+
def create_task_safe(name: str, **kwargs: P.kwargs) -> Task | None:
1813
"""Safely create a task. Any errors are handled and logged.
1914
2015
Arguments:
@@ -33,7 +28,7 @@ def create_task_safe(name: str, **kwargs: P.kwargs) -> Optional[Task]:
3328
log.warning("Error creating task '%s': %s", name, e)
3429

3530

36-
def update_task_safe(task_id: str, **kwargs: P.kwargs) -> Optional[Task]:
31+
def update_task_safe(task_id: str, **kwargs: P.kwargs) -> Task | None:
3732
"""Safely update a task. Any errors are handled and logged.
3833
3934
Arguments:

0 commit comments

Comments
 (0)