Move scripts/ to giant/tools/ (issues.md Issue 9)
CI / Format (ruff format) (push) Successful in 27s
CI / Lint (ruff check) (push) Successful in 28s
CI / Sync project version with tag (push) Has been skipped
CI / Lint (ruff check) (pull_request) Successful in 34s
CI / Type check (ty) (push) Successful in 38s
CI / Format (ruff format) (pull_request) Successful in 52s
CI / Sync project version with tag (pull_request) Has been skipped
CI / Type check (ty) (pull_request) Successful in 51s
CI / Tests (pull_request) Successful in 3m26s
CI / Tests (push) Successful in 3m36s

`scripts` was published as a top-level distribution package, colliding
with one of the most generic names in the Python ecosystem and
shadowable by a stray scripts/ dir on the portal machines' shared
/work/lbogner. Move it under the giant namespace; the dwarf command
name is unchanged, only the Python import path and file location move.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-13 10:31:47 +02:00
parent 72f5a891bf
commit 81eb14d75c
26 changed files with 66 additions and 39 deletions
+28 -1
View File
@@ -48,7 +48,7 @@ architecture matrix grows, not about rot or breakage.
| 6 | Two independent v0.2→v0.3 migration surfaces encode the same knowledge | Medium | Medium | **Fixed** |
| 7 | Positional tuple contracts (9-tuple, 7-tuple) between data, model and training layers | Medium | Small | **Fixed** |
| 8 | `network.py` is 1745 lines holding three distinct modules | Medium | Small | **Fixed** |
| 9 | `scripts` is published as a top-level distribution package | Medium | Small | Open |
| 9 | `scripts` is published as a top-level distribution package | Medium | Small | **Fixed** |
| 10 | `torch.load(weights_only=False)` — checkpoints are arbitrary pickles | Low | Medium | Open |
| 11 | Minor: `echo=print` threading, `particles → data.loader` layering | Low | Small | Open |
@@ -1131,6 +1131,33 @@ changes is effectively unreviewable.
## Issue 9 — `scripts` is published as a top-level distribution package
> **Status: Fixed.** `scripts/` moved to `giant/tools/` via `git mv` (preserving file
> history); `pyproject.toml`'s `[project.scripts]` entry point is now
> `dwarf = "giant.tools.dwarf:app"`, `[tool.hatch.build.targets.wheel] packages` is now
> `["giant"]` only, and `[tool.coverage.run] source` is now `["giant"]` only. The 7
> `from scripts.X import Y` intra-package imports in `dwarf.py` became
> `from giant.tools.X import Y`; the one live (non-cosmetic) reference to the old module
> path — `steps_to_parquet_parallel.py`'s `_DWARF_CONVERT_CMD` subprocess invocation
> (`python -m scripts.dwarf convert`, used by every `dwarf convert --jobs N` fan-out
> worker) — is now `python -m giant.tools.dwarf`. The 5 test files that imported from
> `scripts` (`test_dwarf.py`, `test_steps_to_parquet.py`,
> `test_steps_to_parquet_parallel.py`, `test_bump_dataset_version.py`,
> `test_create_root_files.py`) now import from `giant.tools`. All remaining prose
> references to `scripts/`/`scripts.` — in `giant/cli.py`, `giant/config.py`,
> `giant/data/loader.py`, `giant/analysis/runtime_estimate.py`, `tests/test_dataset.py`,
> `CLAUDE.md`, `README.md`'s repo-tree block, and docstrings/comments inside the moved
> files themselves (`dwarf.py`, `profile_analysis_costs.py`, `check_migration_v02_v03.py`,
> `bump_dataset_version.py`, `create_root_files.py`) — were updated to `giant/tools/` /
> `giant.tools.` for accuracy. `giant/analysis/condor.py` and
> `.gitea/workflows/ci.yml` were checked per the scope guard below and needed no changes
> (neither hard-codes a `scripts/` path; CI's coverage source comes from `pyproject.toml`).
> The `dwarf` **command name is unchanged** — `giant train --help`/`dwarf --help` behavior
> is identical, only the Python import path and file location moved. `uv sync --extra cpu
> --extra dev` reinstalls cleanly with the new entry point; `uv run pytest -q` (804
> passed, unchanged), `uv run ruff check .`, `uv run ruff format --check .`, and `uv run ty
> check .` all clean. Everything below this point describes the pre-fix state and is kept
> for historical context.
**Severity: Medium. Effort: Small.**
**Location:** `pyproject.toml`: