Interfaces and implementation choices
Objects suit coherent state and behavior, while pure functions suit transformations. A CLI uses argparse to validate syntax and domain meaning. A packaged entry point must work after installation without depending on the author’s current directory. Keep import side effects out of reusable modules. Import the parser function without printing a demonstration, then invoke the installed command from /tmp with an absolute synthetic fixture path. Independent invocation proves the project’s interface is usable and reveals hidden import or working-directory assumptions that a single successful run from the source folder can conceal. Do not call a package complete because python script.py works once; test the installed entry point and document required interpreter and dependency versions.
Import the parser function without printing a demonstration, then invoke the installed command from /tmp with an absolute synthetic fixture path.
Independent invocation proves the project’s interface is usable and reveals hidden import or working-directory assumptions that a single successful run from the source folder can conceal.
Do not call a package complete because python script.py works once; test the installed entry point and document required interpreter and dependency versions.