8000 Add support for executing cookiecutter using -m or from a checkout/zip file by brettcannon · Pull Request #788 · cookiecutter/cookiecutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for executing cookiecutter using -m or from a checkout/zip file #788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions __main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""Allow cookiecutter to be executable from a checkout or zip file."""
import runpy


if __name__ == "__main__":
runpy.run_module("cookiecutter", run_name="__main__")
8 changes: 8 additions & 0 deletions cookiecutter/__main__.py
8000
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Allow cookiecutter to be executable through `python -m cookiecutter`."""
from __future__ import absolute_import

from .cli import main


if __name__ == "__main__": # pragma: no cover
main(prog_name="cookiecutter")
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
package_dir={'cookiecutter': 'cookiecutter'},
entry_points={
'console_scripts': [
'cookiecutter = cookiecutter.cli:main',
'cookiecutter = cookiecutter.__main__:main',
]
},
include_package_data=True,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
6939
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from click.testing import CliRunner

from cookiecutter.cli import main
from cookiecutter.__main__ import main
from cookiecutter.main import cookiecutter
from cookiecutter import utils, config

Expand Down
0