Skip to content

Commit 853bc28

Browse files
committed
WIP
1 parent 520b5d3 commit 853bc28

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

.github/workflows/python-package.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66

77
jobs:
88
test:
9-
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
109
runs-on: ${{ matrix.os }}
1110

1211
strategy:
@@ -17,10 +16,10 @@ jobs:
1716
- macos-latest
1817
- windows-latest
1918
python-version:
20-
- "3.9"
2119
- "3.10"
2220
- "3.11"
2321
- "3.12"
22+
- "3.13"
2423

2524
steps:
2625
- uses: actions/checkout@v4

debianbts/debianbts.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import urllib.request
2020
import xml.etree.ElementTree as ET
2121
from collections.abc import Iterable, Mapping
22-
from datetime import datetime
22+
from datetime import UTC, datetime
2323
from typing import Any
2424

2525
logger = logging.getLogger(__name__)
@@ -227,7 +227,7 @@ def get_status(
227227
228228
"""
229229
numbers: list[int]
230-
if not isinstance(nrs, (list, tuple)):
230+
if not isinstance(nrs, list | tuple):
231231
numbers = [nrs]
232232
else:
233233
numbers = list(nrs)
@@ -303,7 +303,7 @@ def get_bug_log(
303303
attachments: list[Any] = []
304304

305305
mail_parser = email.feedparser.BytesFeedParser(
306-
policy=email.policy.SMTP
306+
policy=email.policy.SMTP # type: ignore
307307
)
308308
mail_parser.feed(header.encode())
309309
mail_parser.feed(b"\n\n")
@@ -419,8 +419,10 @@ def _parse_status(bug_el: dict[str, Any]) -> Bugreport:
419419
):
420420
setattr(bug, field, bug_el[field])
421421

422-
bug.date = datetime.utcfromtimestamp(float(bug_el["date"]))
423-
bug.log_modified = datetime.utcfromtimestamp(float(bug_el["log_modified"]))
422+
bug.date = datetime.fromtimestamp(float(bug_el["date"]), UTC)
423+
bug.log_modified = datetime.fromtimestamp(
424+
float(bug_el["log_modified"]), UTC
425+
)
424426
bug.tags = str(bug_el["tags"]).split()
425427
bug.done = _parse_bool(bug_el["done"])
426428
bug.done_by = bug_el["done"] if bug.done else None
@@ -646,7 +648,7 @@ def _encode_value(parent: ET.Element, name: str, value: Any) -> None:
646648
el.set(f"{{{XSI}}}type", ET.QName(SOAPENC, "Array")) # type: ignore
647649
el.set(
648650
f"{{{SOAPENC}}}arrayType",
649-
ET.QName(XSD, "anyType[%d]" % len(value)), # type: ignore
651+
ET.QName(XSD, f"anyType[{len(value)}]"), # type: ignore
650652
)
651653
for x in value:
652654
_encode_value(el, "item", x)

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ authors = [
99
]
1010
description = "Python interface to Debian's Bug Tracking System"
1111
readme = "README.md"
12-
license = { file="LICENSE" }
13-
requires-python = ">=3.9, <4"
12+
license-files = ["LICENSE"]
13+
requires-python = ">=3.10, <4"
1414
classifiers = [
1515
"Development Status :: 5 - Production/Stable",
1616
"Intended Audience :: Developers",
17-
"License :: OSI Approved :: MIT License",
1817
"Programming Language :: Python :: 3",
1918
"Topic :: Software Development :: Bug Tracking",
2019
]
@@ -61,7 +60,6 @@ addopts = """
6160

6261
[tool.ruff]
6362
line-length = 79
64-
target-version = "py39"
6563

6664
[tool.ruff.lint]
6765
select = [

requirements-dev.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
build==1.2.1
2-
mkdocs==1.6.0
3-
mkdocs-material==9.5.31
4-
mkdocstrings[python]==0.25.2
5-
pytest==8.3.2
6-
pytest-cov==5.0.0
7-
pytest-xdist==3.6.1
8-
ruff==0.6.0
9-
wheel==0.44.0
10-
twine==5.1.1
11-
mypy==1.11.1
1+
build==1.2.2.post1
2+
mkdocs==1.6.1
3+
mkdocs-material==9.6.14
4+
mkdocstrings[python]==0.29.1
5+
pytest==8.4.0
6+
pytest-cov==6.1.1
7+
pytest-xdist==3.7.0
8+
ruff==0.11.12
9+
wheel==0.45.1
10+
twine==6.1.0
11+
mypy==1.16.0

tests/test_debianbts.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
import logging
77
import math
88
import unittest.mock as mock
9-
from typing import Any, Callable
9+
from collections.abc import Callable
10+
from typing import Any
1011

1112
import pytest
1213
from pytest import LogCaptureFixture

0 commit comments

Comments
 (0)