runsascoded/stdlb#2 Snapshot testing, collision fixes, and src/ layout
This PR adds comprehensive snapshot testing to prevent regressions, fixes name collision issues discovered when comparing to v0.0.4, and reorganizes the codebase with a src/ layout.
-
Snapshot testing (
scripts/snapshot_exports.py,tests/test_exports_snapshot.py)- Tracks all 2127 exported symbols with their FQNs
- Prevents regressions like the missing os.path members in v0.1.0
- Simple
{"name": "fqn"}format for easy diffing
-
Version comparison tool (
scripts/compare_versions.py)- Compare exports between any two git refs
- Identified 20 FQN changes from v0.0.4 → HEAD
- Usage:
python scripts/compare_versions.py v0.0.4 HEAD
-
Collision resolution fixes
Path: pathlib.Path (not zipfile.Path) ✅error: re.error (not zlib.error) ✅compress: itertools.compress (not zlib.compress) ✅repeat: itertools.repeat (not timeit.repeat) ✅
-
Restore missing submodule imports
- Fixed regression: os.path members (basename, dirname, etc.)
- Fixed regression: urllib.parse members (urlparse, urlencode, etc.)
-
Src/ layout
- Moved
stdlb/→src/stdlb/ - Modern Python package structure
- Moved
-
Documentation
- Comprehensive helper script documentation
- Updated stats: 2127 symbols, 79+ modules, ~57ms import time
- Examples for all collision resolution preferences
All tests pass:
pytest tests/ -q
# 12 passed, 1 skippedComparison with v0.0.4:
- ✨ Added 1287 symbols (841 → 2128)
- ❌ Removed 0 symbols (fully backward compatible)
- 🔄 Fixed 4 critical collisions, 16 remain (mostly acceptable)
🤖 Generated with Claude Code