Skip to content

Bump dependencies and add a test suite#9

Merged
lxcode merged 1 commit into
mainfrom
add-test-suite
Jun 30, 2026
Merged

Bump dependencies and add a test suite#9
lxcode merged 1 commit into
mainfrom
add-test-suite

Conversation

@lxcode

@lxcode lxcode commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Bumps all dependencies and adds the project's first automated test suite.

Dependencies

  • Upgraded all locked dependencies to their latest compatible releases (uv lock --upgrade).
  • Tightened direct-dependency floors in pyproject.toml to match the versions now tested: scikit-learn 1.9, sentence-transformers 5.6, pytest 9.1, ruff 0.15.20, ty 0.0.55.

Test suite

  • Injectable encoder: FuzzyClusterer gains a keyword-only encoder parameter plus an Encoder Protocol, so the fuzzy path can be tested with a deterministic fake encoder and no model download. Default behavior is unchanged.
  • Unit tests for preprocess_text, ExactClusterer, and FuzzyClusterer that assert structure and invariants (membership, bounds, determinism) rather than exact floats or label ids, so they survive future dependency bumps.
  • Opt-in integration test against the real sentence-transformer model, marked slow, excluded from the default run and CI; it skips when the model is unreachable.
  • Config/CI/docs: pytest skips slow tests by default; a CI workflow runs ruff + ty + pytest on Python 3.12 and 3.13; README gains a Testing section.

Verification

ruff check clean, ty check clean, 16 default tests pass, and the slow real-model test passes against the actual model.

Upgrade all locked dependencies to their latest compatible releases and
tighten the direct-dependency floors in pyproject.toml to match the
versions now tested (scikit-learn 1.9, sentence-transformers 5.6,
pytest 9.1, ruff 0.15.20, ty 0.0.55).

Add the project's first automated test suite to guard against behavior
changes from this and future bumps:

- Make FuzzyClusterer's encoder injectable (keyword-only `encoder` param
  plus an Encoder Protocol) so the fuzzy path can be tested with a
  deterministic fake encoder, no model download required. Default
  behavior is unchanged.
- Unit tests for preprocess_text, ExactClusterer, and FuzzyClusterer that
  assert structure and invariants rather than exact floats or label ids,
  so they survive future dependency upgrades.
- An opt-in real-model integration test marked `slow`, excluded from the
  default run and CI; it skips when the model is unreachable.
- pytest configuration that skips slow tests by default, a CI workflow
  running ruff/ty/pytest on Python 3.12 and 3.13, and a README note.
@lxcode lxcode merged commit b11e28e into main Jun 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant