You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LCORE-1569,LCORE-1570: appease pylint, pyright, and ruff
Fix-ups discovered by `uv run make verify`. No behavior change.
* utils/compaction: hoist `from utils.token_estimator import ...`
to the module top. The original local imports were a paranoid
hedge against a hypothetical circular import that does not
actually exist (token_estimator does not import compaction).
Top-level imports also let pylint's import-outside-toplevel rule
pass cleanly.
* utils/compaction: switch `timezone.utc` to the Python 3.13
`datetime.UTC` alias per ruff UP017.
* tests: `import tiktoken` at module top instead of inside a test
method (test_token_estimator.py).
* tests: `# pylint: disable=too-few-public-methods` at module top
for the test files that use one-attribute stand-in classes for
message and content-part fixtures. These are intentional
duck-type stubs, not real abstractions, and adding methods just
to satisfy a count would obscure the intent.
* tests: `Configuration.model_fields.get(...)` instead of
`"compaction" in Configuration.model_fields`. The dict accessor
pylint cannot infer; the .get() form sidesteps the
unsupported-membership-test / unsubscriptable-object false
positives without weakening the assertion.
* models/config: `compaction` Field's `default_factory` now
constructs CompactionConfiguration with every field passed
explicitly. Matches the established pattern used by
`conversation_cache` and `quota_handlers` on the same Configuration
class, and resolves pyright reportCallIssue: the bare class form
trips pyright's "constructor requires positional args" check
because pyright treats the kwargs-with-defaults init as
zero-positional but more-than-zero-required-keyword.
0 commit comments