Skip to content

Commit

Permalink
Support running with python -m <package> (#27)
Browse files Browse the repository at this point in the history
cjolowicz/cookiecutter-hypermodern-python-instance#24

* Allow script invocation via python -m

* Add module docstring

* Disable coverage for __main__
  • Loading branch information
cjolowicz committed Feb 24, 2020
1 parent a775dc8 commit 99b7699
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions {{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ source = ["src", "*/site-packages"]
[tool.coverage.run]
branch = true
source = ["{{cookiecutter.package_name}}"]
omit = ["*/{{cookiecutter.package_name}}/__main__.py"]

[tool.coverage.report]
show_missing = true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Main module."""
from . import console


console.main(prog_name="{{cookiecutter.project_name}}")

0 comments on commit 99b7699

Please sign in to comment.