Skip to content

Commit 375d1c6

Browse files
Pigbibicodex
andcommitted
fix(packaging): preserve src wheel import contract
Co-Authored-By: Codex <noreply@openai.com>
1 parent 3982b53 commit 375d1c6

2 files changed

Lines changed: 29 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,32 @@ jobs:
3636
set -euo pipefail
3737
python -m pip check
3838
39+
- name: Verify clean wheel package contract
40+
run: |
41+
set -euo pipefail
42+
TMP_DIR="$(mktemp -d)"
43+
trap 'rm -rf "$TMP_DIR"' EXIT
44+
python -m pip wheel --no-deps --wheel-dir "$TMP_DIR/dist" .
45+
python -m venv --system-site-packages "$TMP_DIR/venv"
46+
(
47+
cd "$TMP_DIR"
48+
unset PYTHONPATH
49+
"$TMP_DIR/venv/bin/python" -m pip install "$TMP_DIR/dist"/*.whl
50+
"$TMP_DIR/venv/bin/python" - <<'PY'
51+
import importlib
52+
from pathlib import Path
53+
54+
package_root = Path(importlib.import_module("src").__file__).parent
55+
required = [
56+
package_root / "__init__.py",
57+
package_root / "backtest.py",
58+
package_root / "strategy_lifecycle" / "orchestrator_runner.py",
59+
]
60+
assert all(path.is_file() for path in required), required
61+
importlib.import_module("src.strategy_lifecycle.orchestrator_runner")
62+
PY
63+
)
64+
3965
- name: Run ruff
4066
run: |
4167
set -euo pipefail

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ dependencies = [
2727
test = ["pytest>=8"]
2828

2929
[tool.setuptools]
30-
package-dir = {"" = "src"}
30+
package-dir = {"" = "."}
3131

3232
[tool.setuptools.packages.find]
33-
where = ["src"]
34-
33+
where = ["."]
34+
include = ["src", "src.*"]

0 commit comments

Comments
 (0)