Task: Implement a Python package for a minimal CLI
Goal
Create a Python package named pyevr (placed under /app/pyevr/) that provides a Click-based command-line interface accessible as from pyevr.main import main. The CLI should print a specific string when run with no arguments and expose standard help output via --help, as required by the tests.
What to implement
Package layout (put under /app/pyevr/):
/app/pyevr/init.py
/app/pyevr/main.py
In /app/pyevr/main.py, implement a Click command named main with the following characteristics:
It is created using the Click decorator so that main resolves to a Click command object when imported (i.e., @click.command() on a function named main).
When invoked with no arguments, the CLI prints a string that contains exactly or at least the substring "pyevr.cli.main" (the tests search for this substring in the output).
The CLI supports the default Click help behavior. Invoking the command with --help should produce exit code 0 and include the line indicating the help option, specifically the string "--help Show this message and exit." in the help output.
The command should not require any positional arguments.
Optional, but recommended:
Include a standard Python entry-point guard in main.py:
if name == 'main':
main()
How the tests map to the implementation
The tests perform:
from pyevr.main import main
runner.invoke(main) and expect:
exit_code == 0
'pyevr.cli.main' in result.output
runner.invoke(main, ['--help']) and expect:
exit_code == 0
'--help Show this message and exit.' in the help output
Notes
The prompt mentions that the implementation could be in /app/pyevr.py or /app/pyevr/ as a package. To satisfy the tests (which import pyevr.main), place the implementation as a package at /app/pyevr/ with a submodule main.py as specified above.
The code should be compatible with Python 3 and rely on the Click library (as used by the tests).