-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
1,420 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,7 @@ dist | |
# Vagrant | ||
.vagrant | ||
.bash_history | ||
|
||
.idea | ||
|
||
.tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
language: python | ||
python: | ||
- "2.7" | ||
- "3.3" | ||
- "3.4" | ||
- "3.5" | ||
install: "pip install -r requirements_dev.txt" | ||
script: py.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Dectinc <[email protected]> | ||
Henning Kage <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
"""Pre generation script""" | ||
|
||
import os | ||
|
||
|
||
PROJECT_DIRECTORY = os.path.realpath(os.path.curdir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[pytest] | ||
testpaths = tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
bumpversion==0.5.3 | ||
cookiecutter>=1.5.0 | ||
pytest==3.0.5 | ||
pytest-cookies==0.2.0 | ||
tox==2.5.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[bumpversion] | ||
current_version = 0.1.1 | ||
commit = True | ||
tag = True | ||
|
||
[metadata] | ||
description-file = README.md | ||
|
||
[bumpversion:file:setup.py] | ||
search = version='{current_version}' | ||
replace = version='{new_version}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# !/usr/bin/env python | ||
|
||
from distutils.core import setup | ||
|
||
setup( | ||
name='cookiecutter-tornado', | ||
packages=[], | ||
version='0.1.1', | ||
description='Cookiecutter template for Tornado based projects', | ||
author='Henning Kage', | ||
author_email='[email protected]', | ||
url='https://github.com/hkage/cookiecutter-tornado', | ||
keywords=['cookiecutter', 'template', 'tornado', ], | ||
classifiers=[ | ||
'Development Status :: 4 - Beta', | ||
'Environment :: Console', | ||
'Intended Audience :: Developers', | ||
'Natural Language :: English', | ||
'License :: OSI Approved :: BSD License', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: Implementation :: CPython', | ||
'Programming Language :: Python :: Implementation :: PyPy', | ||
'Topic :: Software Development', | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
"""Tests for the cookiecutter template.""" | ||
|
||
from contextlib import contextmanager | ||
|
||
from cookiecutter.utils import rmtree | ||
import pytest | ||
|
||
|
||
@contextmanager | ||
def bake_in_temp_dir(cookies, *args, **kwargs): | ||
result = cookies.bake(*args, **kwargs) | ||
try: | ||
yield result | ||
finally: | ||
rmtree(str(result.project)) | ||
|
||
|
||
def test_bake_project_with_defaults(cookies): | ||
with bake_in_temp_dir(cookies) as result: | ||
assert result.exit_code == 0 | ||
assert result.exception is None | ||
assert result.project.isdir() | ||
found_toplevel_files = [f.basename for f in result.project.listdir()] | ||
assert 'setup.py' in found_toplevel_files | ||
assert 'tox.ini' in found_toplevel_files | ||
assert 'Dockerfile' in found_toplevel_files | ||
assert 'tests' in found_toplevel_files | ||
|
||
|
||
@pytest.mark.parametrize('with_docker_support, expected_result', [ | ||
('y', True), | ||
('yes', True), | ||
('YES', True), | ||
('n', False), | ||
('no', False), | ||
('NO', False), | ||
]) | ||
def test_docker_support(cookies, with_docker_support, expected_result): | ||
with bake_in_temp_dir(cookies, extra_context={'use_docker': with_docker_support}) as result: | ||
found_toplevel_files = [f.basename for f in result.project.listdir()] | ||
assert ('Dockerfile' in found_toplevel_files) == expected_result | ||
|
||
|
||
@pytest.mark.parametrize('with_vagrant_support, expected_result', [ | ||
('y', True), | ||
('yes', True), | ||
('YES', True), | ||
('n', False), | ||
('no', False), | ||
('NO', False), | ||
]) | ||
def test_vagrant_support(cookies, with_vagrant_support, expected_result): | ||
with bake_in_temp_dir(cookies, extra_context={'use_vagrant': with_vagrant_support}) as result: | ||
found_toplevel_files = [f.basename for f in result.project.listdir()] | ||
assert ('Vagrantfile' in found_toplevel_files) == expected_result | ||
|
||
|
||
@pytest.mark.parametrize('with_bumpversion_support, expected_result', [ | ||
('y', True), | ||
('yes', True), | ||
('YES', True), | ||
('n', False), | ||
('no', False), | ||
('NO', False), | ||
]) | ||
def test_bumpversion_support(cookies, with_bumpversion_support, expected_result): | ||
with bake_in_temp_dir(cookies, extra_context={'use_bumpversion': with_bumpversion_support}) as result: | ||
found_toplevel_files = [f.basename for f in result.project.listdir()] | ||
assert ('.bumpversion.cfg' in found_toplevel_files) == expected_result | ||
|
||
|
||
@pytest.mark.parametrize('with_pytest_support, expected_result', [ | ||
('y', True), | ||
('yes', True), | ||
('YES', True), | ||
('n', False), | ||
('no', False), | ||
('NO', False), | ||
]) | ||
def test_pytest_support(cookies, with_pytest_support, expected_result): | ||
with bake_in_temp_dir(cookies, extra_context={'use_pytest': with_pytest_support}) as result: | ||
found_toplevel_files = [f.basename for f in result.project.listdir()] | ||
assert ('pytest.ini' in found_toplevel_files) == expected_result | ||
|
||
|
||
@pytest.mark.parametrize('with_tox_support, expected_result', [ | ||
('y', True), | ||
('yes', True), | ||
('YES', True), | ||
('n', False), | ||
('no', False), | ||
('NO', False), | ||
]) | ||
def test_tox_support(cookies, with_tox_support, expected_result): | ||
with bake_in_temp_dir(cookies, extra_context={'use_tox': with_tox_support}) as result: | ||
found_toplevel_files = [f.basename for f in result.project.listdir()] | ||
assert ('tox.ini' in found_toplevel_files) == expected_result | ||
|
||
|
||
def test_cookie_secret_has_been_generated(cookies): | ||
with bake_in_temp_dir(cookies) as result: | ||
settings_file = result.project.join('settings.py') | ||
settings_lines = settings_file.readlines(cr=False) | ||
assert '!!CHANGEME!!' not in settings_lines |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[tox] | ||
envlist = py27, py33, py34, py35, docs | ||
skipsdist = true | ||
|
||
[testenv:docs] | ||
basepython=python | ||
changedir=docs | ||
deps=sphinx | ||
commands= | ||
sphinx-build -b html -d {envtmpdir}/doctrees . {envtmpdir}/html | ||
|
||
[testenv] | ||
whitelist_externals = bash | ||
deps = | ||
-rrequirements_dev.txt | ||
commands = | ||
py.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[bumpversion] | ||
current_version = {{ cookiecutter.version }} | ||
commit = True | ||
tag = True | ||
tag_name = {new_version} | ||
|
||
[bumpversion:file:{{ cookiecutter.project_slug }}/version.py] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
======= | ||
Credits | ||
======= | ||
|
||
Development Lead | ||
---------------- | ||
|
||
* {{ cookiecutter.author_name }} <{{ cookiecutter.email }}> | ||
|
||
Contributors | ||
------------ | ||
|
||
None yet. Why not be the first? |
Oops, something went wrong.