├── {{cookiecutter.project_slug}} ├── t │ └── __init__.py ├── docs │ ├── _static │ │ └── .keep │ ├── _templates │ │ └── .keep │ ├── changelog.rst │ ├── images │ │ ├── logo.png │ │ └── favicon.ico │ ├── glossary.rst │ ├── reference │ │ ├── index.rst │ │ └── {{cookiecutter.project_slug}}.rst │ ├── includes │ │ ├── introduction.txt │ │ └── installation.txt │ ├── index.rst │ ├── conf.py │ ├── copyright.rst │ ├── templates │ │ └── readme.txt │ ├── make.bat │ └── Makefile ├── examples │ └── .keep ├── requirements │ ├── default.txt │ ├── docs.txt │ ├── test.txt │ ├── test-ci.txt │ └── pkgutils.txt ├── AUTHORS ├── setup.cfg ├── .coveragerc ├── Changelog ├── .editorconfig ├── .gitignore ├── MANIFEST.in ├── .bumpversion.cfg ├── .travis.yml ├── .cookiecutterrc ├── {{cookiecutter.project_slug}} │ └── __init__.py ├── tox.ini ├── appveyor.yml ├── extra │ └── appveyor │ │ ├── run_with_compiler.cmd │ │ └── install.ps1 ├── LICENSE ├── setup.py └── Makefile ├── cookiecutter.json └── .gitignore /{{cookiecutter.project_slug}}/t/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/_static/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/examples/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/_templates/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/requirements/default.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/changelog.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../Changelog 2 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/requirements/docs.txt: -------------------------------------------------------------------------------- 1 | sphinx_celery>=1.1 2 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/requirements/test.txt: -------------------------------------------------------------------------------- 1 | case>=1.2.3 2 | pytest 3 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/AUTHORS: -------------------------------------------------------------------------------- 1 | {{ cookiecutter.full_name }} <{{ cookiecutter.email }}> 2 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/requirements/test-ci.txt: -------------------------------------------------------------------------------- 1 | pytest-cov 2 | coverage>=3.0 3 | codecov 4 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/setup.cfg: -------------------------------------------------------------------------------- 1 | [tool:pytest] 2 | testpaths = t 3 | python_classes = test_*,Test* 4 | 5 | [wheel] 6 | universal = 1 7 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/celery/cookiecutter-celeryproject/master/{{cookiecutter.project_slug}}/docs/images/logo.png -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/celery/cookiecutter-celeryproject/master/{{cookiecutter.project_slug}}/docs/images/favicon.ico -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/requirements/pkgutils.txt: -------------------------------------------------------------------------------- 1 | setuptools>=20.6.7 2 | wheel>=0.29.0 3 | flake8>=2.5.4 4 | flakeplus>=1.1 5 | tox>=2.3.1 6 | sphinx2rst>=1.0 7 | bumpversion 8 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/glossary.rst: -------------------------------------------------------------------------------- 1 | .. _glossary: 2 | 3 | Glossary 4 | ======== 5 | 6 | .. glossary:: 7 | :sorted: 8 | 9 | term 10 | Description of term 11 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/reference/index.rst: -------------------------------------------------------------------------------- 1 | .. _apiref: 2 | 3 | =============== 4 | API Reference 5 | =============== 6 | 7 | :Release: |version| 8 | :Date: |today| 9 | 10 | .. toctree:: 11 | :maxdepth: 1 12 | 13 | {{ cookiecutter.project_slug }} 14 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = 1 3 | cover_pylib = 0 4 | include = *{{ cookiecutter.project_slug }}/* 5 | omit = {{ cookiecutter.project_slug }}.tests.* 6 | 7 | [report] 8 | omit = 9 | */python?.?/* 10 | */site-packages/* 11 | */pypy/* 12 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/Changelog: -------------------------------------------------------------------------------- 1 | .. _changelog: 2 | 3 | ================ 4 | Change history 5 | ================ 6 | 7 | .. _version-{{ cookiecutter.version }} 8 | 9 | {{ cookiecutter.version }} 10 | ===== 11 | :release-date: TBA 12 | :release-by: 13 | 14 | - Initial release 15 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | indent_style = space 7 | indent_size = 4 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | charset = utf-8 11 | end_of_line = lf 12 | 13 | [Makefile] 14 | indent_style = tab 15 | -------------------------------------------------------------------------------- /cookiecutter.json: -------------------------------------------------------------------------------- 1 | { 2 | "full_name": "Your Name", 3 | "email": "you@example.com", 4 | "github_username": "celery", 5 | "project_name": "Boilerplate", 6 | "project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '_') }}", 7 | "project_short_description": "Boilerplate boilerplate", 8 | "year": "2016", 9 | "version": "1.0.0" 10 | } 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.pyc 3 | *$py.class 4 | *~ 5 | .*.sw[pon] 6 | dist/ 7 | *.egg-info 8 | *.egg 9 | *.egg/ 10 | build/ 11 | .build/ 12 | _build/ 13 | pip-log.txt 14 | .directory 15 | erl_crash.dump 16 | *.db 17 | Documentation/ 18 | .tox/ 19 | .ropeproject/ 20 | .project 21 | .pydevproject 22 | .idea/ 23 | .coverage 24 | celery/tests/cover/ 25 | .ve* 26 | cover/ 27 | .vagrant/ 28 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.pyc 3 | *$py.class 4 | *~ 5 | .*.sw[pon] 6 | dist/ 7 | *.egg-info 8 | *.egg 9 | *.egg/ 10 | build/ 11 | .build/ 12 | _build/ 13 | pip-log.txt 14 | .directory 15 | erl_crash.dump 16 | *.db 17 | Documentation/ 18 | .tox/ 19 | .ropeproject/ 20 | .project 21 | .pydevproject 22 | .idea/ 23 | .coverage 24 | celery/tests/cover/ 25 | .ve* 26 | cover/ 27 | .vagrant/ 28 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include Changelog 2 | include LICENSE 3 | include README.rst 4 | include MANIFEST.in 5 | include setup.cfg 6 | include setup.py 7 | recursive-include docs * 8 | recursive-include extra/* 9 | recursive-include examples * 10 | recursive-include requirements *.txt *.rst 11 | 12 | recursive-exclude * __pycache__ 13 | recursive-exclude * *.py[co] 14 | recursive-exclude * .*.sw[a-z] 15 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/reference/{{cookiecutter.project_slug}}.rst: -------------------------------------------------------------------------------- 1 | ===================================================== 2 | {{ cookiecutter.project_slug }} 3 | ===================================================== 4 | 5 | .. contents:: 6 | :local: 7 | .. currentmodule:: {{ cookiecutter.project_slug }} 8 | 9 | .. automodule:: {{ cookiecutter.project_slug }} 10 | :members: 11 | :undoc-members: 12 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/includes/introduction.txt: -------------------------------------------------------------------------------- 1 | :Version: {{ cookiecutter.version }} 2 | :Web: http://{{ cookiecutter.project_slug }}.readthedocs.org/ 3 | :Download: http://pypi.python.org/pypi/{{ cookiecutter.project_slug }} 4 | :Source: http://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }} 5 | :Keywords: KEYWORDS 6 | 7 | About 8 | ===== 9 | 10 | # I'm too lazy to edit the defaults. 11 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.bumpversion.cfg: -------------------------------------------------------------------------------- 1 | [bumpversion] 2 | current_version = {{ cookiecutter.version }} 3 | commit = True 4 | tag = True 5 | parse = (?P\d+)\.(?P\d+)\.(?P\d+)(?P[a-z]+)? 6 | serialize = 7 | {major}.{minor}.{patch}{releaselevel} 8 | {major}.{minor}.{patch} 9 | 10 | [bumpversion:file:{{ cookiecutter.project_slug }}/__init__.py] 11 | 12 | [bumpversion:file:docs/includes/introduction.txt] 13 | 14 | [bumpversion:file:README.rst] 15 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | sudo: false 3 | cache: false 4 | python: 5 | - '3.5' 6 | os: 7 | - linux 8 | - osx 9 | env: 10 | global: 11 | PYTHONUNBUFFERED=yes 12 | matrix: 13 | - TOXENV=2.7 14 | - TOXENV=3.4 15 | - TOXENV=pypy 16 | - TOXENV=3.5 17 | - TOXENV=pypy3 18 | - TOXENV=flake8 19 | - TOXENV=flakeplus 20 | - TOXENV=apicheck 21 | install: travis_retry pip install -U tox 22 | script: tox -v -- -v 23 | after_success: 24 | - .tox/$TRAVIS_PYTHON_VERSION/bin/coverage xml 25 | - .tox/$TRAVIS_PYTHON_VERSION/bin/codecov -e TOXENV 26 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/index.rst: -------------------------------------------------------------------------------- 1 | ======================================================================= 2 | {{ cookiecutter.project_name }} - {{ cookiecutter.project_short_description }} 3 | ======================================================================= 4 | 5 | .. include:: includes/introduction.txt 6 | 7 | Contents 8 | ======== 9 | 10 | .. toctree:: 11 | :maxdepth: 1 12 | 13 | copyright 14 | 15 | .. toctree:: 16 | :maxdepth: 2 17 | 18 | reference/index 19 | 20 | .. toctree:: 21 | :maxdepth: 1 22 | 23 | changelog 24 | glossary 25 | 26 | Indices and tables 27 | ================== 28 | 29 | * :ref:`genindex` 30 | * :ref:`modindex` 31 | * :ref:`search` 32 | 33 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.cookiecutterrc: -------------------------------------------------------------------------------- 1 | # This file exists so you can easily regenerate your project. 2 | # 3 | # `cookiepatcher` is a convenient shim around `cookiecutter` 4 | # for regenerating projects (it will generate a .cookiecutterrc 5 | # automatically for any template). To use it: 6 | # 7 | # pip install cookiepatcher 8 | # cookiepatcher gh:ionelmc/cookiecutter-pylibrary project-path 9 | # 10 | # See: 11 | # https://pypi.python.org/pypi/cookiecutter 12 | # 13 | # Alternatively, you can run: 14 | # 15 | # cookiecutter --overwrite-if-exists --config-file=project-path/.cookiecutterrc gh:ionelmc/cookiecutter-pylibrary 16 | 17 | default_context: 18 | {% for key, value in cookiecutter.items()|sort %} 19 | {{ "{0:26}".format(key + ":") }} {{ "{0!r}".format(value).strip("u") }} 20 | {%- endfor %} 21 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import absolute_import, unicode_literals 3 | 4 | import os 5 | 6 | from sphinx_celery import conf 7 | 8 | globals().update(conf.build_config( 9 | '{{ cookiecutter.project_slug }}', __file__, 10 | project='{{ cookiecutter.project_name }}', 11 | # version_dev='2.0', 12 | # version_stable='1.4', 13 | canonical_url='http://{{ cookiecutter.project_slug }}.readthedocs.org', 14 | webdomain='', 15 | github_project='{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}', 16 | copyright='{{ cookiecutter.year }}', 17 | html_logo='images/logo.png', 18 | html_favicon='images/favicon.ico', 19 | html_prepend_sidebars=[], 20 | include_intersphinx={'python', 'sphinx'}, 21 | # django_settings='testproj.settings', 22 | # path_additions=[os.path.join(os.pardir, 'testproj')], 23 | # apicheck_ignore_modules=[ 24 | # '{{ cookiecutter.project_slug }}', 25 | # ], 26 | )) 27 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/copyright.rst: -------------------------------------------------------------------------------- 1 | Copyright 2 | ========= 3 | 4 | *{{ cookiecutter.project_name }} User Manual* 5 | 6 | by {{ cookiecutter.full_name }} 7 | 8 | .. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN 9 | 10 | Copyright |copy| {{ cookiecutter.year }}, {{ cookiecutter.full_name }} 11 | 12 | All rights reserved. This material may be copied or distributed only 13 | subject to the terms and conditions set forth in the `Creative Commons 14 | Attribution-ShareAlike 4.0 International` 15 | `_ license. 16 | 17 | You may share and adapt the material, even for commercial purposes, but 18 | you must give the original author credit. 19 | If you alter, transform, or build upon this 20 | work, you may distribute the resulting work only under the same license or 21 | a license compatible to this one. 22 | 23 | .. note:: 24 | 25 | While the {{ cookiecutter.project_name }} *documentation* is offered under the 26 | Creative Commons *Attribution-ShareAlike 4.0 International* license 27 | the {{ cookiecutter.project_name }} *software* is offered under the 28 | `BSD License (3 Clause) `_ 29 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """{{ cookiecutter.project_short_description }}""" 3 | # :copyright: (c) {{ cookiecutter.year }}, {{ cookiecutter.full_name }}. 4 | # All rights reserved. 5 | # :license: BSD (3 Clause), see LICENSE for more details. 6 | 7 | from __future__ import absolute_import, unicode_literals 8 | 9 | import re 10 | 11 | from collections import namedtuple 12 | 13 | __version__ = '{{ cookiecutter.version }}' 14 | __author__ = '{{ cookiecutter.full_name }}' 15 | __contact__ = '{{ cookiecutter.email }}' 16 | __homepage__ = 'https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}' 17 | __docformat__ = 'restructuredtext' 18 | 19 | # -eof meta- 20 | 21 | version_info_t = namedtuple('version_info_t', ( 22 | 'major', 'minor', 'micro', 'releaselevel', 'serial', 23 | )) 24 | 25 | # bumpversion can only search for {current_version} 26 | # so we have to parse the version here. 27 | _temp = re.match( 28 | r'(\d+)\.(\d+).(\d+)(.+)?', __version__).groups() 29 | VERSION = version_info = version_info_t( 30 | int(_temp[0]), int(_temp[1]), int(_temp[2]), _temp[3] or '', '') 31 | del(_temp) 32 | del(re) 33 | 34 | __all__ = [] 35 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/includes/installation.txt: -------------------------------------------------------------------------------- 1 | .. _installation: 2 | 3 | Installation 4 | ============ 5 | 6 | You can install {{ cookiecutter.project_slug }} either via the Python Package Index (PyPI) 7 | or from source. 8 | 9 | To install using `pip`,:: 10 | 11 | $ pip install -U {{ cookiecutter.project_slug }} 12 | 13 | .. _installing-from-source: 14 | 15 | Downloading and installing from source 16 | -------------------------------------- 17 | 18 | Download the latest version of {{ cookiecutter.project_slug }} from 19 | http://pypi.python.org/pypi/{{ cookiecutter.project_slug }} 20 | 21 | You can install it by doing the following,:: 22 | 23 | $ tar xvfz {{ cookiecutter.project_slug }}-0.0.0.tar.gz 24 | $ cd {{ cookiecutter.project_slug }}-0.0.0 25 | $ python setup.py build 26 | # python setup.py install 27 | 28 | The last command must be executed as a privileged user if 29 | you are not currently using a virtualenv. 30 | 31 | .. _installing-from-git: 32 | 33 | Using the development version 34 | ----------------------------- 35 | 36 | With pip 37 | ~~~~~~~~ 38 | 39 | You can install the latest snapshot of {{ cookiecutter.project_slug}} using the following 40 | pip command:: 41 | 42 | $ pip install https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}/zipball/master#egg={{ cookiecutter.project_slug }} 43 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = 2.7,pypy,3.4,3.5,pypy3,flake8,flakeplus,apicheck,configcheck 3 | 4 | [testenv] 5 | deps= 6 | -r{toxinidir}/requirements/default.txt 7 | -r{toxinidir}/requirements/test.txt 8 | -r{toxinidir}/requirements/test-ci.txt 9 | 10 | linkcheck,apicheck: -r{toxinidir}/requirements/docs.txt 11 | flake8,flakeplus: -r{toxinidir}/requirements/pkgutils.txt 12 | sitepackages = False 13 | recreate = False 14 | commands = py.test -xv --cov=mazecache/ --cov-report=xml --no-cov-on-fail 15 | 16 | basepython = 17 | 2.7,flake8,flakeplus,apicheck,linkcheck,configcheck: python2.7 18 | 3.4: python3.4 19 | 3.5: python3.5 20 | pypy: pypy 21 | pypy3: pypy3 22 | 23 | [testenv:apicheck] 24 | commands = 25 | pip install -U -r{toxinidir}/requirements/dev.txt 26 | sphinx-build -W -b apicheck -d {envtmpdir}/doctrees docs docs/_build/apicheck 27 | 28 | [testenv:configcheck] 29 | commands = 30 | pip install -U -r{toxinidir}/requirements/dev.txt 31 | sphinx-build -W -b configcheck -d {envtmpdir}/doctrees docs docs/_build/configcheck 32 | 33 | [testenv:linkcheck] 34 | commands = 35 | pip install -U -r{toxinidir}/requirements/dev.txt 36 | sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs docs/_build/linkcheck 37 | 38 | [testenv:flake8] 39 | commands = 40 | flake8 --ignore=X999 {toxinidir}/{{ cookiecutter.project_slug }} 41 | 42 | [testenv:flakeplus] 43 | commands = 44 | flakeplus --2.7 {toxinidir}/{{ cookiecutter.project_slug }} 45 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/appveyor.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | 3 | global: 4 | # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the 5 | # /E:ON and /V:ON options are not enabled in the batch script intepreter 6 | # See: http://stackoverflow.com/a/13751649/163740 7 | WITH_COMPILER: "cmd /E:ON /V:ON /C .\\extra\\appveyor\\run_with_compiler.cmd" 8 | 9 | matrix: 10 | 11 | # Pre-installed Python versions, which Appveyor may upgrade to 12 | # a later point release. 13 | # See: http://www.appveyor.com/docs/installed-software#python 14 | 15 | - PYTHON: "C:\\Python27" 16 | PYTHON_VERSION: "2.7.x" 17 | PYTHON_ARCH: "32" 18 | 19 | - PYTHON: "C:\\Python34" 20 | PYTHON_VERSION: "3.4.x" 21 | PYTHON_ARCH: "32" 22 | 23 | - PYTHON: "C:\\Python27-x64" 24 | PYTHON_VERSION: "2.7.x" 25 | PYTHON_ARCH: "64" 26 | WINDOWS_SDK_VERSION: "v7.0" 27 | 28 | - PYTHON: "C:\\Python34-x64" 29 | PYTHON_VERSION: "3.4.x" 30 | PYTHON_ARCH: "64" 31 | WINDOWS_SDK_VERSION: "v7.1" 32 | 33 | 34 | init: 35 | - "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%" 36 | 37 | install: 38 | - "powershell extra\\appveyor\\install.ps1" 39 | - "%PYTHON%/Scripts/pip.exe install -U setuptools" 40 | 41 | build: off 42 | 43 | test_script: 44 | - "%WITH_COMPILER% %PYTHON%/python setup.py test" 45 | 46 | after_test: 47 | - "%WITH_COMPILER% %PYTHON%/python setup.py bdist_wheel" 48 | 49 | artifacts: 50 | - path: dist\* 51 | 52 | #on_success: 53 | # - TODO: upload the content of dist/*.whl to a public wheelhouse 54 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/templates/readme.txt: -------------------------------------------------------------------------------- 1 | ===================================================================== 2 | {{ cookiecutter.project_short_description }} 3 | ===================================================================== 4 | 5 | |build-status| |coverage| |license| |wheel| |pyversion| |pyimp| 6 | 7 | .. include:: ../includes/introduction.txt 8 | 9 | .. include:: ../includes/installation.txt 10 | 11 | .. |build-status| image:: https://secure.travis-ci.org/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}.png?branch=master 12 | :alt: Build status 13 | :target: https://travis-ci.org/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }} 14 | 15 | .. |coverage| image:: https://codecov.io/github/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}/coverage.svg?branch=master 16 | :target: https://codecov.io/github/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}?branch=master 17 | 18 | .. |license| image:: https://img.shields.io/pypi/l/{{ cookiecutter.project_slug }}.svg 19 | :alt: BSD License 20 | :target: https://opensource.org/licenses/BSD-3-Clause 21 | 22 | .. |wheel| image:: https://img.shields.io/pypi/wheel/{{ cookiecutter.project_slug }}.svg 23 | :alt: {{ cookiecutter.project_name }} can be installed via wheel 24 | :target: http://pypi.python.org/pypi/{{ cookiecutter.project_slug }}/ 25 | 26 | .. |pyversion| image:: https://img.shields.io/pypi/pyversions/{{ cookiecutter.project_slug }}.svg 27 | :alt: Supported Python versions. 28 | :target: http://pypi.python.org/pypi/{{ cookiecutter.project_slug }}/ 29 | 30 | .. |pyimp| image:: https://img.shields.io/pypi/implementation/{{ cookiecutter.project_slug }}.svg 31 | :alt: Support Python implementations. 32 | :target: http://pypi.python.org/pypi/{{ cookiecutter.project_slug }}/ 33 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/extra/appveyor/run_with_compiler.cmd: -------------------------------------------------------------------------------- 1 | :: To build extensions for 64 bit Python 3, we need to configure environment 2 | :: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of: 3 | :: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1) 4 | :: 5 | :: To build extensions for 64 bit Python 2, we need to configure environment 6 | :: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of: 7 | :: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0) 8 | :: 9 | :: 32 bit builds do not require specific environment configurations. 10 | :: 11 | :: Note: this script needs to be run with the /E:ON and /V:ON flags for the 12 | :: cmd interpreter, at least for (SDK v7.0) 13 | :: 14 | :: More details at: 15 | :: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows 16 | :: http://stackoverflow.com/a/13751649/163740 17 | :: 18 | :: Author: Olivier Grisel 19 | :: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ 20 | @ECHO OFF 21 | 22 | SET COMMAND_TO_RUN=%* 23 | SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows 24 | 25 | SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%" 26 | IF %MAJOR_PYTHON_VERSION% == "2" ( 27 | SET WINDOWS_SDK_VERSION="v7.0" 28 | ) ELSE IF %MAJOR_PYTHON_VERSION% == "3" ( 29 | SET WINDOWS_SDK_VERSION="v7.1" 30 | ) ELSE ( 31 | ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%" 32 | EXIT 1 33 | ) 34 | 35 | IF "%PYTHON_ARCH%"=="64" ( 36 | ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture 37 | SET DISTUTILS_USE_SDK=1 38 | SET MSSdk=1 39 | "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% 40 | "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release 41 | ECHO Executing: %COMMAND_TO_RUN% 42 | call %COMMAND_TO_RUN% || EXIT 1 43 | ) ELSE ( 44 | ECHO Using default MSVC build environment for 32 bit architecture 45 | ECHO Executing: %COMMAND_TO_RUN% 46 | call %COMMAND_TO_RUN% || EXIT 1 47 | ) 48 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) {{ cookiecutter.year }}, {{ cookiecutter.full_name }} and individual contributors. 2 | All rights reserved. 3 | 4 | {{ cookiecutter.project_name }} is licensed under The BSD License (3 Clause, also known as 5 | the new BSD license). The license is an OSI approved Open Source 6 | license and is GPL-compatible(1). 7 | 8 | The license text can also be found here: 9 | http://www.opensource.org/licenses/BSD-3-Clause 10 | 11 | License 12 | ======= 13 | 14 | Redistribution and use in source and binary forms, with or without 15 | modification, are permitted provided that the following conditions are met: 16 | * Redistributions of source code must retain the above copyright 17 | notice, this list of conditions and the following disclaimer. 18 | * Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | * Neither the name of {{ cookiecutter.full_name }} nor the 22 | names of its contributors may be used to endorse or promote products 23 | derived from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 27 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 28 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL {{ cookiecutter.full_name }} OR CONTRIBUTORS 29 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | POSSIBILITY OF SUCH DAMAGE. 36 | 37 | Documentation License 38 | ===================== 39 | 40 | The documentation portion of {{ cookiecutter.project_name }} (the rendered contents of the 41 | "docs" directory of a software distribution or checkout) is supplied 42 | under the "Creative Commons Attribution-ShareAlike 4.0 43 | International" (CC BY-SA 4.0) License as described by 44 | http://creativecommons.org/licenses/by-sa/4.0/ 45 | 46 | Footnotes 47 | ========= 48 | (1) A GPL-compatible license makes it possible to 49 | combine {{ cookiecutter.project_name }} with other software that is released 50 | under the GPL, it does not mean that we're distributing 51 | {{ cookiecutter.project_name }} under the GPL license. The BSD license, unlike the GPL, 52 | let you distribute a modified version without making your 53 | changes open source. 54 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/extra/appveyor/install.ps1: -------------------------------------------------------------------------------- 1 | # Sample script to install Python and pip under Windows 2 | # Authors: Olivier Grisel and Kyle Kastner 3 | # License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ 4 | 5 | $BASE_URL = "https://www.python.org/ftp/python/" 6 | $GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py" 7 | $GET_PIP_PATH = "C:\get-pip.py" 8 | 9 | 10 | function DownloadPython ($python_version, $platform_suffix) { 11 | $webclient = New-Object System.Net.WebClient 12 | $filename = "python-" + $python_version + $platform_suffix + ".msi" 13 | $url = $BASE_URL + $python_version + "/" + $filename 14 | 15 | $basedir = $pwd.Path + "\" 16 | $filepath = $basedir + $filename 17 | if (Test-Path $filename) { 18 | Write-Host "Reusing" $filepath 19 | return $filepath 20 | } 21 | 22 | # Download and retry up to 5 times in case of network transient errors. 23 | Write-Host "Downloading" $filename "from" $url 24 | $retry_attempts = 3 25 | for($i=0; $i -lt $retry_attempts; $i++){ 26 | try { 27 | $webclient.DownloadFile($url, $filepath) 28 | break 29 | } 30 | Catch [Exception]{ 31 | Start-Sleep 1 32 | } 33 | } 34 | Write-Host "File saved at" $filepath 35 | return $filepath 36 | } 37 | 38 | 39 | function InstallPython ($python_version, $architecture, $python_home) { 40 | Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home 41 | if (Test-Path $python_home) { 42 | Write-Host $python_home "already exists, skipping." 43 | return $false 44 | } 45 | if ($architecture -eq "32") { 46 | $platform_suffix = "" 47 | } else { 48 | $platform_suffix = ".amd64" 49 | } 50 | $filepath = DownloadPython $python_version $platform_suffix 51 | Write-Host "Installing" $filepath "to" $python_home 52 | $args = "/qn /i $filepath TARGETDIR=$python_home" 53 | Write-Host "msiexec.exe" $args 54 | Start-Process -FilePath "msiexec.exe" -ArgumentList $args -Wait -Passthru 55 | Write-Host "Python $python_version ($architecture) installation complete" 56 | return $true 57 | } 58 | 59 | 60 | function InstallPip ($python_home) { 61 | $pip_path = $python_home + "/Scripts/pip.exe" 62 | $python_path = $python_home + "/python.exe" 63 | if (-not(Test-Path $pip_path)) { 64 | Write-Host "Installing pip..." 65 | $webclient = New-Object System.Net.WebClient 66 | $webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH) 67 | Write-Host "Executing:" $python_path $GET_PIP_PATH 68 | Start-Process -FilePath "$python_path" -ArgumentList "$GET_PIP_PATH" -Wait -Passthru 69 | } else { 70 | Write-Host "pip already installed." 71 | } 72 | } 73 | 74 | function InstallPackage ($python_home, $pkg) { 75 | $pip_path = $python_home + "/Scripts/pip.exe" 76 | & $pip_path install $pkg 77 | } 78 | 79 | function main () { 80 | InstallPython $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON 81 | InstallPip $env:PYTHON 82 | InstallPackage $env:PYTHON wheel 83 | } 84 | 85 | main 86 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | from setuptools import setup, find_packages 5 | 6 | import os 7 | import re 8 | import sys 9 | import codecs 10 | 11 | try: 12 | import platform 13 | _pyimp = platform.python_implementation 14 | except (AttributeError, ImportError): 15 | def _pyimp(): 16 | return 'Python' 17 | 18 | NAME = '{{ cookiecutter.project_slug }}' 19 | 20 | E_UNSUPPORTED_PYTHON = '%s 1.0 requires %%s %%s or later!' % (NAME,) 21 | 22 | PYIMP = _pyimp() 23 | PY26_OR_LESS = sys.version_info < (2, 7) 24 | PY3 = sys.version_info[0] == 3 25 | PY33_OR_LESS = PY3 and sys.version_info < (3, 4) 26 | PYPY_VERSION = getattr(sys, 'pypy_version_info', None) 27 | PYPY = PYPY_VERSION is not None 28 | PYPY24_ATLEAST = PYPY_VERSION and PYPY_VERSION >= (2, 4) 29 | 30 | if PY26_OR_LESS: 31 | raise Exception(E_UNSUPPORTED_PYTHON % (PYIMP, '2.7')) 32 | elif PY33_OR_LESS and not PYPY24_ATLEAST: 33 | raise Exception(E_UNSUPPORTED_PYTHON % (PYIMP, '3.4')) 34 | 35 | # -*- Classifiers -*- 36 | 37 | classes = """ 38 | Development Status :: 2 - Pre-Alpha 39 | License :: OSI Approved :: BSD License 40 | Programming Language :: Python 41 | Programming Language :: Python :: 2 42 | Programming Language :: Python :: 2.7 43 | Programming Language :: Python :: 3 44 | Programming Language :: Python :: 3.4 45 | Programming Language :: Python :: 3.5 46 | Programming Language :: Python :: Implementation :: CPython 47 | Programming Language :: Python :: Implementation :: PyPy 48 | Programming Language :: Python :: Implementation :: Jython 49 | Operating System :: OS Independent 50 | """ 51 | classifiers = [s.strip() for s in classes.split('\n') if s] 52 | 53 | # -*- Distribution Meta -*- 54 | 55 | re_meta = re.compile(r'__(\w+?)__\s*=\s*(.*)') 56 | re_doc = re.compile(r'^"""(.+?)"""') 57 | 58 | 59 | def add_default(m): 60 | attr_name, attr_value = m.groups() 61 | return ((attr_name, attr_value.strip("\"'")),) 62 | 63 | 64 | def add_doc(m): 65 | return (('doc', m.groups()[0]),) 66 | 67 | pats = {re_meta: add_default, 68 | re_doc: add_doc} 69 | here = os.path.abspath(os.path.dirname(__file__)) 70 | with open(os.path.join(here, NAME, '__init__.py')) as meta_fh: 71 | meta = {} 72 | for line in meta_fh: 73 | if line.strip() == '# -eof meta-': 74 | break 75 | for pattern, handler in pats.items(): 76 | m = pattern.match(line.strip()) 77 | if m: 78 | meta.update(handler(m)) 79 | 80 | # -*- Installation Requires -*- 81 | 82 | def strip_comments(l): 83 | return l.split('#', 1)[0].strip() 84 | 85 | 86 | def _pip_requirement(req): 87 | if req.startswith('-r '): 88 | _, path = req.split() 89 | return reqs(*path.split('/')) 90 | return [req] 91 | 92 | 93 | def _reqs(*f): 94 | return [ 95 | _pip_requirement(r) for r in ( 96 | strip_comments(l) for l in open( 97 | os.path.join(os.getcwd(), 'requirements', *f)).readlines() 98 | ) if r] 99 | 100 | 101 | def reqs(*f): 102 | return [req for subreq in _reqs(*f) for req in subreq] 103 | 104 | # -*- Long Description -*- 105 | 106 | if os.path.exists('README.rst'): 107 | long_description = codecs.open('README.rst', 'r', 'utf-8').read() 108 | else: 109 | long_description = 'See http://pypi.python.org/pypi/%s' % (NAME,) 110 | 111 | # -*- %%% -*- 112 | 113 | setup( 114 | name=NAME, 115 | version=meta['version'], 116 | description=meta['doc'], 117 | author=meta['author'], 118 | author_email=meta['contact'], 119 | url=meta['homepage'], 120 | platforms=['any'], 121 | license='BSD', 122 | packages=find_packages(exclude=['ez_setup', 'tests', 'tests.*']), 123 | include_package_data=False, 124 | zip_safe=False, 125 | install_requires=reqs('default.txt'), 126 | tests_require=reqs('test.txt'), 127 | test_suite='nose.collector', 128 | classifiers=classifiers, 129 | long_description=long_description, 130 | ) 131 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/Makefile: -------------------------------------------------------------------------------- 1 | PROJ={{ cookiecutter.project_slug }} 2 | PGPIDENT="Celery Security Team" 3 | PYTHON=python 4 | PYTEST=py.test 5 | GIT=git 6 | TOX=tox 7 | NOSETESTS=nosetests 8 | ICONV=iconv 9 | FLAKE8=flake8 10 | FLAKEPLUS=flakeplus 11 | SPHINX2RST=sphinx2rst 12 | 13 | TESTDIR=t 14 | SPHINX_DIR=docs/ 15 | SPHINX_BUILDDIR="${SPHINX_DIR}/_build" 16 | README=README.rst 17 | README_SRC="docs/templates/readme.txt" 18 | CONTRIBUTING=CONTRIBUTING.rst 19 | CONTRIBUTING_SRC="docs/contributing.rst" 20 | SPHINX_HTMLDIR="${SPHINX_BUILDDIR}/html" 21 | DOCUMENTATION=Documentation 22 | FLAKEPLUSTARGET=2.7 23 | 24 | all: help 25 | 26 | help: 27 | @echo "docs - Build documentation." 28 | @echo "test-all - Run tests for all supported python versions." 29 | @echo "distcheck ---------- - Check distribution for problems." 30 | @echo " test - Run unittests using current python." 31 | @echo " lint ------------ - Check codebase for problems." 32 | @echo " apicheck - Check API reference coverage." 33 | @echo " configcheck - Check configuration reference coverage." 34 | @echo " readmecheck - Check README.rst encoding." 35 | @echo " contribcheck - Check CONTRIBUTING.rst encoding" 36 | @echo " flakes -------- - Check code for syntax and style errors." 37 | @echo " flakecheck - Run flake8 on the source code." 38 | @echo " flakepluscheck - Run flakeplus on the source code." 39 | @echo "readme - Regenerate README.rst file." 40 | @echo "contrib - Regenerate CONTRIBUTING.rst file" 41 | @echo "clean-dist --------- - Clean all distribution build artifacts." 42 | @echo " clean-git-force - Remove all uncomitted files." 43 | @echo " clean ------------ - Non-destructive clean" 44 | @echo " clean-pyc - Remove .pyc/__pycache__ files" 45 | @echo " clean-docs - Remove documentation build artifacts." 46 | @echo " clean-build - Remove setup artifacts." 47 | @echo "bump - Bump patch version number." 48 | @echo "bump-minor - Bump minor version number." 49 | @echo "bump-major - Bump major version number." 50 | @echo "release - Make PyPI release." 51 | 52 | clean: clean-docs clean-pyc clean-build 53 | 54 | clean-dist: clean clean-git-force 55 | 56 | bump: 57 | bumpversion patch 58 | 59 | bump-minor: 60 | bumpversion minor 61 | 62 | bump-major: 63 | bumpversion major 64 | 65 | release: 66 | python setup.py register sdist bdist_wheel upload --sign --identity="$(PGPIDENT)" 67 | 68 | Documentation: 69 | (cd "$(SPHINX_DIR)"; $(MAKE) html) 70 | mv "$(SPHINX_HTMLDIR)" $(DOCUMENTATION) 71 | 72 | docs: Documentation 73 | 74 | clean-docs: 75 | -rm -rf "$(SPHINX_BUILDDIR)" 76 | 77 | lint: flakecheck apicheck configcheck readmecheck 78 | 79 | apicheck: 80 | (cd "$(SPHINX_DIR)"; $(MAKE) apicheck) 81 | 82 | configcheck: 83 | (cd "$(SPHINX_DIR)"; $(MAKE) configcheck) 84 | 85 | flakecheck: 86 | $(FLAKE8) --ignore=X999 "$(PROJ)" "$(TESTDIR)" 87 | 88 | flakediag: 89 | -$(MAKE) flakecheck 90 | 91 | flakepluscheck: 92 | $(FLAKEPLUS) --$(FLAKEPLUSTARGET) "$(PROJ)" "$(TESTDIR)" 93 | 94 | flakeplusdiag: 95 | -$(MAKE) flakepluscheck 96 | 97 | flakes: flakediag flakeplusdiag 98 | 99 | clean-readme: 100 | -rm -f $(README) 101 | 102 | readmecheck: 103 | $(ICONV) -f ascii -t ascii $(README) >/dev/null 104 | 105 | $(README): 106 | $(SPHINX2RST) "$(README_SRC)" --ascii > $@ 107 | 108 | readme: clean-readme $(README) readmecheck 109 | 110 | clean-contrib: 111 | -rm -f "$(CONTRIBUTING)" 112 | 113 | $(CONTRIBUTING): 114 | $(SPHINX2RST) "$(CONTRIBUTING_SRC)" > $@ 115 | 116 | contrib: clean-contrib $(CONTRIBUTING) 117 | 118 | clean-pyc: 119 | -find . -type f -a \( -name "*.pyc" -o -name "*$$py.class" \) | xargs rm 120 | -find . -type d -name "__pycache__" | xargs rm -r 121 | 122 | removepyc: clean-pyc 123 | 124 | clean-build: 125 | rm -rf build/ dist/ .eggs/ *.egg-info/ .tox/ .coverage cover/ 126 | 127 | clean-git: 128 | $(GIT) clean -xdn 129 | 130 | clean-git-force: 131 | $(GIT) clean -xdf 132 | 133 | test-all: clean-pyc 134 | $(TOX) 135 | 136 | test: 137 | $(PYTHON) setup.py test 138 | 139 | cov: 140 | $(PYTEST) -x --cov="$(PROJ)" --cov-report=html) 141 | 142 | build: 143 | $(PYTHON) setup.py sdist bdist_wheel 144 | 145 | distcheck: lint test clean 146 | 147 | dist: readme contrib clean-dist build 148 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | if "%SPHINXBUILD%" == "" ( 6 | set SPHINXBUILD=sphinx-build 7 | ) 8 | set BUILDDIR=_build 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . 10 | set I18NSPHINXOPTS=%SPHINXOPTS% . 11 | if NOT "%PAPER%" == "" ( 12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% 14 | ) 15 | 16 | if "%1" == "" goto help 17 | 18 | if "%1" == "help" ( 19 | :help 20 | echo.Please use `make ^` where ^ is one of 21 | echo. html to make standalone HTML files 22 | echo. dirhtml to make HTML files named index.html in directories 23 | echo. singlehtml to make a single large HTML file 24 | echo. pickle to make pickle files 25 | echo. json to make JSON files 26 | echo. htmlhelp to make HTML files and a HTML help project 27 | echo. qthelp to make HTML files and a qthelp project 28 | echo. devhelp to make HTML files and a Devhelp project 29 | echo. epub to make an epub 30 | echo. epub3 to make an epub3 31 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 32 | echo. text to make text files 33 | echo. man to make manual pages 34 | echo. texinfo to make Texinfo files 35 | echo. gettext to make PO message catalogs 36 | echo. changes to make an overview over all changed/added/deprecated items 37 | echo. xml to make Docutils-native XML files 38 | echo. pseudoxml to make pseudoxml-XML files for display purposes 39 | echo. linkcheck to check all external links for integrity 40 | echo. doctest to run all doctests embedded in the documentation if enabled 41 | echo. coverage to run coverage check of the documentation if enabled 42 | goto end 43 | ) 44 | 45 | if "%1" == "clean" ( 46 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 47 | del /q /s %BUILDDIR%\* 48 | goto end 49 | ) 50 | 51 | 52 | REM Check if sphinx-build is available and fallback to Python version if any 53 | %SPHINXBUILD% 1>NUL 2>NUL 54 | if errorlevel 9009 goto sphinx_python 55 | goto sphinx_ok 56 | 57 | :sphinx_python 58 | 59 | set SPHINXBUILD=python -m sphinx.__init__ 60 | %SPHINXBUILD% 2> nul 61 | if errorlevel 9009 ( 62 | echo. 63 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 64 | echo.installed, then set the SPHINXBUILD environment variable to point 65 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 66 | echo.may add the Sphinx directory to PATH. 67 | echo. 68 | echo.If you don't have Sphinx installed, grab it from 69 | echo.http://sphinx-doc.org/ 70 | exit /b 1 71 | ) 72 | 73 | :sphinx_ok 74 | 75 | 76 | if "%1" == "html" ( 77 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 78 | if errorlevel 1 exit /b 1 79 | echo. 80 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 81 | goto end 82 | ) 83 | 84 | if "%1" == "dirhtml" ( 85 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 86 | if errorlevel 1 exit /b 1 87 | echo. 88 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 89 | goto end 90 | ) 91 | 92 | if "%1" == "singlehtml" ( 93 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 94 | if errorlevel 1 exit /b 1 95 | echo. 96 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 97 | goto end 98 | ) 99 | 100 | if "%1" == "pickle" ( 101 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 102 | if errorlevel 1 exit /b 1 103 | echo. 104 | echo.Build finished; now you can process the pickle files. 105 | goto end 106 | ) 107 | 108 | if "%1" == "json" ( 109 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 110 | if errorlevel 1 exit /b 1 111 | echo. 112 | echo.Build finished; now you can process the JSON files. 113 | goto end 114 | ) 115 | 116 | if "%1" == "htmlhelp" ( 117 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 118 | if errorlevel 1 exit /b 1 119 | echo. 120 | echo.Build finished; now you can run HTML Help Workshop with the ^ 121 | .hhp project file in %BUILDDIR%/htmlhelp. 122 | goto end 123 | ) 124 | 125 | if "%1" == "qthelp" ( 126 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 127 | if errorlevel 1 exit /b 1 128 | echo. 129 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 130 | .qhcp project file in %BUILDDIR%/qthelp, like this: 131 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\PROJ.qhcp 132 | echo.To view the help file: 133 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\PROJ.ghc 134 | goto end 135 | ) 136 | 137 | if "%1" == "devhelp" ( 138 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 139 | if errorlevel 1 exit /b 1 140 | echo. 141 | echo.Build finished. 142 | goto end 143 | ) 144 | 145 | if "%1" == "epub" ( 146 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 147 | if errorlevel 1 exit /b 1 148 | echo. 149 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 150 | goto end 151 | ) 152 | 153 | if "%1" == "epub3" ( 154 | %SPHINXBUILD% -b epub3 %ALLSPHINXOPTS% %BUILDDIR%/epub3 155 | if errorlevel 1 exit /b 1 156 | echo. 157 | echo.Build finished. The epub3 file is in %BUILDDIR%/epub3. 158 | goto end 159 | ) 160 | 161 | if "%1" == "latex" ( 162 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 163 | if errorlevel 1 exit /b 1 164 | echo. 165 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 166 | goto end 167 | ) 168 | 169 | if "%1" == "latexpdf" ( 170 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 171 | cd %BUILDDIR%/latex 172 | make all-pdf 173 | cd %~dp0 174 | echo. 175 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 176 | goto end 177 | ) 178 | 179 | if "%1" == "latexpdfja" ( 180 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 181 | cd %BUILDDIR%/latex 182 | make all-pdf-ja 183 | cd %~dp0 184 | echo. 185 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 186 | goto end 187 | ) 188 | 189 | if "%1" == "text" ( 190 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 191 | if errorlevel 1 exit /b 1 192 | echo. 193 | echo.Build finished. The text files are in %BUILDDIR%/text. 194 | goto end 195 | ) 196 | 197 | if "%1" == "man" ( 198 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 199 | if errorlevel 1 exit /b 1 200 | echo. 201 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 202 | goto end 203 | ) 204 | 205 | if "%1" == "texinfo" ( 206 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo 207 | if errorlevel 1 exit /b 1 208 | echo. 209 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. 210 | goto end 211 | ) 212 | 213 | if "%1" == "gettext" ( 214 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale 215 | if errorlevel 1 exit /b 1 216 | echo. 217 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale. 218 | goto end 219 | ) 220 | 221 | if "%1" == "changes" ( 222 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 223 | if errorlevel 1 exit /b 1 224 | echo. 225 | echo.The overview file is in %BUILDDIR%/changes. 226 | goto end 227 | ) 228 | 229 | if "%1" == "linkcheck" ( 230 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 231 | if errorlevel 1 exit /b 1 232 | echo. 233 | echo.Link check complete; look for any errors in the above output ^ 234 | or in %BUILDDIR%/linkcheck/output.txt. 235 | goto end 236 | ) 237 | 238 | if "%1" == "doctest" ( 239 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 240 | if errorlevel 1 exit /b 1 241 | echo. 242 | echo.Testing of doctests in the sources finished, look at the ^ 243 | results in %BUILDDIR%/doctest/output.txt. 244 | goto end 245 | ) 246 | 247 | if "%1" == "coverage" ( 248 | %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage 249 | if errorlevel 1 exit /b 1 250 | echo. 251 | echo.Testing of coverage in the sources finished, look at the ^ 252 | results in %BUILDDIR%/coverage/python.txt. 253 | goto end 254 | ) 255 | 256 | if "%1" == "xml" ( 257 | %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml 258 | if errorlevel 1 exit /b 1 259 | echo. 260 | echo.Build finished. The XML files are in %BUILDDIR%/xml. 261 | goto end 262 | ) 263 | 264 | if "%1" == "pseudoxml" ( 265 | %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml 266 | if errorlevel 1 exit /b 1 267 | echo. 268 | echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. 269 | goto end 270 | ) 271 | 272 | :end 273 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = _build 9 | 10 | # User-friendly check for sphinx-build 11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don\'t have Sphinx installed, grab it from http://sphinx-doc.org/) 13 | endif 14 | 15 | # Internal variables. 16 | PAPEROPT_a4 = -D latex_paper_size=a4 17 | PAPEROPT_letter = -D latex_paper_size=letter 18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 19 | # the i18n builder cannot share the environment and doctrees with the others 20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 21 | 22 | .PHONY: help 23 | help: 24 | @echo "Please use \`make ' where is one of" 25 | @echo " html to make standalone HTML files" 26 | @echo " dirhtml to make HTML files named index.html in directories" 27 | @echo " singlehtml to make a single large HTML file" 28 | @echo " pickle to make pickle files" 29 | @echo " json to make JSON files" 30 | @echo " htmlhelp to make HTML files and a HTML help project" 31 | @echo " qthelp to make HTML files and a qthelp project" 32 | @echo " applehelp to make an Apple Help Book" 33 | @echo " devhelp to make HTML files and a Devhelp project" 34 | @echo " epub to make an epub" 35 | @echo " epub3 to make an epub3" 36 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 37 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 38 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 39 | @echo " text to make text files" 40 | @echo " man to make manual pages" 41 | @echo " texinfo to make Texinfo files" 42 | @echo " info to make Texinfo files and run them through makeinfo" 43 | @echo " gettext to make PO message catalogs" 44 | @echo " changes to make an overview of all changed/added/deprecated items" 45 | @echo " xml to make Docutils-native XML files" 46 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 47 | @echo " linkcheck to check all external links for integrity" 48 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 49 | @echo " coverage to run coverage check of the documentation (if enabled)" 50 | @echo " apicheck to verify that all modules are present in autodoc" 51 | @echo " configcheck to verify that all modules are present in autodoc" 52 | @echo " spelling to run a spell checker on the documentation" 53 | 54 | .PHONY: clean 55 | clean: 56 | rm -rf $(BUILDDIR)/* 57 | 58 | .PHONY: html 59 | html: 60 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 61 | @echo 62 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 63 | 64 | .PHONY: dirhtml 65 | dirhtml: 66 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 67 | @echo 68 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 69 | 70 | .PHONY: singlehtml 71 | singlehtml: 72 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 73 | @echo 74 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 75 | 76 | .PHONY: pickle 77 | pickle: 78 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 79 | @echo 80 | @echo "Build finished; now you can process the pickle files." 81 | 82 | .PHONY: json 83 | json: 84 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 85 | @echo 86 | @echo "Build finished; now you can process the JSON files." 87 | 88 | .PHONY: htmlhelp 89 | htmlhelp: 90 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 91 | @echo 92 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 93 | ".hhp project file in $(BUILDDIR)/htmlhelp." 94 | 95 | .PHONY: qthelp 96 | qthelp: 97 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 98 | @echo 99 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 100 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 101 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PROJ.qhcp" 102 | @echo "To view the help file:" 103 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PROJ.qhc" 104 | 105 | .PHONY: applehelp 106 | applehelp: 107 | $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp 108 | @echo 109 | @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." 110 | @echo "N.B. You won't be able to view it unless you put it in" \ 111 | "~/Library/Documentation/Help or install it in your application" \ 112 | "bundle." 113 | 114 | .PHONY: devhelp 115 | devhelp: 116 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 117 | @echo 118 | @echo "Build finished." 119 | @echo "To view the help file:" 120 | @echo "# mkdir -p $$HOME/.local/share/devhelp/PROJ" 121 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PROJ" 122 | @echo "# devhelp" 123 | 124 | .PHONY: epub 125 | epub: 126 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 127 | @echo 128 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 129 | 130 | .PHONY: epub3 131 | epub3: 132 | $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 133 | @echo 134 | @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." 135 | 136 | .PHONY: latex 137 | latex: 138 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 139 | @echo 140 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 141 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 142 | "(use \`make latexpdf' here to do that automatically)." 143 | 144 | .PHONY: latexpdf 145 | latexpdf: 146 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 147 | @echo "Running LaTeX files through pdflatex..." 148 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 149 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 150 | 151 | .PHONY: latexpdfja 152 | latexpdfja: 153 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 154 | @echo "Running LaTeX files through platex and dvipdfmx..." 155 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 156 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 157 | 158 | .PHONY: text 159 | text: 160 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 161 | @echo 162 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 163 | 164 | .PHONY: man 165 | man: 166 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 167 | @echo 168 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 169 | 170 | .PHONY: texinfo 171 | texinfo: 172 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 173 | @echo 174 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 175 | @echo "Run \`make' in that directory to run these through makeinfo" \ 176 | "(use \`make info' here to do that automatically)." 177 | 178 | .PHONY: info 179 | info: 180 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 181 | @echo "Running Texinfo files through makeinfo..." 182 | make -C $(BUILDDIR)/texinfo info 183 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 184 | 185 | .PHONY: gettext 186 | gettext: 187 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 188 | @echo 189 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 190 | 191 | .PHONY: changes 192 | changes: 193 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 194 | @echo 195 | @echo "The overview file is in $(BUILDDIR)/changes." 196 | 197 | .PHONY: linkcheck 198 | linkcheck: 199 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 200 | @echo 201 | @echo "Link check complete; look for any errors in the above output " \ 202 | "or in $(BUILDDIR)/linkcheck/output.txt." 203 | 204 | .PHONY: doctest 205 | doctest: 206 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 207 | @echo "Testing of doctests in the sources finished, look at the " \ 208 | "results in $(BUILDDIR)/doctest/output.txt." 209 | 210 | .PHONY: coverage 211 | coverage: 212 | $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage 213 | @echo "Testing of coverage in the sources finished, look at the " \ 214 | "results in $(BUILDDIR)/coverage/python.txt." 215 | 216 | .PHONY: apicheck 217 | apicheck: 218 | $(SPHINXBUILD) -b apicheck $(ALLSPHINXOPTS) $(BUILDDIR)/apicheck 219 | 220 | .PHONY: configcheck 221 | configcheck: 222 | $(SPHINXBUILD) -b configcheck $(ALLSPHINXOPTS) $(BUILDDIR)/configcheck 223 | 224 | .PHONY: spelling 225 | spelling: 226 | SPELLCHECK=1 $(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) $(BUILDDIR)/spelling 227 | 228 | .PHONY: xml 229 | xml: 230 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 231 | @echo 232 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 233 | 234 | .PHONY: pseudoxml 235 | pseudoxml: 236 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 237 | @echo 238 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 239 | --------------------------------------------------------------------------------