Skip to content

Commit fa7a727

Browse files
authored
Merge pull request #52 from pganssle/pin_lxml
Pin lxml to < 5.2.0
2 parents 69bd569 + a476171 commit fa7a727

24 files changed

+65
-58
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
uses: actions/setup-python@v4
2222
with:
2323
python-version: ${{ matrix.python-version }}
24-
- uses: FedericoCarboni/setup-ffmpeg@v2
24+
- uses: FedericoCarboni/setup-ffmpeg@v3
2525
id: setup-ffmpeg
2626
with:
27-
token: ${{ secrets.GH_API_TOKEN }}
27+
token: ${{ github.token }}
2828
- name: Install dependencies
2929
run: |
3030
python -m pip install --upgrade pip

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dependencies = [
2323
"jinja2",
2424
"click>=6.0",
2525
"progressbar2",
26-
"lxml>=2.0",
26+
"lxml>=2.0,<5.2.0",
2727
"SQLAlchemy>=1.4,<2",
2828
"attrs>=22.0",
2929
"backports.strenum>=1.1.1;python_version<'3.11'",

scripts/bundle_fa_subset.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def extract_font_awesome(icon: str, css: str) -> str:
6969
name = f".fa-{icon}"
7070

7171
m = re.search(
72-
name + ":+before {\s+content: " "['\"]+(?P<codepoint>[^'\"]+)",
72+
name + r":+before {\s+content: " "['\"]+(?P<codepoint>[^'\"]+)",
7373
css,
7474
re.MULTILINE,
7575
)
@@ -176,9 +176,9 @@ def bad_options(message: str) -> typing.NoReturn:
176176
ExistingFileOrDir = click.Path(
177177
dir_okay=True, file_okay=True, exists=True, path_type=pathlib.Path
178178
) # type: ignore
179-
FA_VERSION_TEMPLATE: typing.Final[
180-
str
181-
] = "https://use.fontawesome.com/releases/v{version}/fontawesome-free-{version}-web.zip"
179+
FA_VERSION_TEMPLATE: typing.Final[str] = (
180+
"https://use.fontawesome.com/releases/v{version}/fontawesome-free-{version}-web.zip"
181+
)
182182
LATEST_FA_VERSION: typing.Final[str] = "6.2.0"
183183

184184

src/audio_feeder/_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
try:
77
from enum import StrEnum # type: ignore[attr-defined]
88
except ImportError:
9-
from backports.strenum import StrEnum # type: ignore[import]
9+
from backports.strenum import StrEnum # type: ignore[import,no-redef]
1010

1111
__all__ = ("Self", "StrEnum")

src/audio_feeder/_db_types.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
This exists for compatibility while the old database_handler code still exists.
44
"""
5+
56
import typing
67

78
from ._object_types import ID, SchemaObject
@@ -16,17 +17,12 @@
1617

1718
# pragma: nocover
1819
class DatabaseHandler(typing.Protocol):
19-
def __init__(self, db_loc: PathType):
20-
...
20+
def __init__(self, db_loc: PathType): ...
2121

22-
def save_table(self, table_name: TableName, table_contents: Table) -> None:
23-
...
22+
def save_table(self, table_name: TableName, table_contents: Table) -> None: ...
2423

25-
def load_table(self, table_name: TableName) -> Table:
26-
...
24+
def load_table(self, table_name: TableName) -> Table: ...
2725

28-
def save_database(self, database: Database) -> None:
29-
...
26+
def save_database(self, database: Database) -> None: ...
3027

31-
def load_database(self) -> Database:
32-
...
28+
def load_database(self) -> Database: ...

src/audio_feeder/_object_types.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This is partially to allow typing without circular imports and partially to
44
allow typing on the generated schema types.
55
"""
6+
67
import typing
78

89
from ._compat import Self
@@ -15,13 +16,11 @@
1516
class SchemaObject(typing.Protocol):
1617
id: ID
1718

18-
def to_dict(self) -> typing.Mapping[str, typing.Any]:
19-
...
19+
def to_dict(self) -> typing.Mapping[str, typing.Any]: ...
2020

2121
def to_dict_sparse(
2222
self, *, _filter: typing.Callable = ...
23-
) -> typing.Mapping[str, typing.Any]:
24-
...
23+
) -> typing.Mapping[str, typing.Any]: ...
2524

2625
def copy(self: Self) -> Self:
2726
"""Make a new copy of this object."""

src/audio_feeder/cache_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Functions useful for caching.
33
"""
4+
45
import functools
56
import typing
67

src/audio_feeder/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Command line scripts
33
"""
4+
45
import pathlib
56

67
import click

src/audio_feeder/config.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Configuration manager - handles the application's global configuration.
33
"""
4+
45
import base64
56
import functools
67
import graphlib
@@ -64,13 +65,11 @@ class TemplateStr(str):
6465

6566

6667
@typing.overload
67-
def _path_converter(s: typing.Union[TemplatePath, TemplateStr]) -> TemplatePath:
68-
...
68+
def _path_converter(s: typing.Union[TemplatePath, TemplateStr]) -> TemplatePath: ...
6969

7070

7171
@typing.overload
72-
def _path_converter(s: typing.Union[str, Path]) -> Path:
73-
...
72+
def _path_converter(s: typing.Union[str, Path]) -> Path: ...
7473

7574

7675
def _path_converter(s):
@@ -288,25 +287,25 @@ def find_requirements(attr_name: str) -> typing.Sequence[str]:
288287
@typing.overload
289288
def _make_single_replacement(
290289
self, value: typing.Union[str, TemplateStr], replacements: _ReplacementsMapType
291-
) -> str:
292-
...
290+
) -> str: ...
293291

294292
@typing.overload
295293
def _make_single_replacement(
296294
self,
297295
value: typing.Union[Path, TemplatePath],
298296
replacements: _ReplacementsMapType,
299-
) -> Path:
300-
...
297+
) -> Path: ...
301298

302299
def _make_single_replacement(self, value, replacements):
303300
if isinstance(value, TemplatePath):
304301
return Path(
305302
*(
306303
self._make_single_replacement(
307-
TemplateStr(component)
308-
if component.startswith("{{")
309-
else component,
304+
(
305+
TemplateStr(component)
306+
if component.startswith("{{")
307+
else component
308+
),
310309
replacements=replacements,
311310
)
312311
for component in value.parts

src/audio_feeder/directory_parser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ class AudiobookLoader(BaseAudioLoader):
107107
)
108108

109109
COVER_PATTERNS: typing.Final[typing.Sequence[re.Pattern]] = [
110-
re.compile("$.*\-Cover^", re.IGNORECASE),
110+
re.compile(r"$.*-Cover^", re.IGNORECASE),
111111
re.compile("cover", re.IGNORECASE),
112112
]
113113

114114
DIR_NAME_RE = re.compile(
115-
"(?P<authors>.+?)(?= \- )"
116-
+ "(?: \- \[(?P<series_name>.*?) (?P<series_number>\d+)\])? \- "
117-
+ "(?P<title>.*$)"
115+
r"(?P<authors>.+?)(?= - )"
116+
+ r"(?: - \[(?P<series_name>.*?) (?P<series_number>\d+)\])? - "
117+
+ r"(?P<title>.*$)"
118118
)
119119

120120
@classmethod

0 commit comments

Comments
 (0)