Repository navigation
Infrastructure and tooling improvements - #8
Merged
Merged
Conversation
Propagated from sgcode/dev PR #40. click provides better help text, type-coerced options, and cleaner error messages than argparse. - Add click>=8.0 to core dependencies (used by both spt CLI and lifecycle.py) - Add [tool.ty.rules] unresolved-import = "ignore" to suppress ty false positives on optional deps in type-checked files - Migrate src/.../cli.py: replace argparse with @click.group()/@main.command() decorators; raise ClickException on error - Migrate hpc/lifecycle.py: same pattern; add _PROJECT_ROOT_DEFAULT constant; replace raise FileNotFoundError/RuntimeError with raise click.ClickException; remove integer return codes (void commands); add --test flag to submit command - Rewrite tests/test_cli.py to use click.testing.CliRunner
Propagated from sgcode/dev PR #40. Without this, relative output paths (data/, results/) inside the container resolve to the read-only image layer rather than the writable host filesystem, causing write failures. Sets both APPTAINER_BIND and SINGULARITY_BIND for compatibility with older Apptainer/Singularity installations.
Ignores any bin/ directory at the repo root and CLAUDE.md (kept local-only, not tracked in version control).
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR migrates the project CLIs to
click, fixes container output-path binding for HPC runs, andadds architecture documentation assets.
Changes
feat: migrate CLI and HPC lifecycle from argparse to click
src/simulation_project_template/cli.pyandhpc/lifecycle.pyto use click commandgroups and decorators.
click.ClickExceptionfor cleaner CLI errors._PROJECT_ROOT_DEFAULTinhpc/lifecycle.pyto centralize project-root resolution.--testtohpc/lifecycle.py submit, forwarding--config test_mode=true num_instances=1to Snakemake.pyproject.toml,requirements.txt, anduv.lock.tests/test_cli.pyto useclick.testing.CliRunner.fix: bind project root into Apptainer container
hpc/snakemake/run_snakemake.shto set:APPTAINER_BIND="${PWD}:${PWD}"SINGULARITY_BIND="${PWD}:${PWD}"data/andresults/) resolve to writable hostpaths instead of the container image layer.
docs: add architecture overview documentation
docs/architecture.mdanddocs/architecture.png.README.mdanddocs/hpc-workflow.mdwith related documentation clarifications.chore: repository housekeeping and release bump
.gitignoreto ignore root-levelbin/and local-onlyCLAUDE.md.0.2.1to0.3.0.