[Python-modules-commits] [cookiecutter] 01/06: Import cookiecutter_1.1.0.orig.tar.gz
Vincent Bernat
bernat at moszumanska.debian.org
Fri Oct 9 18:01:23 UTC 2015
This is an automated email from the git hooks/post-receive script.
bernat pushed a commit to branch master
in repository cookiecutter.
commit e54282d9b5cb0425475785de006a787e953b6e92
Author: Vincent Bernat <bernat at debian.org>
Date: Fri Oct 9 19:35:44 2015 +0200
Import cookiecutter_1.1.0.orig.tar.gz
---
.gitignore | 1 +
.travis.yml | 4 +-
AUTHORS.rst | 32 ++-
CONTRIBUTING.rst | 99 ++++++--
HISTORY.rst | 96 +++++++-
Makefile | 6 +-
README.rst | 84 +++++--
appveyor.yml | 20 +-
appveyor/install.ps1 | 86 -------
appveyor/setup_build_env.cmd | 16 --
cookiecutter/__init__.py | 7 +-
cookiecutter/cli.py | 71 +++---
cookiecutter/compat.py | 140 ------------
cookiecutter/config.py | 8 +-
cookiecutter/exceptions.py | 13 ++
cookiecutter/generate.py | 98 +++++++-
cookiecutter/main.py | 64 ++++--
cookiecutter/prompt.py | 152 +++++++++----
cookiecutter/replay.py | 57 +++++
cookiecutter/vcs.py | 14 +-
docs/advanced_usage.rst | 61 +++++
docs/conf.py | 4 +-
docs/contributor_guidelines.rst | 3 +-
docs/contributor_setup.rst | 15 +-
docs/contributor_testing.rst | 24 +-
docs/cookiecutter.rst | 10 +-
docs/core_committer_guide.rst | 10 +
docs/installation.rst | 27 ++-
docs/troubleshooting.rst | 6 +
logo/cookiecutter-logo-large.png | Bin 0 -> 93083 bytes
logo/cookiecutter-logo.svg | 99 ++++++++
setup.py | 62 ++---
tests/conftest.py | 95 +++++---
tests/replay/conftest.py | 31 +++
tests/replay/test_dump.py | 101 +++++++++
tests/replay/test_load.py | 65 ++++++
tests/replay/test_replay.py | 63 ++++++
tests/test-config/valid-config.yaml | 1 +
.../{{cookiecutter.repo_name}}/README.rst | 5 +
.../{{cookiecutter.repo_name}}/README.txt | 5 +
.../rendered/not_rendered.yml | 2 +
.../README.rst | 5 +
.../{{cookiecutter.repo_name}}-rendered/README.rst | 5 +
.../{{cookiecutter.repo_name}}-rendered/README.txt | 5 +
.../{{cookiecutter.filename}}.py | 1 -
tests/test-pyhooks/hooks/post_gen_project.py | 1 -
tests/test-pyhooks/hooks/pre_gen_project.py | 1 -
tests/test-pyshellhooks/hooks/post_gen_project.py | 1 -
tests/test-pyshellhooks/hooks/pre_gen_project.py | 1 -
tests/test-replay/cookiedozer_load.json | 1 +
tests/test-replay/invalid_replay.json | 1 +
tests/test_cli.py | 184 ++++++++++++++-
tests/test_compat.py | 19 --
tests/test_cookiecutter_invocation.py | 53 +++++
tests/test_cookiecutter_local_with_input.py | 8 +-
tests/test_cookiecutter_repo_arg.py | 11 +-
tests/test_generate_context.py | 22 +-
tests/test_generate_copy_without_render.py | 71 ++++++
tests/test_generate_files.py | 6 +
tests/test_get_config.py | 13 +-
tests/test_get_user_config.py | 1 +
tests/test_main.py | 29 +++
tests/test_output_folder.py | 17 ++
tests/test_preferred_encoding.py | 27 +++
tests/test_prompt.py | 251 ++++++++++++++-------
tests/test_read_user_choice.py | 41 ++++
tests/test_read_user_variable.py | 24 ++
tests/test_read_user_yes_no.py | 28 +++
tests/test_specify_output_dir.py | 69 ++++++
tests/test_vcs.py | 38 ++++
tests/test_vcs_prompt.py | 16 +-
tox.ini | 21 +-
72 files changed, 2072 insertions(+), 656 deletions(-)
diff --git a/.gitignore b/.gitignore
index d1d17a0..b3c9815 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,6 +24,7 @@ pip-log.txt
# Unit test / coverage reports
.coverage
.tox
+.cache
nosetests.xml
# Translations
diff --git a/.travis.yml b/.travis.yml
index ab46016..e315d1b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,6 @@
# Config file for automatic testing at travis-ci.org
+sudo: false
language: python
python: 2.7
env:
@@ -16,5 +17,6 @@ install:
after_success:
# Report coverage results to codecov.io
+ # and export tox environment variables
- pip install codecov
- - codecov
+ - codecov -e TOX_ENV
diff --git a/AUTHORS.rst b/AUTHORS.rst
index 3ec490d..4b0888b 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -2,17 +2,18 @@
Credits
=======
-Development Lead
-----------------
+Development Leads
+-----------------
-* Audrey Roy <audreyr at gmail.com>
+* Audrey Roy Greenfeld (`@audreyr`_)
+* Daniel Roy Greenfeld (`@pydanny`_)
Core Committers
---------------
-* Daniel Greenfeld (`@pydanny`_)
* Michael Joseph (`@michaeljoseph`_)
* Paul Moore (`@pfmoore`_)
+* Raphael Pierzina (`@hackebrot`_)
Contributors
------------
@@ -42,7 +43,6 @@ Contributors
* Dave Dash (`@davedash`_)
* Johan Charpentier (`@cyberj`_)
* Éric Araujo (`@merwok`_)
-* Raphael Pierzina (`@hackebrot`_)
* saxix (`@saxix`_)
* Tzu-ping Chung (`@uranusjr`_)
* Caleb Hattingh (`@cjrh`_)
@@ -65,7 +65,21 @@ Contributors
* Randy Syring (`@rsyring`_)
* Mark Jones (`@mark0978`_)
* Marc Abramowitz (`@msabramo`_)
+* Lucian Ursu (`@LucianU`_)
+* Osvaldo Santana Neto (`@osantana`_)
+* Matthias84 (`@Matthias84`_)
+* Simeon Visser (`@svisser`_)
+* Guruprasad (`@lgp171188`_)
+* Charles-Axel Dein (`@charlax`_)
+* Diego Garcia (`@drgarcia1986`_)
+* maiksensi (`@maiksensi`_)
+* Andrew Conti (`@agconti`_)
+* Valentin Lab (`@vaab`_)
+.. _`@maiksensi`: https://github.com/maiksensi
+.. _`@svisser`: https://github.com/svisser
+.. _`@LucianU`: https://github.com/LucianU
+.. _`@osantana`: https://github.com/osantana
.. _`@msabramo`: https://github.com/msabramo
.. _`@mark0978`: https://github.com/mark0978
.. _`@rsyring`: https://github.com/rsyring
@@ -107,7 +121,7 @@ Contributors
.. _`@emonty`: https://github.com/emonty
.. _`@schacki`: https://github.com/schacki
.. _`@ryanolson`: https://github.com/ryanolson
-.. _`@treyhunner`: https://github.com/treyhunner
+.. _`@treyhunner`: https://github.com/treyhunner
.. _`@freakboy3742`: https://github.com/freakboy3742
.. _`@mishbahr`: https://github.com/mishbahr
.. _`@robinandeer`: https://github.com/robinandeer
@@ -118,3 +132,9 @@ Contributors
.. _`@ramiroluz`: https://github.com/ramiroluz
.. _`@thedrow`: https://github.com/thedrow
.. _`@lord63`: https://github.com/lord63
+.. _`@Matthias84`: https://github.com/Matthias84
+.. _`@lgp171188`: https://github.com/lgp171188
+.. _`@charlax`: https://github.com/charlax
+.. _`@drgarcia1986`: https://github.com/drgarcia1986
+.. _`@agconti`: https://github.com/agconti
+.. _`@vaab`: https://github.com/vaab
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 0e4c438..9493126 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -105,10 +105,15 @@ Now you can make your changes locally.
5. When you're done making changes, check that your changes pass the tests and flake8::
- $ flake8 cookiecutter tests
- $ python setup.py test
+ $ pip install tox
$ tox
+Please note that tox runs flake8 automatically, since we have a test environment for it.
+
+If you feel like running only the flake8 environment, please use the following command::
+
+ $ tox -e flake8
+
6. Commit your changes and push your branch to GitHub::
$ git add .
@@ -117,11 +122,10 @@ Now you can make your changes locally.
7. Check that the test coverage hasn't dropped::
- coverage run --source cookiecutter setup.py test
- coverage report -m
- coverage html
+ $ tox -e cov-report
-8. Submit a pull request through the GitHub website.
+8. Submit a pull request through the GitHub website.
+
Contributor Guidelines
-----------------------
@@ -134,7 +138,7 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
-3. The pull request should work for Python 2.6, 2.7, 3.3, and PyPy on Appveyor and Travis CI.
+3. The pull request should work for Python 2.7, 3.3, 3.4, 3.5, and PyPy on Appveyor and Travis CI.
4. Check https://travis-ci.org/audreyr/cookiecutter/pull_requests and
https://ci.appveyor.com/project/audreyr/cookiecutter/history to ensure the tests pass for all supported Python versions and platforms.
@@ -143,35 +147,50 @@ Coding Standards
* PEP8
* Functions over classes except in tests
-* Prefer single quotes (unless inconvenient) http://stackoverflow.com/a/56190/5549
-
-Testing
--------
+* Quotes via http://stackoverflow.com/a/56190/5549
-To run a particular test::
+ * Use double quotes around strings that are used for interpolation or that are natural language messages
+ * Use single quotes for small symbol-like strings (but break the rules if the strings contain quotes)
+ * Use triple double quotes for docstrings and raw string literals for regular expressions even if they aren't needed.
+ * Example:
- $ python -m unittest tests.test_find.TestFind.test_find_template
+ .. code-block:: python
-To run a subset of tests::
+ LIGHT_MESSAGES = {
+ 'English': "There are %(number_of_lights)s lights.",
+ 'Pirate': "Arr! Thar be %(number_of_lights)s lights."
+ }
- $ python -m unittest tests.test_find
+ def lights_message(language, number_of_lights):
+ """Return a language-appropriate string reporting the light count."""
+ return LIGHT_MESSAGES[language] % locals()
-Testing with py.test
---------------------
+ def is_pirate(message):
+ """Return True if the given message sounds piratical."""
+ return re.search(r"(?i)(arr|avast|yohoho)!", message) is not None
-To run a particular test class with py.test::
+ * Write new code in Python 3.
+
+Testing with tox
+----------------
- $ py.test -k TestGetConfig
+Tox uses py.test under the hood, hence it supports the same syntax for selecting tests.
+
+For further information please consult the `pytest usage docs`_.
+
+To run a particular test class with tox::
+
+ $ tox -e py '-k TestFindHooks'
To run some tests with names matching a string expression::
- $ py.test -k generate
+ $ tox -e py '-k generate'
Will run all tests matching "generate", test_generate_files for example.
To run just one method::
- $ py.test -k TestGetConfig::test_get_config
+ $ tox -e py '-k "TestFindHooks and test_find_hook"'
To run all tests using various versions of python in virtualenvs defined in tox.ini, just run tox.::
@@ -198,6 +217,7 @@ Python 3.3 tests fail locally
Try upgrading Tox to the latest version. I noticed that they were failing
locally with Tox 1.5 but succeeding when I upgraded to Tox 1.7.1.
+.. _`pytest usage docs`: https://pytest.org/latest/usage.html#specifying-tests-selecting-tests
Core Committer Guide
====================
@@ -328,6 +348,43 @@ Milestone size:
* If a milestone contains too much, move some to the next milestone.
* Err on the side of more frequent patch releases.
+Process: Pull Request merging and HISTORY.rst maintenance
+---------------------------------------------------------
+
+If you merge a pull request, you're responsible for updating `AUTHORS.rst` and `HISTORY.rst`
+
+When you're processing the first change after a release, create boilerplate following the existing pattern:
+
+ x.y.z (Development)
+ ~~~~~~~~~~~~~~~~~~~
+
+ The goals of this release are TODO: release summary of features
+
+ Features:
+
+ * Feature description, thanks to @contributor (#PR).
+
+ Bug Fixes:
+
+ * Bug fix description, thanks to @contributor (#PR).
+
+ Other changes:
+
+ * Description of the change, thanks to @contributor (#PR).
+
+ .. _`@contributor`: https://github.com/contributor
+
+Process: Accepting Template Pull Requests
+-----------------------------------------
+
+#. Run the template to generate the project.
+#. Attempt to start/use the rendered project.
+#. Merge the template in.
+#. Update the history file.
+
+.. note:: Adding a template doesn't give authors credit.
+
+
Process: Generating CONTRIBUTING.rst
-------------------------------------
diff --git a/HISTORY.rst b/HISTORY.rst
index 1de670d..7c45b52 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -3,14 +3,99 @@
History
-------
-1.0.0 (2015-01-13) Chocolate Chip
+1.1.0 (2015-09-26)
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+The goals of this release is to add extra content via the command-line and `copy without render`_.
+
+Features:
+
+* Added `copy without render`_ feature, making it much easier for developers of Ansible, Salt Stack, and other recipe-based tools to work with Cookiecutter. Thanks to `@osantana`_ and `@LucianU`_ for their innovation, as well as `@hackebrot`_ for fixing the Windows problems (#132, #184, #425).
+* Added `specify output directory`, thanks to `tony` and `@hackebrot`_ (#531, #452),
+* Abort template rendering if the project output directory already exists, thanks to `@lgp171188`_ (#470, #471).
+* Add a flag to overwrite existing output directory, thanks to `@lgp171188`_ for the implementation (#495) and `@schacki`_, `@ionelmc`_, `@pydanny`_ and `@hackebrot`_ for submitting issues and code reviews (#475, #493).
+* Remove test command in favor of tox, thanks to `@hackebrot`_ (#480).
+* Allow cookiecutter invocation, even without installing it, via ``python -m cookiecutter.cli``, thanks to `@vincentbernat`_ and `@hackebrot`_ (#449, #487).
+* Improve the type detection handler for online and offline repositories, thanks to `@charlax`_ (#490).
+* Add replay feature, thanks to `@hackebrot`_ (#501).
+* Be more precise when raising an error for an invalid user config file, thanks to `@vaab`_ and `@hackebrot`_ (#378, #528).
+* Added official Python 3.5 support, thanks to `@pydanny`_ and `@hackebrot`_ (#522).
+
+Other Changes:
+
+* Updated click requirement to < 6.0, thanks to `@pydanny`_ (#473).
+* Added landscape.io flair, thanks to `@michaeljoseph`_ (#439).
+* Descriptions of PEP8 specifications and milestone management, thanks to `@michaeljoseph`_ (#440).
+* Added alternate installation options in the documentation, thanks to `@pydanny`_ (#117, #315).
+* The test of the `which()` function now tests against the `date` command, thanks to `@vincentbernat`_ (#446)
+* Ensure file handles in setup.py are closed using with statement, thanks to `@svisser`_ (#280).
+* Removed deprecated and fully extraneous `compat.is_exe()` function, thanks to `@hackebrot`_ (#485).
+* Disabled sudo in .travis, thanks to `@hackebrot`_ (#482).
+* Switched to shields.io for problematic badges, thanks to `@pydanny`_ (#491).
+* Added whichcraft and removed ``compat.which()``, thanks to `@pydanny`_ (#511).
+* Changed to export tox environment variables to codecov, thanks to `@maiksensi`_. (#508).
+* Moved to using click version command, thanks to `@hackebrot`_ (#489).
+* Don't use unicode_literals to please click, thanks to `@vincentbernat`_ (#503).
+* Remove warning for Python 2.6 from __init__.py, thanks to `@hackebrot`_.
+* Removed `compat.py` module, thanks to `@hackebrot`_.
+* Added `future` to requirements, thanks to `@hackebrot`_.
+* Fixed problem where expanduser does not resolve "~" correctly on windows 10 using tox, thanks to `@maiksensi`_. (#527)
+* Added more cookiecutter templates to the mix:
+
+ * `cookiecutter-beamer`_ by `@luismartingil`_ (#307)
+ * `cookiecutter-pytest-plugin`_ by `@pytest-dev`_ and `@hackebrot`_ (#481)
+ * `cookiecutter-csharp-objc-binding`_ by `@SandyChapman`_ (#460)
+ * `cookiecutter-flask-foundation`_ by `@JackStouffer`_ (#457)
+ * `cookiecutter-tryton`_ by `@fulfilio`_ (#465)
+ * `cookiecutter-tapioca`_ by `@vintasoftware`_ (#496)
+ * `cookiecutter-sublime-text-3-plugin`_ by `@kkujawinski`_ (#500)
+ * `cookiecutter-muffin`_ by `@drgarcia1986`_ (#494)
+ * `cookiecutter-django-rest`_ by `@agconti`_ (#520)
+ * `cookiecutter-es6-boilerplate`_ by `@agconti`_ (#521)
+ * `cookiecutter-tampermonkey`_ by `@christabor`_ (#516)
+ * `cookiecutter-wagtail`_ by `@torchbox`_ (#533)
+
+.. _`@maiksensi`: https://github.com/maiksensi
+.. _`copy without render`: http://cookiecutter.readthedocs.org/en/latest/advanced_usage.html#copy-without-render
+.. _`@osantana`: https://github.com/osantana
+.. _`@LucianU`: https://github.com/LucianU
+.. _`@svisser`: https://github.com/svisser
+.. _`@lgp171188`: https://github.com/lgp171188
+.. _`@SandyChapman`: https://github.com/SandyChapman
+.. _`@JackStouffer`: https://github.com/JackStouffer
+.. _`@fulfilio`: https://github.com/fulfilio
+.. _`@vintasoftware`: https://github.com/vintasoftware
+.. _`@kkujawinski`: https://github.com/kkujawinski
+.. _`@charlax`: https://github.com/charlax
+.. _`@drgarcia1986`: https://github.com/drgarcia1986
+.. _`@agconti`: https://github.com/agconti
+.. _`@vaab`: https://github.com/vaab
+.. _`@christabor`: https://github.com/christabor
+.. _`@torchbox`: https://github.com/torchbox
+
+.. _`cookiecutter-beamer`: https://github.com/luismartingil/cookiecutter-beamer
+.. _`@luismartingil`: https://github.com/luismartingil
+.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin
+.. _`@pytest-dev`: https://github.com/pytest-dev
+.. _`cookiecutter-csharp-objc-binding`: https://github.com/SandyChapman/cookiecutter-csharp-objc-binding
+.. _`cookiecutter-flask-foundation`: https://github.com/JackStouffer/cookiecutter-Flask-Foundation
+.. _`cookiecutter-tryton`: https://github.com/fulfilio/cookiecutter-tryton
+.. _`cookiecutter-tapioca`: https://github.com/vintasoftware/cookiecutter-tapioca
+.. _`cookiecutter-sublime-text-3-plugin`: https://github.com/kkujawinski/cookiecutter-sublime-text-3-plugin
+.. _`cookiecutter-muffin`: https://github.com/drgarcia1986/cookiecutter-muffin
+.. _`cookiecutter-django-rest`: https://github.com/agconti/cookiecutter-django-rest
+.. _`cookiecutter-es6-boilerplate`: https://github.com/agconti/cookiecutter-es6-boilerplate
+.. _`cookiecutter-tampermonkey`: https://github.com/christabor/cookiecutter-tampermonkey
+.. _`cookiecutter-wagtail`: https://github.com/torchbox/cookiecutter-wagtail
+
+1.0.0 (2015-03-13) Chocolate Chip
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The goals of this release was to formally remove support for Python 2.6 and continue the move to using py.test.
Features:
-* Lay the foundation for `py.test` fixtures and convert `test_generate.py` and `test_examples.py`, thanks to `@hackebrot`_ (#322, #332, #334, #336, #337, #338, #340, #341, #343, #345, #347, #351, #412, #413, #414).
+* Convert the unittest suite to py.test for the sake of comprehensibility, thanks to `@hackebrot`_ (#322, #332, #334, #336, #337, #338, #340, #341, #343, #345, #347, #351, #412, #413, #414).
* Generate pytest coverage, thanks to `@michaeljoseph`_ (#326).
* Documenting of Pull Request merging and HISTORY.rst maintenance, thanks to `@michaeljoseph`_ (#330).
* Large expansions to the tutorials thanks to `@hackebrot`_ (#384)
@@ -26,9 +111,6 @@ Other Changes:
* Updated to Jinja 2.7 or higher in order to control trailing new lines in templates, thanks to `@sfermigier`_ (#356).
* Tweaked flake8 to ignore e731, thanks to `@michaeljoseph`_ (#390).
* Fixed failing Windows tests and corrected AppVeyor badge link thanks to `@msabramo`_ (#403).
-
-.. _`@msabramo`: https://github.com/msabramo
-
* Added more Cookiecutters to the list:
* `cookiecutter-scala-spark`_ by `@jpzk`_
@@ -38,6 +120,7 @@ Other Changes:
* `cookiecutter-django-rest-framework`_ by `@jpadilla`_
* `cookiedozer`_ by `@hackebrot`_
+.. _`@msabramo`: https://github.com/msabramo
.. _`@marctc`: https://github.com/marctc
.. _`cookiedozer`: https://github.com/hackebrot/cookiedozer
.. _`@jpadilla`: https://github.com/jpadilla
@@ -274,7 +357,7 @@ New features:
Bug fixes:
* Unicode issues with prompts and answers are fixed, thanks to `@s-m-i-t-a`_.
-* The test suite now runs on Windows, which was a major effort. Thanks to
+* The test suite now runs on Windows, which was a major effort. Thanks to
`@pydanny`_, who collaborated on this with me.
Other changes:
@@ -402,4 +485,3 @@ Roadmap
-------
https://github.com/audreyr/cookiecutter/milestones?direction=desc&sort=due_date&state=open
-
diff --git a/Makefile b/Makefile
index b3ec324..9e0208b 100644
--- a/Makefile
+++ b/Makefile
@@ -27,16 +27,14 @@ lint:
flake8 cookiecutter tests
test:
- python setup.py test
+ tox -e py
test-all:
tox
coverage:
- coverage run --source cookiecutter setup.py test
- coverage report -m
- coverage html
+ tox -e cov-report
open htmlcov/index.html
docs:
diff --git a/README.rst b/README.rst
index fc6066a..4e96806 100644
--- a/README.rst
+++ b/README.rst
@@ -2,8 +2,8 @@
Cookiecutter
=============
-.. image:: https://badge.fury.io/py/cookiecutter.png
- :target: http://badge.fury.io/py/cookiecutter
+.. image:: https://img.shields.io/pypi/v/cookiecutter.svg
+ :target: https://pypi.python.org/pypi/cookiecutter/1.0.0
.. image:: https://travis-ci.org/audreyr/cookiecutter.png?branch=master
:target: https://travis-ci.org/audreyr/cookiecutter
@@ -11,8 +11,8 @@ Cookiecutter
.. image:: https://ci.appveyor.com/api/projects/status/github/audreyr/cookiecutter?branch=master
:target: https://ci.appveyor.com/project/audreyr/cookiecutter/branch/master
-.. image:: https://pypip.in/d/cookiecutter/badge.png
- :target: https://crate.io/packages/cookiecutter?version=latest
+.. image:: https://img.shields.io/pypi/dm/cookiecutter.svg
+ :target: https://pypi.python.org/pypi/cookiecutter/1.0.0
.. image:: https://codecov.io/github/audreyr/cookiecutter/coverage.svg?branch=master
:target: https://codecov.io/github/audreyr/cookiecutter?branch=master
@@ -24,6 +24,10 @@ Cookiecutter
:target: https://readthedocs.org/projects/cookiecutter/?badge=latest
:alt: Documentation Status
+.. image:: https://landscape.io/github/audreyr/cookiecutter/master/landscape.svg?style=flat
+ :target: https://landscape.io/github/audreyr/cookiecutter/master
+ :alt: Code Health
+
A command-line utility that creates projects from **cookiecutters** (project
templates), e.g. creating a Python package project from a Python package project template.
@@ -41,7 +45,7 @@ Did someone say features?
* Cross-platform: Windows, Mac, and Linux are officially supported.
-* Works with Python 2.6, 2.7, 3.3, 3.4, and PyPy. *(But you don't have to know/write Python
+* Works with Python 2.7, 3.3, 3.4, 3.5, and PyPy. *(But you don't have to know/write Python
code to use Cookiecutter.)*
* Project templates can be in any programming language or markup format:
@@ -146,22 +150,14 @@ Make your own, then submit a pull request adding yours to this list!
Python
~~~~~~
-
* `cookiecutter-pypackage`_: `@audreyr`_'s ultimate Python package project
template.
* `cookiecutter-flask`_ : A Flask template with Bootstrap 3, starter templates, and working user registration.
+* `cookiecutter-flask-foundation`_ : Flask Template with caching, forms, sqlalchemy and unit-testing.
* `cookiecutter-bottle`_ : A cookiecutter template for creating reusable Bottle projects quickly.
-* `cookiecutter-simple-django`_: A cookiecutter template for creating reusable Django projects quickly.
-* `cookiecutter-django`_: A bleeding edge Django project template with Bootstrap 3, customizable users app, starter templates, and working user registration.
-* `cookiecutter-djangopackage`_: A template designed to create reusable third-party PyPI friendly Django apps. Documentation is written in tutorial format.
-* `cookiecutter-django-cms`_: A template for Django CMS with simple Bootstrap 3 template. It has a quick start and deploy documentation.
-* `cookiecutter-djangocms-plugin`_: A template to get started with custom plugins for django-cms
* `cookiecutter-openstack`_: A template for an OpenStack project.
* `cookiecutter-docopt`_: A template for a Python command-line script that uses `docopt`_ for arguments parsing.
-* `cookiecutter-django-crud`_: A template to create a Django app with boilerplate CRUD around a model including a factory and tests.
* `cookiecutter-quokka-module`_: A template to create a blueprint module for Quokka Flask CMS.
-* `cookiecutter-django-lborgav`_: Another cookiecutter template for Django project with Booststrap 3 and FontAwesome 4.
-* `cookiecutter-django-paas`_: Django template ready to use in SAAS platforms like Heroku, OpenShift, etc..
* `cookiecutter-kivy`_: A template for NUI applications built upon the kivy python-framework.
* `cookiedozer`_: A template for Python Kivy apps ready to be deployed to android devices with Buildozer.
* `cookiecutter-pypackage-minimal`_: A mimimal Python package template.
@@ -171,7 +167,26 @@ Python
* `cookiecutter-pyvanguard`_: A template for cutting edge Python development. `Invoke`_, pytest, bumpversion, and Python 2/3 compatability.
* `Python-iOS-template`_: A template to create a Python project that will run on iOS devices.
* `Python-Android-template`_: A template to create a Python project that will run on Android devices.
+* `cookiecutter-tryton`_: A template for creating tryton modules.
+* `cookiecutter-pytest-plugin`_: Minimal Cookiecutter template for authoring `pytest`_ plugins that help you to write better programs.
+* `cookiecutter-tapioca`_: A Template for building `tapioca-wrapper`_ based web API wrappers (clients).
+* `cookiecutter-sublime-text-3-plugin`_: Sublime Text 3 plugin template with custom settings, commands, key bindings and main menu.
+* `cookiecutter-muffin`_: A Muffin template with Bootstrap 3, starter templates, and working user registration.
+
+Python-Django
+^^^^^^^^^^^^^
+
+* `cookiecutter-django-rest`_: For creating REST apis for mobile and web applications.
+* `cookiecutter-simple-django`_: A cookiecutter template for creating reusable Django projects quickly.
+* `cookiecutter-django`_: A bleeding edge Django project template with Bootstrap 3, customizable users app, starter templates, and working user registration.
+* `cookiecutter-djangopackage`_: A template designed to create reusable third-party PyPI friendly Django apps. Documentation is written in tutorial format.
+* `cookiecutter-django-cms`_: A template for Django CMS with simple Bootstrap 3 template. It has a quick start and deploy documentation.
+* `cookiecutter-djangocms-plugin`_: A template to get started with custom plugins for django-cms
+* `cookiecutter-django-crud`_: A template to create a Django app with boilerplate CRUD around a model including a factory and tests.
+* `cookiecutter-django-lborgav`_: Another cookiecutter template for Django project with Booststrap 3 and FontAwesome 4
+* `cookiecutter-django-paas`_: Django template ready to use in SAAS platforms like Heroku, OpenShift, etc..
* `cookiecutter-django-rest-framework`_: A template for creating reusable Django REST Framework packages.
+* `cookiecutter-wagtail`_ : A cookiecutter template for `Wagtail`_ CMS based sites.
C
~~
@@ -184,6 +199,13 @@ C++
* `BoilerplatePP`_: A simple cmake template with unit testing for projects written in C++.
+C#
+~~
+
+* `cookiecutter-csharp-objc-binding`_: A template for generating a C# binding project for binding an Objective-C static library.
+
+.. _`cookiecutter-csharp-objc-binding`: https://github.com/SandyChapman/cookiecutter-csharp-objc-binding
+
Common Lisp
~~~~~~~~~~~
@@ -192,18 +214,23 @@ Common Lisp
JS
~~
+* `cookiecutter-es6-boilerplate`_: A cookiecutter for front end projects in ES6.
* `cookiecutter-jquery`_: A jQuery plugin project template based on jQuery
Boilerplate.
* `cookiecutter-jswidget`_: A project template for creating a generic front-end,
non-jQuery JS widget packaged for multiple JS packaging systems.
* `cookiecutter-component`_: A template for a Component JS package.
+* `cookiecutter-tampermonkey`_: A template for a TamperMonkey browser script.
LaTeX/XeTeX
~~~~~~~~~~~
* `pandoc-talk`_: A cookiecutter template for giving talks with pandoc and XeTeX.
+
* `cookiecutter-latex-article`_: A LaTeX template geared towards academic use.
+* `cookiecutter-beamer`_: A template for a LaTeX Beamer presentation.
+
Berkshelf-Vagrant
~~~~~~~~~~~~~~~~~
@@ -217,9 +244,12 @@ HTML
* `cookiecutter-complexity`_: A cookiecutter for a Complexity static site with Bootstrap 3.
* `cookiecutter-tumblr-theme`_: A cookiecutter for a Tumblr theme project with GruntJS as concatination tool.
+.. _`cookiecutter-django-rest`: https://github.com/agconti/cookiecutter-django-rest
+.. _`cookiecutter-es6-boilerplate`: https://github.com/agconti/cookiecutter-es6-boilerplate
.. _`cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
.. _`cookiecutter-jquery`: https://github.com/audreyr/cookiecutter-jquery
.. _`cookiecutter-flask`: https://github.com/sloria/cookiecutter-flask
+.. _`cookiecutter-flask-foundation`: https://github.com/JackStouffer/cookiecutter-Flask-Foundation
.. _`cookiecutter-bottle`: https://github.com/avelino/cookiecutter-bottle
.. _`cookiecutter-simple-django`: https://github.com/marcofucci/cookiecutter-simple-django
.. _`cookiecutter-django`: https://github.com/pydanny/cookiecutter-django
@@ -238,6 +268,7 @@ HTML
.. _`BoilerplatePP`: https://github.com/Paspartout/BoilerplatePP
.. _`cookiecutter-openstack`: https://github.com/openstack-dev/cookiecutter
.. _`cookiecutter-component`: https://github.com/audreyr/cookiecutter-component
+.. _`cookiecutter-tampermonkey`: https://github.com/christabor/cookiecutter-tampermonkey
.. _`cookiecutter-docopt`: https://github.com/sloria/cookiecutter-docopt
.. _`docopt`: http://docopt.org/
.. _`cookiecutter-jswidget`: https://github.com/audreyr/cookiecutter-jswidget
@@ -255,6 +286,16 @@ HTML
.. _`Python-Android-template`: https://github.com/pybee/Python-Android-template
.. _`Invoke`: http://invoke.readthedocs.org/en/latest/
.. _`cookiecutter-django-rest-framework`: https://github.com/jpadilla/cookiecutter-django-rest-framework
+.. _`cookiecutter-tryton`: https://github.com/fulfilio/cookiecutter-tryton
+.. _`cookiecutter-beamer`: https://github.com/luismartingil/cookiecutter-beamer
+.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin
+.. _`pytest`: http://pytest.org/latest/
+.. _`cookiecutter-tapioca`: https://github.com/vintasoftware/cookiecutter-tapioca
+.. _`tapioca-wrapper`: https://github.com/vintasoftware/tapioca-wrapper
+.. _`cookiecutter-sublime-text-3-plugin`: https://github.com/kkujawinski/cookiecutter-sublime-text-3-plugin
+.. _`cookiecutter-muffin`: https://github.com/drgarcia1986/cookiecutter-muffin
+.. _`cookiecutter-wagtail`: https://github.com/torchbox/cookiecutter-wagtail
+.. _`Wagtail`: https://github.com/torchbox/wagtail
Scala
~~~~~
@@ -300,6 +341,8 @@ Similar projects
* `Cog`_ python-based code generation toolkit developed by Ned Batchelder
+* `Skaffold`_ python and json config based django/MVC generator, with some add-ons and integrations.
+
.. _`Paste`: http://pythonpaste.org/script/#paster-create
.. _`Diecutter`: https://github.com/novagile/diecutter
.. _`Django`: https://docs.djangoproject.com/en/1.5/ref/django-admin/#django-admin-startproject
@@ -311,13 +354,14 @@ Similar projects
.. _`scaffolt`: https://github.com/paulmillr/scaffolt
.. _`init-skeleton`: https://github.com/paulmillr/init-skeleton
.. _`Cog`: https://bitbucket.org/ned/cog
+.. _`Skaffold`: https://github.com/christabor/Skaffold
Community
---------
-The core committer team is `@audreyr`_, `@pydanny`_, `@michaeljoseph`_, and
-`@pfmoore`_. We
+The core committer team is `@audreyr`_, `@pydanny`_, `@michaeljoseph`_,
+`@pfmoore`_, and `@hackebrot`_. We
welcome you and invite you to participate.
Stuck? Try one of the following:
@@ -371,6 +415,13 @@ Waiting for a response to an issue/question?
* Need a fix/feature/release/help urgently, and can't wait? `@audreyr`_ is
available for hire for consultation or custom development.
+Code of Conduct
+---------------
+
+Everyone interacting in the Cookiecutter project's codebases, issue trackers, chat
+rooms, and mailing lists is expected to follow the `PyPA Code of Conduct`_.
+
+.. _`PyPA Code of Conduct`: https://www.pypa.io/en/latest/code-of-conduct/
.. _`Cookiecutter on GitHub`: https://github.com/audreyr/cookiecutter
.. _`Troubleshooting`: http://cookiecutter.readthedocs.org/en/latest/troubleshooting.html
@@ -383,3 +434,4 @@ Waiting for a response to an issue/question?
.. _`@pydanny`: https://github.com/pydanny
.. _`@michaeljoseph`: https://github.com/michaeljoseph
.. _`@pfmoore`: https://github.com/pfmoore
+.. _`@hackebrot`: https://github.com/hackebrot
diff --git a/appveyor.yml b/appveyor.yml
index fc528b6..71450da 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,27 +1,29 @@
+# What Python version is installed where:
+# http://www.appveyor.com/docs/installed-software#python
+
environment:
matrix:
- PYTHON: "C:\\Python27"
- PYTHON_VERSION: "2.7.8"
- PYTHON_ARCH: "32"
TOX_ENV: "py27"
- PYTHON: "C:\\Python33"
- PYTHON_VERSION: "3.3.5"
- PYTHON_ARCH: "32"
TOX_ENV: "py33"
- PYTHON: "C:\\Python34"
- PYTHON_VERSION: "3.4.1"
- PYTHON_ARCH: "32"
TOX_ENV: "py34"
+ - PYTHON: "C:\\Python35"
+ TOX_ENV: "py35"
+
init:
- - "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
+ - "%PYTHON%/python -V"
+ - "%PYTHON%/python -c \"import struct;print( 8 * struct.calcsize(\'P\'))\""
install:
- - "appveyor/setup_build_env.cmd"
- - "powershell appveyor/install.ps1"
+ - "%PYTHON%/Scripts/easy_install -U pip"
+ - "%PYTHON%/Scripts/pip install tox"
+ - "%PYTHON%/Scripts/pip install wheel"
build: false # Not a C# project, build stuff at the test step instead.
diff --git a/appveyor/install.ps1 b/appveyor/install.ps1
deleted file mode 100644
index c84ba4f..0000000
--- a/appveyor/install.ps1
+++ /dev/null
@@ -1,86 +0,0 @@
-# Sample script to install Python and pip under Windows
-# Authors: Olivier Grisel and Kyle Kastner
-# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
-
-$BASE_URL = "https://www.python.org/ftp/python/"
-$GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py"
-$GET_PIP_PATH = "C:\get-pip.py"
-
-
-function DownloadPython ($python_version, $platform_suffix) {
- $webclient = New-Object System.Net.WebClient
- $filename = "python-" + $python_version + $platform_suffix + ".msi"
- $url = $BASE_URL + $python_version + "/" + $filename
-
- $basedir = $pwd.Path + "\"
- $filepath = $basedir + $filename
- if (Test-Path $filename) {
- Write-Host "Reusing" $filepath
- return $filepath
- }
-
- # Download and retry up to 5 times in case of network transient errors.
- Write-Host "Downloading" $filename "from" $url
- $retry_attempts = 3
- for($i=0; $i -lt $retry_attempts; $i++){
- try {
- $webclient.DownloadFile($url, $filepath)
- break
- }
- Catch [Exception]{
- Start-Sleep 1
- }
- }
- Write-Host "File saved at" $filepath
- return $filepath
-}
-
-
-function InstallPython ($python_version, $architecture, $python_home) {
- Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home
- if (Test-Path $python_home) {
- Write-Host $python_home "already exists, skipping."
- return $false
- }
- if ($architecture -eq "32") {
- $platform_suffix = ""
- } else {
- $platform_suffix = ".amd64"
- }
- $filepath = DownloadPython $python_version $platform_suffix
- Write-Host "Installing" $filepath "to" $python_home
- $args = "/qn /i $filepath TARGETDIR=$python_home"
- Write-Host "msiexec.exe" $args
- Start-Process -FilePath "msiexec.exe" -ArgumentList $args -Wait -Passthru
- Write-Host "Python $python_version ($architecture) installation complete"
- return $true
-}
-
-
-function InstallPip ($python_home) {
- $pip_path = $python_home + "/Scripts/pip.exe"
- $python_path = $python_home + "/python.exe"
- if (-not(Test-Path $pip_path)) {
- Write-Host "Installing pip..."
- $webclient = New-Object System.Net.WebClient
- $webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH)
- Write-Host "Executing:" $python_path $GET_PIP_PATH
- Start-Process -FilePath "$python_path" -ArgumentList "$GET_PIP_PATH" -Wait -Passthru
- } else {
- Write-Host "pip already installed."
- }
-}
-
-function InstallPackage ($python_home, $pkg) {
- $pip_path = $python_home + "/Scripts/pip.exe"
- & $pip_path install $pkg
-}
-
-function main () {
- InstallPython $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON
- InstallPip $env:PYTHON
- InstallPackage $env:PYTHON tox
- InstallPackage $env:PYTHON wheel
-}
-
-main
diff --git a/appveyor/setup_build_env.cmd b/appveyor/setup_build_env.cmd
deleted file mode 100644
index 77fcbf6..0000000
--- a/appveyor/setup_build_env.cmd
+++ /dev/null
@@ -1,16 +0,0 @@
-:: To build extensions for 64 bit Python 3, we need to configure environment
-:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
-:: MS Windows SDK for Windows 7 and .NET Framework 4
-::
-:: More details at:
-:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
-
-IF "%PYTHON_ARCH%"=="64" (
- ECHO Configuring environment to build with MSVC on a 64bit architecture
- ECHO Using Windows SDK %WINDOWS_SDK_VERSION%
- "C:\Program Files\Microsoft SDKs\Windows\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
- SET DISTUTILS_USE_SDK=1
- SET MSSdk=1
-) ELSE (
- ECHO Using default MSVC build environment for 32bit architecture
-)
diff --git a/cookiecutter/__init__.py b/cookiecutter/__init__.py
index acf504e..b390c28 100755
--- a/cookiecutter/__init__.py
+++ b/cookiecutter/__init__.py
@@ -7,10 +7,5 @@ cookiecutter
Main package for Cookiecutter.
"""
-from .compat import OLD_PY2
-__version__ = '1.0.0'
-
-if OLD_PY2:
- msg = 'Python 2.6 support was removed from cookiecutter in release 1.0.0.'
- raise DeprecationWarning(msg)
+__version__ = '1.1.0'
diff --git a/cookiecutter/cli.py b/cookiecutter/cli.py
index 6702b61..6f53e24 100755
--- a/cookiecutter/cli.py
+++ b/cookiecutter/cli.py
@@ -8,8 +8,6 @@ cookiecutter.cli
Main `cookiecutter` CLI.
"""
-from __future__ import unicode_literals
-
import os
import sys
import logging
@@ -18,53 +16,74 @@ import click
from cookiecutter import __version__
from cookiecutter.main import cookiecutter
+from cookiecutter.exceptions import (
+ OutputDirExistsException, InvalidModeException
+)
logger = logging.getLogger(__name__)
-def print_version(context, param, value):
- if not value or context.resilient_parsing:
- return
- click.echo('Cookiecutter %s from %s (Python %s)' % (
- __version__,
- os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
- sys.version[:3]
- ))
- context.exit()
+def version_msg():
+ python_version = sys.version[:3]
+ location = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+ message = u'Cookiecutter %(version)s from {} (Python {})'
+ return message.format(location, python_version)
@click.command()
- at click.argument('template')
- at click.option(
- '--no-input', is_flag=True,
- help='Do not prompt for parameters and only use cookiecutter.json '
- 'file content',
-)
+ at click.version_option(__version__, u'-V', u'--version', message=version_msg())
+ at click.argument(u'template')
@click.option(
- '-c', '--checkout',
- help='branch, tag or commit to checkout after git clone',
+ u'--no-input', is_flag=True,
+ help=u'Do not prompt for parameters and only use cookiecutter.json '
+ u'file content',
)
@click.option(
- '-V', '--version',
- is_flag=True, help='Show version information and exit.',
- callback=print_version, expose_value=False, is_eager=True,
+ u'-c', u'--checkout',
+ help=u'branch, tag or commit to checkout after git clone',
)
@click.option(
'-v', '--verbose',
is_flag=True, help='Print debug information', default=False
)
-def main(template, no_input, checkout, verbose):
+ at click.option(
+ u'--replay', is_flag=True,
+ help=u'Do not prompt for parameters and only use information entered '
+ u'previously',
+)
+ at click.option(
+ u'-f', u'--overwrite-if-exists', is_flag=True,
+ help=u'Overwrite the contents of the output directory if it already exists'
+)
+ at click.option(
+ u'-o', u'--output-dir', default='.', type=click.Path(),
+ help=u'Where to output the generated project dir into'
+)
+def main(template, no_input, checkout, verbose, replay, overwrite_if_exists,
+ output_dir):
"""Create a project from a Cookiecutter project template (TEMPLATE)."""
if verbose:
logging.basicConfig(
- format='%(levelname)s %(filename)s: %(message)s',
+ format=u'%(levelname)s %(filename)s: %(message)s',
level=logging.DEBUG
)
else:
# Log info and above to console
logging.basicConfig(
... 3128 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/cookiecutter.git
More information about the Python-modules-commits
mailing list