Skip to content

Commit 2268784

Browse files
committed
chore: bump docformatter to v1.7.8
v1.7.8 drops the unmaintained `untokenize` dependency (replaced by stdlib `tokenize`), which was failing to install on Python 3.12+ runners due to `ast.Constant.s` removal. This unblocks pre-commit.ci without the `ci.skip: [docformatter]` workaround added in #376. Also includes docstring reformatting in 3 files. The reformatting is debt that accumulated while the docformatter hook was effectively broken (cached env on pre-commit.ci, skipped after #376). Changes are purely cosmetic - rewrapping docstring prose to the configured 120-char width.
1 parent ce16a58 commit 2268784

4 files changed

Lines changed: 16 additions & 26 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ ci:
66
autoupdate_commit_msg: "[pre-commit.ci] pre-commit suggestions"
77
autoupdate_schedule: quarterly
88
# submodules: true
9-
# docformatter v1.7.7 transitively pulls `untokenize`, whose setup.py
10-
# uses `ast.Constant.s` (removed in Python 3.12+) and fails to install
11-
# on pre-commit.ci's runners. The `pre-commit` GitHub Actions job still
12-
# runs docformatter, so coverage isn't lost. Remove this once docformatter
13-
# ships v1.7.8 (which drops the untokenize dep).
14-
skip: [docformatter]
159

1610
repos:
1711
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -36,7 +30,7 @@ repos:
3630
args: []
3731

3832
- repo: https://github.com/PyCQA/docformatter
39-
rev: v1.7.7
33+
rev: v1.7.8
4034
hooks:
4135
- id: docformatter
4236
additional_dependencies: [tomli]

src/cachier/core.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@
3939
class _CachierWrappedFunc(Protocol[_P, _R_co]):
4040
"""Callable returned by ``@cachier`` with the decorated function's signature.
4141
42-
Preserves the original function's parameter and return types via ``ParamSpec``
43-
while also exposing the cache-management attributes attached by the decorator.
44-
Per-call cachier options such as ``max_age`` and ``cachier__skip_cache`` are
45-
accepted at runtime but are not surfaced in the ``__call__`` signature here;
46-
PEP 612 does not permit mixing ParamSpec kwargs with additional keyword-only
47-
parameters.
42+
Preserves the original function's parameter and return types via ``ParamSpec`` while also exposing the cache-
43+
management attributes attached by the decorator. Per-call cachier options such as ``max_age`` and
44+
``cachier__skip_cache`` are accepted at runtime but are not surfaced in the ``__call__`` signature here; PEP 612
45+
does not permit mixing ParamSpec kwargs with additional keyword-only parameters.
4846
4947
"""
5048

@@ -85,9 +83,8 @@ async def _background_recalc_async(
8583
) -> None:
8684
"""Run async recomputation in background and clear processing flag.
8785
88-
This helper ensures that the cache entry's "being calculated" state is
89-
cleared only after the background recomputation and cache update
90-
(performed by ``_function_thread_async``) have completed.
86+
This helper ensures that the cache entry's "being calculated" state is cleared only after the background
87+
recomputation and cache update (performed by ``_function_thread_async``) have completed.
9188
9289
"""
9390
try:

src/cachier/cores/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ def check_calc_timeout(self, time_spent):
121121
def get_entry_by_key(self, key: str) -> Tuple[str, Optional[CacheEntry]]:
122122
"""Get entry based on given key.
123123
124-
Return the key and the :class:`~cachier.config.CacheEntry` mapped
125-
to the given key in this core's cache, if such a mapping exists.
124+
Return the key and the :class:`~cachier.config.CacheEntry` mapped to the given key in this core's cache, if such
125+
a mapping exists.
126126
127127
"""
128128

tests/conftest.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,13 @@ def _build_worker_url(original_url: str, schema_name: str) -> str:
4848
def worker_sql_connection(request: pytest.FixtureRequest) -> Optional[str]:
4949
"""Create the worker-specific PostgreSQL schema once per xdist worker session.
5050
51-
Returns the worker-specific connection URL, or None when schema isolation is not
52-
needed (serial run or non-PostgreSQL backend). The schema is created with
53-
``CREATE SCHEMA IF NOT EXISTS`` so this fixture is safe to run even if the schema
54-
already exists from a previous interrupted run.
55-
56-
A non-None return value means "use this URL"; schema creation is attempted but may
57-
fail silently (e.g. if SQLAlchemy is not installed or the DB is unreachable). Tests
58-
that depend on the schema will fail at the DB level with a diagnostic error.
51+
Returns the worker-specific connection URL, or None when schema isolation is not needed (serial run or non-
52+
PostgreSQL backend). The schema is created with ``CREATE SCHEMA IF NOT EXISTS`` so this fixture is safe to run even
53+
if the schema already exists from a previous interrupted run.
54+
55+
A non-None return value means "use this URL"; schema creation is attempted but may fail silently (e.g. if SQLAlchemy
56+
is not installed or the DB is unreachable). Tests that depend on the schema will fail at the DB level with a
57+
diagnostic error.
5958
6059
"""
6160
# Avoid touching SQL backends entirely when no SQL tests are collected.

0 commit comments

Comments
 (0)