Skip to content

Commit b3f29e3

Browse files
SigmaJahanclaude
andcommitted
fix(ci): green up the test job on a fresh clone
Two bugs in test_phase0_gate.py surfaced in CI but never locally because my dev tree predates the issues: 1. test_directory_structure asserts that ``defaultplusplus/src/defaultplusplus/pretrained/weights/`` is a directory. It was empty so git never tracked it. Add a .gitkeep so the directory survives a fresh clone. 2. test_pyproject_toml does ``import tomllib`` unconditionally. ``tomllib`` is stdlib only on Python 3.11+. Fall back to ``tomli`` on 3.10 (the upstream of tomllib with the identical API). Added ``tomli>=2.0; python_version < '3.11'`` to the [dev] extra so it installs only where needed. Local suite: 150 passed, no regressions. Should clear the matrix on 3.10 / 3.11 / 3.12. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 068dfdf commit b3f29e3

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

defaultplusplus/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ dev = [
9292
"ruff>=0.4",
9393
"build>=1.0",
9494
"twine>=5.0",
95+
# Python 3.11 ships ``tomllib`` in the standard library; on 3.10 we
96+
# fall back to ``tomli``, which is its identical-API upstream.
97+
"tomli>=2.0; python_version < '3.11'",
9598
]
9699
# Convenience extra for installing the full research stack.
97100
all = [
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This file exists so the empty weights/ directory is tracked by git.
2+
# It is the destination for pretrained diagnostic-model weights, which
3+
# are downloaded on first use rather than shipped in the wheel.

defaultplusplus/tests/test_phase0_gate.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ def test_pyproject_toml():
5252
Version is read dynamically from ``defaultplusplus._version`` so
5353
it is not a literal field in ``[project]``.
5454
"""
55-
import tomllib
55+
# tomllib only landed in Python 3.11; on 3.10 we fall back to the
56+
# tomli package, which is the upstream of tomllib and has the
57+
# identical API.
58+
try:
59+
import tomllib # type: ignore[import-not-found]
60+
except ImportError:
61+
import tomli as tomllib # type: ignore[no-redef]
5662

5763
toml_path = ROOT / "pyproject.toml"
5864
assert toml_path.exists()

0 commit comments

Comments
 (0)