-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
✨ Migrate to a src/ Directory Layout
Motivation
- Avoids accidental imports from the working directory during development and CI.
- Gives new contributors an immediate, unambiguous view of what is library code versus project infrastructure.
- Lets us install helper scripts as proper
console_scriptsentry-points. - Simplifies
pyproject.toml(singlepackage-dir, cleaner Cython extension paths). - Aligns with PyPA best-practice https://packaging.python.org/en/latest/discussions/src-layout/.
Scope
| Item | Action |
|---|---|
| Package code | Move charis/ → src/charis/ |
| Cython extensions | Update pyproject.toml/setup.py paths. |
| Scripts | Relocate to src/charis/scripts/ and expose via console_scripts entry-points. |
| Calibration data | Move to src/charis/data/; load with importlib.resources.files(). |
| Tests | Update relative imports; ensure pytest --import-mode=importlib passes. |
| Docs & CI | Adjust Sphinx conf.py and CI build paths. |
| Deprecation shim | Add charis/__init__.py in repo root that imports from src and raises DeprecationWarning (remove after v2.0). |
Implementation Checklist
- Create feature branch
feat/src-layout. - Move directories as per Scope.
- Update
pyproject.toml([tool.setuptools.packages]&[tool.setuptools.package-dir]). - Run
pip install -e .in a clean venv and confirmimport charis; charis.__version__works. - Update and run full test suite (
pytest -n auto). - Build wheel → install in fresh venv → run
buildcalandextractcubesmoke tests. - Update documentation (README quick-start, developer guide).
- Open PR, ensure CI (Linux/macOS/Windows) is green.
Back-out Plan
If blockers arise:
- Keep
feat/src-layoutbranch alive. git checkout main, createrevert/src-layoutbranch.- Reset directory tree to pre-migration state (
git revert -m 1 <merge-commit>). - Document problem in the original issue and discuss alternative fixes.
Definition of Done
- All CI jobs pass on Python 3.10-3.13 with and without OpenMP.
- Wheels and editable installs work identically.
- User-facing commands (
buildcal,extractcube,sphere_reduceviaspherical) function unchanged. - README & docs no longer reference the legacy layout.
Labels
enhancement • maintenance • breaking-change
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels