diff --git a/multizone.py b/multizone.py index 9973e43..1002c8a 100755 --- a/multizone.py +++ b/multizone.py @@ -12,9 +12,10 @@ import argparse import sys +import zoneinfo from datetime import datetime, timedelta, tzinfo from pathlib import Path -from typing import Any, Dict +from typing import Any import tabulate import tzlocal @@ -22,10 +23,6 @@ from babel.dates import format_datetime from termcolor import colored -if sys.version_info < (3, 9): - from backports import zoneinfo -else: - import zoneinfo if sys.version_info < (3, 10): from xdg import xdg_config_home else: @@ -35,7 +32,7 @@ else: import tomllib -ConfigType = Dict[str, Any] +ConfigType = dict[str, Any] def get_arg(time_str: str, sep: str) -> list[int]: diff --git a/pyproject.toml b/pyproject.toml index fe6cfbf..dc2c828 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,15 +53,17 @@ max-line-length = "108" disable = "R0912,R0914" [tool.ruff] +line-length = 108 +target-version = "py39" + +[tool.ruff.lint] fixable = ["D", "I", "COM"] ignore = [ "S101", # assert "D213", # multi-line-summary-second-line incompatible with multi-line-summary-first-line "D203" # one-blank-line-before-class" incompatible with no-blank-line-before-class ] -line-length = 108 select = ["ALL"] -target-version = "py39" [tool.ruff.per-file-ignores] "test_mz.py" = ["PLR2004"] diff --git a/test_mz.py b/test_mz.py index bb8f6c2..f92d724 100755 --- a/test_mz.py +++ b/test_mz.py @@ -12,17 +12,13 @@ from datetime import datetime from pathlib import Path from unittest.mock import MagicMock, mock_open, patch +from zoneinfo import ZoneInfo import pytest from babel.core import default_locale import multizone -if sys.version_info < (3, 9): - from backports.zoneinfo import ZoneInfo -else: - from zoneinfo import ZoneInfo - def test_parse_time_args() -> None: """Tests parse_time_args()."""