Conversation
Add a minimal Python package with a CLI wrapper and Sphinx docs plus pyproject metadata for future packaging.
Reviewer's GuideIntroduces a minimal Sequence diagram for cleed CLI wrapper invocation flowsequenceDiagram
actor User
participant Shell
participant CleedCli as cleed.cli_main
participant ArgParser as argparse_ArgumentParser
participant Shutil as shutil
participant Subproc as subprocess
User->>Shell: run command
Shell->>CleedCli: cleed tool args
CleedCli->>ArgParser: build_parser()
ArgParser-->>CleedCli: parser
CleedCli->>ArgParser: parse_args(argv)
ArgParser-->>CleedCli: args
alt version flag
CleedCli-->>User: print __version__
CleedCli-->>Shell: exit 0
else list_tools flag
CleedCli-->>User: print TOOLS listing
CleedCli-->>Shell: exit 0
else missing tool
CleedCli-->>User: print_help
CleedCli-->>Shell: exit 2
else unknown tool
CleedCli-->>User: stderr Unknown tool
CleedCli-->>User: stderr Use --list-tools
CleedCli-->>Shell: exit 2
else valid tool
CleedCli->>Shutil: which(tool)
Shutil-->>CleedCli: binary_path or None
alt binary not found
CleedCli-->>User: stderr Executable not found on PATH
CleedCli-->>Shell: exit 127
else binary found
CleedCli->>CleedCli: normalize tool_args (strip leading --)
CleedCli->>Subproc: run([binary] + tool_args, check False)
Subproc-->>CleedCli: result.returncode
CleedCli-->>Shell: exit result.returncode
end
end
Class diagram for cleed Python package and CLI moduleclassDiagram
class cleed {
+str __version__ = 0.0.0
}
class cli {
+dict TOOLS
+str resolve_tool(name str)
+int run_tool(binary str, args List_str)
+argparse_ArgumentParser build_parser()
+int main(argv List_str_optional)
}
cleed <.. cli : imports __version__
class pyproject_toml {
+str name = cleed
+str version = 0.0.0
+str requires_python >= 3.8
+list optional_dependency_phaseshifts
+str console_script_cleed = cleed.cli:main
+str build_backend = setuptools.build_meta
}
pyproject_toml --> cleed : defines package
pyproject_toml --> cli : exposes console script
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
|
Clarifications for #37:
|
Codacy's Analysis Summary3 new issues (≤ 0 issue) Review Pull Request in Codacy →
|
Problem
Issue #37 asks for a
cleedPython package that enables CLI usage and a path toward bundled binaries and wheels.Solution
pyproject.tomlwith minimal package metadata.cleedPython package that provides a CLI wrapper for existing CLEED executables onPATH.Testing
Follow-ups
Summary by Sourcery
Introduce a minimal Python
cleedpackage providing a CLI entry point that wraps existing CLEED executables discovered on PATH.New Features:
cleedPython package exposing acleedconsole script to run CLEED tools such ascleed_nsym,cleed_sym,csearch, andcrfacfrom a Python installation.Build:
pyproject.tomlconfigured with setuptools to build and distribute thecleedpackage, including an optionalphaseshiftsextra dependency.Documentation: