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
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "taskbadger"
version = "1.7.0"
description = "The official Python SDK for Task Badger"
requires-python = ">=3.9"
requires-python = ">=3.10"
authors = []
readme = "README.md"
classifiers = [
Expand All @@ -11,10 +11,11 @@ classifiers = [
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Libraries :: Python Modules",
]

Expand All @@ -23,8 +24,6 @@ dependencies = [
"attrs >=21.3.0",
"python-dateutil >=2.8.0",
"tomlkit >=0.12.5",
"importlib-metadata >=1.0; python_version < '3.8'",
"typing-extensions >=4.7.1; python_version <= '3.9'",
]

[build-system]
Expand Down Expand Up @@ -86,7 +85,7 @@ exclude = [
]
line-length = 120
indent-width = 4
target-version = "py39"
target-version = "py310"

[tool.ruff.lint]
select = ["E", "F", "I", "UP", "DJ", "PT"]
Expand Down
10 changes: 3 additions & 7 deletions taskbadger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,11 @@
"update_task",
]

try:
import importlib.metadata as importlib_metadata
except ModuleNotFoundError:
import importlib_metadata

from importlib.metadata import PackageNotFoundError, version

try:
__version__ = importlib_metadata.version(__name__)
except importlib_metadata.PackageNotFoundError:
__version__ = version(__name__)
except PackageNotFoundError:
__version__ = "dev"


Expand Down
11 changes: 3 additions & 8 deletions taskbadger/safe_sdk.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import logging
from typing import Optional

try:
from typing import ParamSpec
except ImportError:
from typing_extensions import ParamSpec
from typing import ParamSpec

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


def create_task_safe(name: str, **kwargs: P.kwargs) -> Optional[Task]:
def create_task_safe(name: str, **kwargs: P.kwargs) -> Task | None:
"""Safely create a task. Any errors are handled and logged.

Arguments:
Expand All @@ -33,7 +28,7 @@ def create_task_safe(name: str, **kwargs: P.kwargs) -> Optional[Task]:
log.warning("Error creating task '%s': %s", name, e)


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

Arguments:
Expand Down
Loading