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

Conversation

brettcannon
Copy link
Contributor

With this change you gain at least three ways to execute cookiecutter:

  1. python -m cookiecutter
  2. From a checkout: python .
  3. From a zip file (that includes all necessary dependencies): python cookiecutter.zip

Closes #787

@codecov-io
Copy link
codecov-io commented Jul 29, 2016

Current coverage is 100% (diff: 100%)

Merging #788 into master will not change coverage

@@           master   #788   diff @@
====================================
  Files          14     15     +1   
  Lines         599    601     +2   
  Methods         0      0          
  Messages        0      0          
  Branches        0      0          
====================================
+ Hits          599    601     +2   
  Misses          0      0          
  Partials        0      0          

Sunburst

Powered by Codecov. Last update 5db20b2...63a2dee

@hackebrot
Copy link
Member
hackebrot commented Jul 29, 2016

Thank you for submitting a PR @brettcannon! 🙇

It looks like click shows a wrong command name:

$ python -m cookiecutter
Usage: __main__.py [OPTIONS] TEMPLATE [EXTRA_CONTEXT]...

Error: Missing argument "template".
$ python -m cookiecutter --help
Usage: __main__.py [OPTIONS] TEMPLATE [EXTRA_CONTEXT]...

  Create a project from a Cookiecutter project template (TEMPLATE).

I'm looking into click right now to see if there is a way to set this rather than compute the name automatically:

@hackebrot hackebrot added enhancement This issue/PR relates to a feature request. needs-review PR Only: This PR require review from other developer labels Jul 29, 2016
@pydanny
Copy link
Member
pydanny commented Jul 29, 2016

Coverage dropped to 99.83%. It's always the tiny cases at the end that are hard. 👅



if __name__ == "__main__":
main()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The click help message issue seems to be fixed when this is changed to:

if __name__ == "__main__":
    main(prog_name='cookiecutter')

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cookiecutter [raphael@hackebook cookiecutter (brettcannon-main_submodule)]$ python -m cookiecutter
Usage: cookiecutter [OPTIONS] TEMPLATE [EXTRA_CONTEXT]...

Error: Missing argument "template".
cookiecutter [raphael@hackebook cookiecutter (brettcannon-main_submodule)]$ cookiecutter
Usage: cookiecutter [OPTIONS] TEMPLATE [EXTRA_CONTEXT]...

Error: Missing argument "template".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for figuring that out! Fixed in latest commit.

@brettcannon
Copy link
Contributor Author

Coverage should now be fixed as I marked the if __name__ ... block to not be covered.

@hackebrot
Copy link
Member

LGTM 👍

@audreyr @pydanny @michaeljoseph

@pydanny pydanny merged commit e072aaf into cookiecutter:master Jul 30, 2016
hackebrot added a commit that referenced this pull request Jul 30, 2016
@hackebrot
Copy link
Member

Thanks again @brettcannon! 😃

@brettcannon
Copy link
Contributor Author

Welcome! Glad I could help out in my own little way. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue/PR relates to a feature request. needs-review PR Only: This PR require review from other developer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0