rgpycrumbs.cli¶
Attributes¶
Functions¶
|
|
|
True when the active interpreter already has the eOn plot/readcon stack. |
|
Decide whether to run scripts with |
|
PEP 503-ish normalize for comparing package names. |
|
Return |
|
Return the local project root for an editable install of package_name. |
|
Return local editable roots that should satisfy script dependencies. |
|
Returns a sorted list of CLI script names (without extension) in a folder. |
|
Load PyPI pins from uv.lock / pylock / CycloneDX; exit on failure. |
|
Sets up the environment and runs the target script via 'uv run'. |
|
Creates a click command that dispatches to a PEP 723 script. |
|
Dispatcher for PEP 723 scripts (preferred entry; not raw uv run). |
|
Show merged suite config (rgpkgs.toml + ~/.config/rgpkgs/…). |
Module Contents¶
- rgpycrumbs.cli._IN_ENV_STACK_MODULES = ('readcon', 'matplotlib', 'polars', 'ase', 'chemparseplot')[source]¶
- rgpycrumbs.cli._in_env_stack_ready() bool[source]¶
True when the active interpreter already has the eOn plot/readcon stack.
Prefer this over
uv runisolation: a hostuvcache can pull a different Python (e.g. 3.12) while site-packages still hold 3.13 extension modules (numpy), which breaks plotting of readcon-core CON outputs from eOn 2.16+.
- rgpycrumbs.cli._prefer_in_env_interpreter(is_dev: bool, *, force_uv: bool | None = None) bool[source]¶
Decide whether to run scripts with
sys.executableinstead ofuv run.
- rgpycrumbs.cli._normalize_dist_name(name: str) str[source]¶
PEP 503-ish normalize for comparing package names.
- rgpycrumbs.cli._pyproject_project_name(pyproject: pathlib.Path) str | None[source]¶
Return
[project].namefrom a pyproject.toml, if present.
- rgpycrumbs.cli._find_editable_source(package_name: str) pathlib.Path | None[source]¶
Return the local project root for an editable install of package_name.
Wheel installs under
site-packagesmust never map to an unrelated monorepopyproject.tomlabove the env (e.g. eOn root namedeon-akmcwhen looking upchemparseplot). Only return a path when:The module lives outside site-/dist-packages (true editable / src layout), and
The nearest
pyproject.tomlhas[project].namematching package_name.
eOn tooling only needs
eon-schema+pyeonclient; never implyeon-akmc.
- rgpycrumbs.cli._uv_editable_sources() list[pathlib.Path][source]¶
Return local editable roots that should satisfy script dependencies.
Only true editable checkouts of chemparseplot (name-matched). Never the eOn monorepo / eon-akmc tree.
- rgpycrumbs.cli._get_scripts_in_folder(folder_name: str) list[str][source]¶
Returns a sorted list of CLI script names (without extension) in a folder.
Excludes library modules (hdf5_io, plotting) and internal files (__init__, _*). Includes actual CLI entry point scripts.
- rgpycrumbs.cli._load_lock_pins_or_exit(lock_path: str | pathlib.Path) dict[str, str][source]¶
Load PyPI pins from uv.lock / pylock / CycloneDX; exit on failure.
- rgpycrumbs.cli._dispatch(group: str, script_name: str, script_args: tuple, is_dev: bool = False, is_verbose: bool = False, lock_path: str | None = None, sbom_path: str | None = None)[source]¶
Sets up the environment and runs the target script via ‘uv run’.
Preferred entry is this dispatcher (
rgpycrumbs/python -m rgpycrumbs.cli). Rawuv run <script.py>is not the primary path.Pins/lock resolution (highest wins): CLI
--lock/--sbom→ envRGPYCRUMBS_LOCK/_SBOM→ projectrgpycrumbs.toml→ user~/.config/rgpycrumbs/config.toml. Formats: uv.lock, PEP 751 pylock, CycloneDX. TOML[pins.packages]merge on top of the lock file.
- rgpycrumbs.cli._make_script_command(group_name: str, script_stem: str) click.Command[source]¶
Creates a click command that dispatches to a PEP 723 script.
- For full option help, run the script directly:
python -m rgpycrumbs.<group>.<script> –help
- rgpycrumbs.cli.main(ctx, dev, verbose, lock_path, sbom_path)[source]¶
Dispatcher for PEP 723 scripts (preferred entry; not raw uv run).
Each tool is a self-contained script. Prefer:
rgpycrumbs eon plt-neb ... python -m rgpycrumbs.cli eon plt-neb ...
Suite config (shared with chemparseplot and other rgpkgs): project
rgpkgs.tomland user~/.config/rgpkgs/config.tomlfor lock pins and dispatch defaults. Legacyrgpycrumbs.tomlpaths still work.