From 09532d0518a974865197b77c020350e4d3266e17 Mon Sep 17 00:00:00 2001 From: akun Date: Fri, 4 Apr 2014 22:50:07 +0800 Subject: [PATCH 1/2] 0.0.3: code format --- setup.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 83ff299..0816431 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,12 @@ #!/usr/bin/env python -import os -import sys - - from setuptools import setup, find_packages from pip.req import parse_requirements -install_reqs = parse_requirements('requirements.txt') -reqs = [str(ir.req) for ir in install_reqs] + +def get_reqs(): + install_reqs = parse_requirements('requirements.txt') + return [str(ir.req) for ir in install_reqs] from aproject import VERSION @@ -23,6 +21,6 @@ url='https://github.com/akun/aproject', package_dir={'': 'aproject'}, packages=find_packages('aproject'), - install_requires=reqs, + install_requires=get_reqs(), test_suite='nose.collector', ) From 76087c5482cb3f53f4a28ed6e44bdeab8d92dedd Mon Sep 17 00:00:00 2001 From: akun <6awkun@gmail.com> Date: Thu, 8 May 2014 16:44:02 +0800 Subject: [PATCH 2/2] 0.0.3: using cookiecutter as project template generator --- .editorconfig | 20 +- .gitignore | 34 --- .travis.yml | 5 - Makefile | 25 +-- README.rst | 44 ++-- aproject/__init__.py | 4 - aproject/ship_it.py | 5 - aproject/tests.py | 13 -- cookiecutter.json | 11 + docs/make.bat | 197 ------------------ nose.cfg | 4 - requirements.txt | 2 +- requirements/docs.txt | 5 - setup.py | 26 --- .../.coveralls.yml | 0 {{cookiecutter.repo_name}}/.editorconfig | 17 ++ {{cookiecutter.repo_name}}/.gitignore | 12 ++ .../.jshintrc | 3 +- .../.landscape.yaml | 0 .../.pylintrc | 0 {{cookiecutter.repo_name}}/.travis.yml | 15 ++ {{cookiecutter.repo_name}}/LICENSE | 21 ++ {{cookiecutter.repo_name}}/Makefile | 44 ++++ {{cookiecutter.repo_name}}/README.rst | 62 ++++++ .../docs}/Makefile | 8 +- .../docs}/_static/tracsphinx.css | 0 .../docs}/conf.py | 92 +------- .../docs}/index.rst | 2 +- {{cookiecutter.repo_name}}/nose.cfg | 4 + {{cookiecutter.repo_name}}/requirements.txt | 1 + .../requirements}/common.txt | 0 .../requirements}/dev.txt | 0 .../requirements/docs.txt | 3 + .../requirements}/prod.txt | 0 .../requirements}/test.txt | 0 {{cookiecutter.repo_name}}/setup.py | 26 +++ tox.ini => {{cookiecutter.repo_name}}/tox.ini | 0 .../{{cookiecutter.repo_name}}/__init__.py | 5 + .../{{cookiecutter.repo_name}}/main.py | 6 + .../test_{{cookiecutter.repo_name}}.py | 13 ++ 40 files changed, 296 insertions(+), 433 deletions(-) delete mode 100644 aproject/__init__.py delete mode 100644 aproject/ship_it.py delete mode 100644 aproject/tests.py create mode 100644 cookiecutter.json delete mode 100644 docs/make.bat delete mode 100644 nose.cfg delete mode 100644 requirements/docs.txt delete mode 100644 setup.py rename .coveralls.yml => {{cookiecutter.repo_name}}/.coveralls.yml (100%) create mode 100644 {{cookiecutter.repo_name}}/.editorconfig create mode 100644 {{cookiecutter.repo_name}}/.gitignore rename .jshintrc => {{cookiecutter.repo_name}}/.jshintrc (89%) rename .landscape.yaml => {{cookiecutter.repo_name}}/.landscape.yaml (100%) rename .pylintrc => {{cookiecutter.repo_name}}/.pylintrc (100%) create mode 100644 {{cookiecutter.repo_name}}/.travis.yml create mode 100644 {{cookiecutter.repo_name}}/LICENSE create mode 100644 {{cookiecutter.repo_name}}/Makefile create mode 100644 {{cookiecutter.repo_name}}/README.rst rename {docs => {{cookiecutter.repo_name}}/docs}/Makefile (95%) rename {docs => {{cookiecutter.repo_name}}/docs}/_static/tracsphinx.css (100%) rename {docs => {{cookiecutter.repo_name}}/docs}/conf.py (69%) rename {docs => {{cookiecutter.repo_name}}/docs}/index.rst (75%) create mode 100644 {{cookiecutter.repo_name}}/nose.cfg create mode 100644 {{cookiecutter.repo_name}}/requirements.txt rename {requirements => {{cookiecutter.repo_name}}/requirements}/common.txt (100%) rename {requirements => {{cookiecutter.repo_name}}/requirements}/dev.txt (100%) create mode 100644 {{cookiecutter.repo_name}}/requirements/docs.txt rename {requirements => {{cookiecutter.repo_name}}/requirements}/prod.txt (100%) rename {requirements => {{cookiecutter.repo_name}}/requirements}/test.txt (100%) create mode 100644 {{cookiecutter.repo_name}}/setup.py rename tox.ini => {{cookiecutter.repo_name}}/tox.ini (100%) create mode 100644 {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/__init__.py create mode 100644 {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/main.py create mode 100644 {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/test_{{cookiecutter.repo_name}}.py diff --git a/.editorconfig b/.editorconfig index b6bdcdc..2acdc33 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,21 +1,17 @@ root = true -[*.py] +[*] indent_style = space -indent_size = 4 - -[*.html] -indent_style = space -indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true -[*.js] -indent_style = space -indent_size = 2 +[*.py] +indent_size = 4 -[*.css] -indent_style = space +[*.{html,css,js,json}] indent_size = 2 -[*.bat] +[{*.bat,Makefile}] indent_style = tab indent_size = 4 diff --git a/.gitignore b/.gitignore index c2fa512..8926841 100644 --- a/.gitignore +++ b/.gitignore @@ -1,39 +1,5 @@ *.py[cod] *.swp -docs/_build include - -# C extensions -*.so - -# Packages -*.egg -*.egg-info -dist -build -eggs -parts bin -var -sdist -develop-eggs -.installed.cfg lib -lib64 -__pycache__ - -# Installer logs -pip-log.txt - -# Unit test / coverage reports -.coverage -.tox -nosetests.xml - -# Translations -*.mo - -# Mr Developer -.mr.developer.cfg -.project -.pydevproject diff --git a/.travis.yml b/.travis.yml index c94f350..5c836e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,10 @@ language: python python: - - "3.3" - "2.7" - "2.6" install: - "pip install -r requirements.txt" - - "pip install -r requirements/test.txt" script: make test - -after_success: - - coveralls diff --git a/Makefile b/Makefile index 37228b1..adfaaa2 100644 --- a/Makefile +++ b/Makefile @@ -1,28 +1,7 @@ -SRC_DIR = aproject -DOC_DIR = docs MAKE = make -all: - make lint - make test - make html - make clean - -lint: - pylint --rcfile=.pylintrc -E $(SRC_DIR) - -lintall: - pylint --rcfile=.pylintrc $(SRC_DIR) - test: - nosetests -c nose.cfg - -html: - cd $(DOC_DIR) && $(MAKE) html + cookiecutter . --no-input && cd aproject && $(MAKE) clean: - rm -rf *.egg-info - rm -rf build/* - rm -rf dist/* - rm -rf $(SRC_DIR)/*.egg-info - find $(SRC_DIR) -name "*.pyc" | xargs rm + rm -rf aproject diff --git a/README.rst b/README.rst index 4d15ba6..5e217f1 100644 --- a/README.rst +++ b/README.rst @@ -5,28 +5,44 @@ aproject :target: https://travis-ci.org/akun/aproject :alt: Build Status -.. image:: https://landscape.io/github/akun/aproject/master/landscape.png - :target: https://landscape.io/github/akun/aproject/master - :alt: Code Health - -.. image:: https://coveralls.io/repos/akun/aproject/badge.png - :target: https://coveralls.io/r/akun/aproject - :alt: Coverage Status - A Pyhton Project Template Intro ----- -* Lint: PyLint + JSHint -* Unittest: nose + coverage -* Document: Sphinx -* CI: Travis-CI -* File Format: EditorConfig +* [o] Tools + + + [o] Lint: PyLint + JSHint + https://landscape.io + + [o] Unittest: nose + tox + + [o] Test Coverage: coverage + https://coveralls.io + + [o] Document: Sphinx + https://readthedocs.org/ + + [o] CI: https://travis-ci.org/ + + [o] File Format: EditorConfig + +* [o] Projects + + + [o] Python + + [ ] Django + + [ ] Bootstrap + +Usage +----- + +:: + + pip install cookiecutter + cookiecutter https://github.com/akun/aproject.git Changelog --------- +0.0.3 +~~~~~ + +2014-05-10 + +* using **cookiecutter** as project template generator + 0.0.2 ~~~~~ @@ -44,8 +60,6 @@ Changelog * init - .. image:: https://d2weczhvl823v0.cloudfront.net/akun/aproject/trend.png :alt: Bitdeli badge :target: https://bitdeli.com/free - diff --git a/aproject/__init__.py b/aproject/__init__.py deleted file mode 100644 index cf9a5ac..0000000 --- a/aproject/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python - - -VERSION = '0.0.2' diff --git a/aproject/ship_it.py b/aproject/ship_it.py deleted file mode 100644 index 6e2328a..0000000 --- a/aproject/ship_it.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python - - -def ship_it(): - return 'ship it!' diff --git a/aproject/tests.py b/aproject/tests.py deleted file mode 100644 index 5e4c591..0000000 --- a/aproject/tests.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python -# coding=utf-8 - - -import unittest - -from aproject.ship_it import ship_it - - -class ShipItTestCase(unittest.TestCase): - - def test_ship_it(self): - self.assertEqual('ship it!', ship_it()) diff --git a/cookiecutter.json b/cookiecutter.json new file mode 100644 index 0000000..e3f094a --- /dev/null +++ b/cookiecutter.json @@ -0,0 +1,11 @@ +{ + "full_name": "akun", + "email": "6awkun@gmail.com", + "github_username": "akun", + "project_name": "aproject", + "repo_name": "aproject", + "project_short_description": "A Project Template", + "release_date": "2014-04-24", + "year": "2014", + "version": "0.0.1" +} diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 56e01ef..0000000 --- a/docs/make.bat +++ /dev/null @@ -1,197 +0,0 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set BUILDDIR=_build -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . -set I18NSPHINXOPTS=%SPHINXOPTS% . -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% - set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. singlehtml to make a single large HTML file - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. devhelp to make HTML files and a Devhelp project - echo. epub to make an epub - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. text to make text files - echo. man to make manual pages - echo. texinfo to make Texinfo files - echo. gettext to make PO message catalogs - echo. changes to make an overview over all changed/added/deprecated items - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) - -if "%1" == "singlehtml" ( - %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\aproject.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\aproject.ghc - goto end -) - -if "%1" == "devhelp" ( - %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. - goto end -) - -if "%1" == "epub" ( - %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub file is in %BUILDDIR%/epub. - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "text" ( - %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The text files are in %BUILDDIR%/text. - goto end -) - -if "%1" == "man" ( - %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The manual pages are in %BUILDDIR%/man. - goto end -) - -if "%1" == "texinfo" ( - %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. - goto end -) - -if "%1" == "gettext" ( - %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The message catalogs are in %BUILDDIR%/locale. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - if errorlevel 1 exit /b 1 - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - if errorlevel 1 exit /b 1 - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - if errorlevel 1 exit /b 1 - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) - -if "%1" == "pdf" ( - %SPHINXBUILD% -b pdf %ALLSPHINXOPTS% %BUILDDIR%/pdf - echo. -echo.Build finished. The PDF files are in %BUILDDIR%/pdf - goto end -) - -:end diff --git a/nose.cfg b/nose.cfg deleted file mode 100644 index cb5b90f..0000000 --- a/nose.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[nosetests] -nocapture=1 -with-coverage=1 -cover-package=aproject diff --git a/requirements.txt b/requirements.txt index 5eaadb8..bb627c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ --r requirements/prod.txt +cookiecutter>=0.7.0 diff --git a/requirements/docs.txt b/requirements/docs.txt deleted file mode 100644 index 89822c0..0000000 --- a/requirements/docs.txt +++ /dev/null @@ -1,5 +0,0 @@ --r common.txt - -Sphinx==1.2.2 -rst2pdf==0.93dev -hieroglyph==0.6.5 diff --git a/setup.py b/setup.py deleted file mode 100644 index 0816431..0000000 --- a/setup.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env python - - -from setuptools import setup, find_packages -from pip.req import parse_requirements - -def get_reqs(): - install_reqs = parse_requirements('requirements.txt') - return [str(ir.req) for ir in install_reqs] - -from aproject import VERSION - - -setup( - name='aproject', - version=VERSION, - description='A Project Template', - author='akun', - author_email='6awkun@gmail.com', - license='MIT License', - url='https://github.com/akun/aproject', - package_dir={'': 'aproject'}, - packages=find_packages('aproject'), - install_requires=get_reqs(), - test_suite='nose.collector', -) diff --git a/.coveralls.yml b/{{cookiecutter.repo_name}}/.coveralls.yml similarity index 100% rename from .coveralls.yml rename to {{cookiecutter.repo_name}}/.coveralls.yml diff --git a/{{cookiecutter.repo_name}}/.editorconfig b/{{cookiecutter.repo_name}}/.editorconfig new file mode 100644 index 0000000..2acdc33 --- /dev/null +++ b/{{cookiecutter.repo_name}}/.editorconfig @@ -0,0 +1,17 @@ +root = true + +[*] +indent_style = space +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true + +[*.py] +indent_size = 4 + +[*.{html,css,js,json}] +indent_size = 2 + +[{*.bat,Makefile}] +indent_style = tab +indent_size = 4 diff --git a/{{cookiecutter.repo_name}}/.gitignore b/{{cookiecutter.repo_name}}/.gitignore new file mode 100644 index 0000000..3c55cab --- /dev/null +++ b/{{cookiecutter.repo_name}}/.gitignore @@ -0,0 +1,12 @@ +*.egg-info +*.py[cod] +*.swp +.coverage +.tox +bin +build +dist +docs/_build +include +lib +sdist diff --git a/.jshintrc b/{{cookiecutter.repo_name}}/.jshintrc similarity index 89% rename from .jshintrc rename to {{cookiecutter.repo_name}}/.jshintrc index 1d35ce1..46bbeb9 100644 --- a/.jshintrc +++ b/{{cookiecutter.repo_name}}/.jshintrc @@ -17,5 +17,6 @@ "unused": true, "strict": true, "trailing": true, - "smarttabs": true + "smarttabs": true, + "jquery": true } diff --git a/.landscape.yaml b/{{cookiecutter.repo_name}}/.landscape.yaml similarity index 100% rename from .landscape.yaml rename to {{cookiecutter.repo_name}}/.landscape.yaml diff --git a/.pylintrc b/{{cookiecutter.repo_name}}/.pylintrc similarity index 100% rename from .pylintrc rename to {{cookiecutter.repo_name}}/.pylintrc diff --git a/{{cookiecutter.repo_name}}/.travis.yml b/{{cookiecutter.repo_name}}/.travis.yml new file mode 100644 index 0000000..c94f350 --- /dev/null +++ b/{{cookiecutter.repo_name}}/.travis.yml @@ -0,0 +1,15 @@ +language: python + +python: + - "3.3" + - "2.7" + - "2.6" + +install: + - "pip install -r requirements.txt" + - "pip install -r requirements/test.txt" + +script: make test + +after_success: + - coveralls diff --git a/{{cookiecutter.repo_name}}/LICENSE b/{{cookiecutter.repo_name}}/LICENSE new file mode 100644 index 0000000..5665533 --- /dev/null +++ b/{{cookiecutter.repo_name}}/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 {{ cookiecutter.full_name }} <{{ cookiecutter.email }}> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/{{cookiecutter.repo_name}}/Makefile b/{{cookiecutter.repo_name}}/Makefile new file mode 100644 index 0000000..53498a7 --- /dev/null +++ b/{{cookiecutter.repo_name}}/Makefile @@ -0,0 +1,44 @@ +SRC_DIR = {{ cookiecutter.repo_name }} +DOC_DIR = docs +MAKE = make + +all: + make installall + make lint + make test + make html + make clean + +install: + pip install -r requirements.txt + +installall: + pip install -r requirements/prod.txt + pip install -r requirements/dev.txt + pip install -r requirements/docs.txt + pip install -r requirements/test.txt + +lint: + pylint --rcfile=.pylintrc -E $(SRC_DIR) + +lintall: + pylint --rcfile=.pylintrc $(SRC_DIR) + +test: + nosetests -c nose.cfg + +testall: + tox + +html: + cd $(DOC_DIR) && $(MAKE) html + +htmlci: + curl -X POST http://readthedocs.org/build/{{ cookiecutter.repo_name }} + +clean: + rm -rf *.egg-info + rm -rf build/* + rm -rf dist/* + rm -rf $(SRC_DIR)/*.egg-info + find $(SRC_DIR) -name "*.pyc" | xargs rm diff --git a/{{cookiecutter.repo_name}}/README.rst b/{{cookiecutter.repo_name}}/README.rst new file mode 100644 index 0000000..0f985f1 --- /dev/null +++ b/{{cookiecutter.repo_name}}/README.rst @@ -0,0 +1,62 @@ +{{ cookiecutter.project_name }} +=============================== + +.. image:: https://travis-ci.org/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }}.png + :target: https://travis-ci.org/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }} + :alt: Build Status + +.. image:: https://landscape.io/github/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }}/master/landscape.png + :target: https://landscape.io/github/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }}/master + :alt: Code Health + +.. image:: https://coveralls.io/repos/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }}/badge.png + :target: https://coveralls.io/r/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }} + :alt: Coverage Status + +{{ cookiecutter.project_short_description }} + +* Free software: MIT license +* Documentation: http://{{ cookiecutter.repo_name }}.rtfd.org/ + +Features +-------- + +TODO + +Install +------- + +:: + + pip install {{ cookiecutter.repo_name }} + +Examples +-------- + +TODO + +Changelog +--------- + +{{ cookiecutter.version }} +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +{{ cookiecutter.release_date }} + +* init + +Contributing +------------ + +TODO + +Credits +------- + +* {{ cookiecutter.full_name }} <{{ cookiecutter.email }}> + +Add your name and email, detail in: https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }}/graphs/contributors + +.. image:: https://d2weczhvl823v0.cloudfront.net/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }}/trend.png + :alt: Bitdeli badge + :target: https://bitdeli.com/free diff --git a/docs/Makefile b/{{cookiecutter.repo_name}}/docs/Makefile similarity index 95% rename from docs/Makefile rename to {{cookiecutter.repo_name}}/docs/Makefile index 37855b1..a108095 100644 --- a/docs/Makefile +++ b/{{cookiecutter.repo_name}}/docs/Makefile @@ -77,17 +77,17 @@ qthelp: @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/aproject.qhcp" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/{{ cookiecutter.repo_name }}.qhcp" @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/aproject.qhc" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/{{ cookiecutter.repo_name }}.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/aproject" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/aproject" + @echo "# mkdir -p $$HOME/.local/share/devhelp/{{ cookiecutter.repo_name }}" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/{{ cookiecutter.repo_name }}" @echo "# devhelp" epub: diff --git a/docs/_static/tracsphinx.css b/{{cookiecutter.repo_name}}/docs/_static/tracsphinx.css similarity index 100% rename from docs/_static/tracsphinx.css rename to {{cookiecutter.repo_name}}/docs/_static/tracsphinx.css diff --git a/docs/conf.py b/{{cookiecutter.repo_name}}/docs/conf.py similarity index 69% rename from docs/conf.py rename to {{cookiecutter.repo_name}}/docs/conf.py index b9f9712..349bcb2 100644 --- a/docs/conf.py +++ b/{{cookiecutter.repo_name}}/docs/conf.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# aproject documentation build configuration file, created by +# {{ cookiecutter.repo_name }} documentation build configuration file, created by # sphinx-quickstart on Fri Dec 20 02:28:45 2013. # # This file is execfile()d with the current directory set to its containing dir. @@ -15,7 +15,7 @@ import sys BASE_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.insert(0, BASE_DIR) -from aproject import VERSION +from {{ cookiecutter.repo_name }} import VERSION # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -29,7 +29,7 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['hieroglyph', 'sphinx.ext.autodoc', 'rst2pdf.pdfbuilder'] +extensions = ['sphinx.ext.autodoc'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -44,7 +44,7 @@ master_doc = 'index' # General information about the project. -project = u'aproject' +project = u'{{ cookiecutter.repo_name }}' copyright = u'2013, akun' # The version info for the project you're documenting, acts as replacement for @@ -169,7 +169,7 @@ #html_file_suffix = None # Output file base name for HTML help builder. -htmlhelp_basename = 'aprojectdoc' +htmlhelp_basename = '{{ cookiecutter.repo_name }}doc' # -- Options for LaTeX output -------------------------------------------------- @@ -188,7 +188,7 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'aproject.tex', u'aproject Documentation', + ('index', '{{ cookiecutter.repo_name }}.tex', u'{{ cookiecutter.repo_name }} Documentation', u'akun', 'manual'), ] @@ -218,7 +218,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'aproject', u'aproject Documentation', + ('index', '{{ cookiecutter.repo_name }}', u'{{ cookiecutter.repo_name }} Documentation', [u'akun'], 1) ] @@ -232,8 +232,8 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'aproject', u'aproject Documentation', - u'akun', 'aproject', 'One line description of project.', + ('index', '{{ cookiecutter.repo_name }}', u'{{ cookiecutter.repo_name }} Documentation', + u'akun', '{{ cookiecutter.repo_name }}', 'One line description of project.', 'Miscellaneous'), ] @@ -245,77 +245,3 @@ # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' - -# -- Options for PDF output -------------------------------------------------- -# Grouping the document tree into PDF files. List of tuples -# (source start file, target name, title, author, options). -# -# If there is more than one author, separate them with \\. -# For example: r'Guido van Rossum\\Fred L. Drake, Jr., editor' -# -# The options element is a dictionary that lets you override -# this config per-document. -# For example, -# ('index', u'MyProject', u'My Project', u'Author Name', -# dict(pdf_compressed = True)) -# would mean that specific document would be compressed -# regardless of the global pdf_compressed setting. -pdf_documents = [ - ('index', u'aproject', u'aproject Documentation', u'akun'), -] -# A comma-separated list of custom stylesheets. Example: -#pdf_stylesheets = ['sphinx','kerning','a4'] -pdf_stylesheets = ['chinese','a4'] -# A list of folders to search for stylesheets. Example: -pdf_style_path = ['.', '_styles'] -# Create a compressed PDF -# Use True/False or 1/0 -# Example: compressed=True -#pdf_compressed = False -# A colon-separated list of folders to search for fonts. Example: -# pdf_font_path = ['/usr/share/fonts', '/usr/share/texmf-dist/fonts/'] -# Language to be used for hyphenation support -#pdf_language = "en_US" -# Mode for literal blocks wider than the frame. Can be -# overflow, shrink or truncate -#pdf_fit_mode = "shrink" -# Section level that forces a break page. -# For example: 1 means top-level sections start in a new page -# 0 means disabled -#pdf_break_level = 0 -# When a section starts in a new page, force it to be 'even', 'odd', -# or just use 'any' -#pdf_breakside = 'any' -# Insert footnotes where they are defined instead of -# at the end. -#pdf_inline_footnotes = True -# verbosity level. 0 1 or 2 -#pdf_verbosity = 0 -# If false, no index is generated. -#pdf_use_index = True -# If false, no modindex is generated. -#pdf_use_modindex = True -# If false, no coverpage is generated. -#pdf_use_coverpage = True -# Name of the cover page template to use -#pdf_cover_template = 'sphinxcover.tmpl' -# Documents to append as an appendix to all manuals. -#pdf_appendices = [] -# Enable experimental feature to split table cells. Use it -# if you get "DelayedTable too big" errors -#pdf_splittables = False -# Set the default DPI for images -#pdf_default_dpi = 72 -# Enable rst2pdf extension modules (default is only vectorpdf) -# you need vectorpdf if you want to use sphinx's graphviz support -#pdf_extensions = ['vectorpdf'] -# Page template name for "regular" pages -#pdf_page_template = 'cutePage' -# Show Table Of Contents at the beginning? -#pdf_use_toc = True -# How many levels deep should the table of contents be? -pdf_toc_depth = 9999 -# Add section number to section references -pdf_use_numbered_links = False -# Background images fitting mode -pdf_fit_background_mode = 'scale' diff --git a/docs/index.rst b/{{cookiecutter.repo_name}}/docs/index.rst similarity index 75% rename from docs/index.rst rename to {{cookiecutter.repo_name}}/docs/index.rst index 8331a9a..fafe897 100644 --- a/docs/index.rst +++ b/{{cookiecutter.repo_name}}/docs/index.rst @@ -1,4 +1,4 @@ -aproject |version| documentation +{{ cookiecutter.repo_name }} |version| documentation ================================ Contents: diff --git a/{{cookiecutter.repo_name}}/nose.cfg b/{{cookiecutter.repo_name}}/nose.cfg new file mode 100644 index 0000000..1027d49 --- /dev/null +++ b/{{cookiecutter.repo_name}}/nose.cfg @@ -0,0 +1,4 @@ +[nosetests] +nocapture=1 +with-coverage=1 +cover-package={{ cookiecutter.repo_name }} diff --git a/{{cookiecutter.repo_name}}/requirements.txt b/{{cookiecutter.repo_name}}/requirements.txt new file mode 100644 index 0000000..5eaadb8 --- /dev/null +++ b/{{cookiecutter.repo_name}}/requirements.txt @@ -0,0 +1 @@ +-r requirements/prod.txt diff --git a/requirements/common.txt b/{{cookiecutter.repo_name}}/requirements/common.txt similarity index 100% rename from requirements/common.txt rename to {{cookiecutter.repo_name}}/requirements/common.txt diff --git a/requirements/dev.txt b/{{cookiecutter.repo_name}}/requirements/dev.txt similarity index 100% rename from requirements/dev.txt rename to {{cookiecutter.repo_name}}/requirements/dev.txt diff --git a/{{cookiecutter.repo_name}}/requirements/docs.txt b/{{cookiecutter.repo_name}}/requirements/docs.txt new file mode 100644 index 0000000..2d90a90 --- /dev/null +++ b/{{cookiecutter.repo_name}}/requirements/docs.txt @@ -0,0 +1,3 @@ +-r common.txt + +Sphinx==1.2.2 diff --git a/requirements/prod.txt b/{{cookiecutter.repo_name}}/requirements/prod.txt similarity index 100% rename from requirements/prod.txt rename to {{cookiecutter.repo_name}}/requirements/prod.txt diff --git a/requirements/test.txt b/{{cookiecutter.repo_name}}/requirements/test.txt similarity index 100% rename from requirements/test.txt rename to {{cookiecutter.repo_name}}/requirements/test.txt diff --git a/{{cookiecutter.repo_name}}/setup.py b/{{cookiecutter.repo_name}}/setup.py new file mode 100644 index 0000000..9ddb3a2 --- /dev/null +++ b/{{cookiecutter.repo_name}}/setup.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + + +from setuptools import setup, find_packages +from pip.req import parse_requirements + +def get_reqs(): + install_reqs = parse_requirements('requirements.txt') + return [str(ir.req) for ir in install_reqs] + +from {{ cookiecutter.repo_name }} import VERSION + + +setup( + name='{{ cookiecutter.project_name }}', + version=VERSION, + description='{{ cookiecutter.project_short_description }}', + author='{{ cookiecutter.full_name }}', + author_email='{{ cookiecutter.email }}', + license='MIT License', + url='https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }}', + package_dir={'': '{{ cookiecutter.repo_name }}'}, + packages=find_packages('{{ cookiecutter.repo_name }}'), + install_requires=get_reqs(), + test_suite='nose.collector', +) diff --git a/tox.ini b/{{cookiecutter.repo_name}}/tox.ini similarity index 100% rename from tox.ini rename to {{cookiecutter.repo_name}}/tox.ini diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/__init__.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/__init__.py new file mode 100644 index 0000000..c2931ca --- /dev/null +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/__init__.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python + + +VERSION = '{{ cookiecutter.version }}' + diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/main.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/main.py new file mode 100644 index 0000000..106cf3f --- /dev/null +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/main.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python + + +def hello_world(): + return 'Hello World!' + diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/test_{{cookiecutter.repo_name}}.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/test_{{cookiecutter.repo_name}}.py new file mode 100644 index 0000000..527cb78 --- /dev/null +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/test_{{cookiecutter.repo_name}}.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python + + +from unittest import TestCase + +from {{ cookiecutter.repo_name }}.main import hello_world + + +class HelloWordTestCase(TestCase): + + def test_hello_world(self): + self.assertEqual('Hello World!', hello_world()) +