Skip to content

Workstream F: CI hardening, packaging, exceptions, loader dedup (C3/P1/T1/B3/B4) - #1

Merged
sherryzyh merged 4 commits into
mainfrom
refactor/cleanup-c3-p1-t1-b3-b4
Jun 14, 2026
Merged

Workstream F: CI hardening, packaging, exceptions, loader dedup (C3/P1/T1/B3/B4)#1
sherryzyh merged 4 commits into
mainfrom
refactor/cleanup-c3-p1-t1-b3-b4

Conversation

@sherryzyh

Copy link
Copy Markdown
Owner

Summary

  • C3 — CI type gate: Remove continue-on-error: true from the mypy step. mypy already passes clean (0 errors, 141 files); the gate is now required.
  • P1 — Packaging license: Replace deprecated license = {text = "MIT"} table with SPDX string; remove redundant License trove classifier; bump setuptools to >=77.0. Clears both deprecation warnings from python -m build.
  • T1 — Test collection: Add tests/uq/conftest.py with import-probe collect_ignore so bare pytest no longer errors when uncertainty_quantification_physical_reasoning is absent (4 files go from erroring to gracefully skipped).
  • B3 — Exception hierarchy: New src/prkit/core/exceptions.py with PRKitError base and UnknownModelError(PRKitError, ValueError), ModelClientError(PRKitError, RuntimeError), ConfigError, DatasetError. Wire UnknownModelError into the two factory raise ValueError sites. Re-export from prkit.core. All existing pytest.raises(ValueError) assertions remain green via dual inheritance.
  • B4 — Loader metadata dedup: Add DOMAIN_MAPPING base property and _map_domain() helper to BaseDatasetLoader. Replace copy-pasted DOMAIN_MAPPING.get(domain, PhysicsDomain.OTHER) idiom in phyx_loader, phybench_loader, and tpbench_loader.

Also bundled (pre-existing unstaged work):

  • OpenAIModel / OllamaModel custom endpoint + explicit auth params
  • Remote-safe Ollama preflight (warning instead of ConnectionError for remote hosts)
  • DatasetHub registration-ordering fix and extended hub tests
  • parse.py / calls.py JSON-extraction consolidation
  • Extended test coverage for model clients and hub

Test plan

  • python -m mypy src/prkitSuccess: no issues found in 141 source files
  • python -m pytest tests/prkit -q → 1318 passed, 83.66% coverage (≥60% gate)
  • python -m pytest --collect-only -q → 0 collection errors
  • python -m build 2>&1 | grep -i 'deprecat\|license' → no license warnings

🤖 Generated with Claude Code

sherryzyh and others added 4 commits June 13, 2026 23:24
…der dedup

C3 — Remove `continue-on-error: true` from mypy CI step; gate is now required
(mypy already reports 0 errors across 141 source files).

P1 — Update pyproject.toml to SPDX license string (`license = "MIT"`), remove
deprecated License trove classifier, bump setuptools requirement to >=77.0.
Eliminates both setuptools deprecation warnings emitted by `python -m build`.

T1 — Add `tests/uq/conftest.py` with `collect_ignore` driven by import probe
so bare `pytest` collection is error-free when
`uncertainty_quantification_physical_reasoning` is absent.

B3 — Add `src/prkit/core/exceptions.py` with `PRKitError` base and focused
subclasses (`UnknownModelError`, `ModelClientError`, `ConfigError`,
`DatasetError`). Dual-inherit matching builtins for backward compatibility.
Wire `UnknownModelError` into both raise sites in `factory.py`. Re-export all
public types from `prkit.core`. Add `tests/prkit/core/test_exceptions.py`.

B4 — Add `DOMAIN_MAPPING` base property and `_map_domain()` helper to
`BaseDatasetLoader`. Replace inline `DOMAIN_MAPPING.get(domain, OTHER)` idiom
in `phyx_loader`, `phybench_loader`, and `tpbench_loader`. Add
`tests/prkit/datasets/loaders/test_base_loader_map_domain.py`.

Also included: `OpenAIModel` and `OllamaModel` custom-endpoint and explicit-auth
params, remote-safe Ollama preflight, DatasetHub fixes, parse/inference
consolidation, extended test coverage for model clients and hub, and updated
CHANGELOG/CORE/DATASETS/RELEASE_NOTES.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…init

New openai>=1.99.9 validates credentials at OpenAI() constructor time, so any
test that directly instantiates a model client or LLM judge comparator fails in
CI where no API keys are set. Add autouse fixtures and @patch decorators across
four test files to intercept the SDK before it touches credentials.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t_llm

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sherryzyh
sherryzyh merged commit 65b0c6c into main Jun 14, 2026
3 checks passed
@sherryzyh
sherryzyh deleted the refactor/cleanup-c3-p1-t1-b3-b4 branch June 14, 2026 04:06
sherryzyh added a commit that referenced this pull request Jun 14, 2026
Workstream F: CI hardening, packaging, exceptions, loader dedup (C3/P1/T1/B3/B4)
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