├── {{cookiecutter.project_name}} ├── MANIFEST.in ├── setup.cfg ├── README.rst ├── pytest.ini ├── environment.yml ├── docs │ ├── source │ │ ├── _static │ │ │ ├── logo.png │ │ │ └── images │ │ │ │ └── logo.svg │ │ ├── api.rst │ │ ├── getting_started.rst │ │ ├── development.rst │ │ ├── index.rst │ │ ├── development │ │ │ ├── publishing.rst │ │ │ ├── getting_started.rst │ │ │ ├── docs.rst │ │ │ └── make.rst │ │ ├── requirements.rst │ │ └── conf.py │ ├── Makefile │ └── make.bat ├── .readthedocs.yml ├── .coveragerc ├── .flake8 ├── {{cookiecutter.package_name}} │ ├── __init__.py │ ├── version.py │ └── cli.py ├── requirements.txt ├── .pip-lic-ignore ├── .gitignore ├── Makefile ├── tests │ ├── test_cli.py │ └── test_example.py ├── README.md ├── setup.py ├── LICENSE └── .pylintrc ├── pytest.ini ├── .flake8 ├── requirements.txt ├── tox.ini ├── .editorconfig ├── hooks ├── pre_gen_project.py └── post_gen_project.py ├── .github └── workflows │ ├── testing.yml │ └── codeql-analysis.yml ├── cookiecutter.json ├── tests ├── test_bare.sh └── test_cookiecutter_generation.py ├── .gitignore ├── README.md └── LICENSE /{{cookiecutter.project_name}}/MANIFEST.in: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description-file = README 3 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/README.rst: -------------------------------------------------------------------------------- 1 | {{cookiecutter.package_name}} 2 | 3 | {{cookiecutter.project_description}} 4 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | filterwarnings = 3 | ignore::DeprecationWarning 4 | ignore::UserWarning 5 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/environment.yml: -------------------------------------------------------------------------------- 1 | name: {{cookiecutter.package_name}} 2 | dependencies: 3 | - python={{cookiecutter.python_version}} 4 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/docs/source/_static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patdaburu/cookiecutter-click/HEAD/{{cookiecutter.project_name}}/docs/source/_static/logo.png -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/.readthedocs.yml: -------------------------------------------------------------------------------- 1 | build: 2 | image: latest 3 | 4 | python: 5 | version: {{cookiecutter.python_version}} 6 | setup_py_install: true 7 | 8 | conda: 9 | file: environment.yml 10 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/.coveragerc: -------------------------------------------------------------------------------- 1 | # .coveragerc to control coverage.py 2 | [run] 3 | omit = 4 | */venv/* 5 | */tests/* 6 | */docs/* 7 | */dist/* 8 | setup.py 9 | scratch*.py 10 | 11 | [html] 12 | directory=./htmlcov 13 | 14 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | addopts = -x --tb=short 3 | python_paths = . 4 | norecursedirs = .tox .git docs venv */{{cookiecutter.project_name}}/* 5 | markers = 6 | black: Run black on all possible template combinations 7 | flake8: Run flake8 on all possible template combinations 8 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/docs/source/api.rst: -------------------------------------------------------------------------------- 1 | .. _api: 2 | 3 | .. toctree:: 4 | :glob: 5 | 6 | API Documentation 7 | ================= 8 | 9 | .. automodule:: {{cookiecutter.package_name}} 10 | :members: 11 | :undoc-members: 12 | :show-inheritance: 13 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | docstring-convention=pep257 3 | ignore = 4 | D400, # If you want to end lines with exclamation marks, why not? 5 | E402, # Ignore import not being at top of test 6 | F631, # Assertion is always true in test_example.py 7 | max-line-length = 160 8 | exclude = 9 | venv, 10 | setup.py 11 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | docstring-convention=pep257 3 | ignore = 4 | D400, # If you want to end lines with exclamation marks, why not? 5 | E402, # Ignore import not being at top of test 6 | F631, # Assertion is always true in test_example.py 7 | max-line-length = 160 8 | exclude = 9 | venv, 10 | setup.py 11 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | # ----------------------- 3 | binaryornot 4 | cookiecutter 5 | sh 6 | 7 | # Code quality 8 | # ----------------------- 9 | black 10 | coverage 11 | flake8 12 | python-coveralls 13 | 14 | # Testing 15 | # ----------------------- 16 | pytest 17 | pytest-cov 18 | pytest_cases 19 | pytest-cookies 20 | pytest-xdist 21 | pyyaml 22 | tox 23 | virtualenv 24 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | {{cookiecutter.project_description}} 6 | 7 | .. currentmodule:: {{cookiecutter.package_name}} 8 | .. moduleauthor:: {{cookiecutter.author_name}} <{{cookiecutter.author_email}}> 9 | """ 10 | 11 | from .version import __version__, __release__ # noqa 12 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | skipsdist = true 3 | envlist = py36,black,flake8 4 | 5 | [testenv] 6 | deps = -rrequirements.txt 7 | commands = pytest -m "not black" -m "not flake8" {posargs:./tests} 8 | 9 | [testenv:black] 10 | deps = -rrequirements.txt 11 | commands = pytest -m black {posargs:./tests} 12 | 13 | [testenv:flake8] 14 | deps = -rrequirements.txt 15 | commands = pytest -m flake8 {posargs:./tests} 16 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/docs/source/getting_started.rst: -------------------------------------------------------------------------------- 1 | .. _getting_started: 2 | 3 | .. toctree:: 4 | :glob: 5 | 6 | *************** 7 | Getting Started 8 | *************** 9 | 10 | Installing the Library 11 | ====================== 12 | 13 | You can use pip to install `{{cookiecutter.package_name}}`. 14 | 15 | .. code-block:: sh 16 | 17 | pip install {{cookiecutter.package_name}} 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/docs/source/development.rst: -------------------------------------------------------------------------------- 1 | .. _development: 2 | 3 | Development 4 | =========== 5 | 6 | .. toctree:: 7 | :maxdepth: 1 8 | :caption: Contents: 9 | 10 | development/getting_started 11 | development/make 12 | development/publishing 13 | development/docs 14 | 15 | 16 | Indices and tables 17 | ================== 18 | 19 | * :ref:`genindex` 20 | * :ref:`modindex` 21 | * :ref:`search` -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.{py, ini}] 12 | indent_style = space 13 | indent_size = 4 14 | 15 | [*.{json, yml}] 16 | indent_style = space 17 | indent_size = 2 18 | 19 | [*.md] 20 | trim_trailing_whitespace = false 21 | 22 | [Makefile] 23 | indent_style = tab 24 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/requirements.txt: -------------------------------------------------------------------------------- 1 | click 2 | pip-check-reqs 3 | pip-licenses 4 | {%- if cookiecutter.linter == 'pylint' %} 5 | pylint 6 | {%- elif cookiecutter.linter == 'flake8' %} 7 | flake8 8 | flake8-docstrings 9 | {%- endif %} 10 | pytest 11 | pytest-cov 12 | pytest-pythonpath 13 | setuptools 14 | Sphinx 15 | {%- if cookiecutter.sphinx_theme == 'readthedocs' %} 16 | sphinx-rtd-theme 17 | {%- endif %} 18 | tox 19 | twine 20 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/version.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | This module contains project version information. 6 | 7 | .. currentmodule:: {{cookiecutter.package_name}}.version 8 | .. moduleauthor:: {{cookiecutter.author_name}} <{{cookiecutter.author_email}}> 9 | """ 10 | 11 | __version__ = "{{cookiecutter.project_version}}" #: the working version 12 | __release__ = "{{cookiecutter.project_version}}" #: the release version 13 | -------------------------------------------------------------------------------- /hooks/pre_gen_project.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | .. currentmodule:: pre_gen_project 6 | .. moduleauthor:: Pat Daburu 7 | 8 | This is the script that runs before template generation. 9 | """ 10 | import re 11 | import sys 12 | 13 | MODULE_REGEX = r"^[_a-zA-Z][_a-zA-Z0-9]+$" 14 | 15 | module_name = "{{ cookiecutter.package_name }}" 16 | 17 | if not re.match(MODULE_REGEX, module_name): 18 | print("ERROR: %s is not a valid Python module name!" % module_name) 19 | 20 | # exits with status 1 to indicate failure 21 | sys.exit(1) 22 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. {{cookiecutter.project_name}} documentation master file 2 | You can adapt this file completely to your liking, but it should at least 3 | contain the root `toctree` directive. 4 | 5 | {{cookiecutter.project_name}} 6 | {% for _ in cookiecutter.project_name %}={% endfor %} 7 | 8 | {{cookiecutter.project_description}} 9 | 10 | .. toctree:: 11 | :maxdepth: 2 12 | :caption: Contents: 13 | 14 | getting_started 15 | api 16 | development 17 | requirements 18 | 19 | 20 | 21 | Indices and tables 22 | ================== 23 | 24 | * :ref:`genindex` 25 | * :ref:`modindex` 26 | * :ref:`search` 27 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/docs/source/development/publishing.rst: -------------------------------------------------------------------------------- 1 | .. _publishing: 2 | 3 | ********************** 4 | Publishing the Package 5 | ********************** 6 | 7 | As you make changes to the project, you'll probably want to publish new version 8 | of the package. *(That's the point, right?)* 9 | 10 | Publishing 11 | ========== 12 | 13 | The actual process of publishing the project is just a matter of running the 14 | :ref:`publish ` target. 15 | 16 | .. code-block:: bash 17 | 18 | make publish 19 | 20 | Installing 21 | ========== 22 | 23 | If you just need to install the library in your project, have a look at 24 | the :ref:`general tutorial ` article. 25 | -------------------------------------------------------------------------------- /hooks/post_gen_project.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | 4 | TERMINATOR = "\x1b[0m" 5 | WARNING = "\x1b[1;33m [WARNING]: " 6 | INFO = "\x1b[1;33m [INFO]: " 7 | HINT = "\x1b[3;33m" 8 | SUCCESS = "\x1b[1;32m [SUCCESS]: " 9 | 10 | def remove_pylintrc_file(): 11 | os.remove(".pylintrc") 12 | 13 | def remove_flake8_file(): 14 | os.remove(".flake8") 15 | 16 | def main(): 17 | linter = "{{ cookiecutter.linter }}".lower() 18 | if linter == "flake8": 19 | remove_pylintrc_file() 20 | if linter == "pylint": 21 | remove_flake8_file() 22 | 23 | print(SUCCESS + "Project initialized, keep up the good work!" + TERMINATOR) 24 | 25 | 26 | if __name__ == "__main__": 27 | main() 28 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/.pip-lic-ignore: -------------------------------------------------------------------------------- 1 | {{cookiecutter.package_name}} 2 | attrs 3 | attrs 4 | certifi 5 | chardet 6 | Babel 7 | Jinja2 8 | MarkupSafe 9 | Pygments 10 | Sphinx 11 | alabaster 12 | astroid 13 | atomicwrites 14 | coverage 15 | docutils 16 | idna 17 | imagesize 18 | isort 19 | lazy-object-proxy 20 | lockfile 21 | mccabe 22 | more-itertools 23 | mock 24 | packaging 25 | parameterized 26 | pbr 27 | pip-check-reqs 28 | pkg-resources 29 | pkginfo 30 | pluggy 31 | py 32 | pylint 33 | pyparsing 34 | pytest 35 | pytest-cov 36 | pytest-pythonpath 37 | python-daemon 38 | pytz 39 | requests 40 | requests-toolbelt 41 | six 42 | snowballstemmer 43 | sphinx-rtd-theme 44 | sphinxcontrib-websupport 45 | tornado 46 | tox tqdm 47 | twine 48 | urllib3 49 | wrapt 50 | virtualenv 51 | -------------------------------------------------------------------------------- /.github/workflows/testing.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: [pull_request] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | strategy: 10 | matrix: 11 | python-version: [3.6, 3.7, 3.8, 3.9] 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Setup Python 16 | uses: actions/setup-python@v2 17 | with: 18 | python-version: ${{ matrix.python-version }} 19 | - name: Install dependencies 20 | run: | 21 | python -m pip install --upgrade pip 22 | pip install -r requirements.txt 23 | - name: Run Tox 24 | run: | 25 | tox -e py 26 | - name: Black 27 | run: | 28 | tox -e black 29 | - name: Flake8 30 | run: | 31 | tox -e flake8 32 | - name: List root dir 33 | run: | 34 | ls -al 35 | -------------------------------------------------------------------------------- /cookiecutter.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_name": "ClickCLI", 3 | "package_name": "{{ cookiecutter.project_name|lower|replace(' ', '_')|replace('-', '_') }}", 4 | "cli_name": "{{ cookiecutter.package_name }}", 5 | "project_version": "0.0.1", 6 | "project_description": "This is my click command-line app project.", 7 | "python_version": [ 8 | "3.6", 9 | "3.7", 10 | "3.8" 11 | ], 12 | "virtualenv": [ 13 | "virtualenv", 14 | "python3" 15 | ], 16 | "linter": [ 17 | "flake8", 18 | "pylint" 19 | ], 20 | "sphinx_theme": [ 21 | "alabaster", 22 | "readthedocs" 23 | ], 24 | "auto_readme": [ 25 | "None", 26 | "pandoc" 27 | ], 28 | "author_name": "my_name", 29 | "author_email": "my_email@gmail.com", 30 | "license": [ 31 | "MIT", 32 | "BSD", 33 | "GPLv3", 34 | "Apache Software License 2.0", 35 | "None" 36 | ], 37 | "github_user": "my_github_username" 38 | } 39 | -------------------------------------------------------------------------------- /tests/test_bare.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Tests the default configuration for cookiecutter-click 4 | # Run from the root directory of the repository 5 | # eg: ./tests/test_bard.sh 6 | # 7 | 8 | set -o errexit 9 | 10 | # helper function 11 | install_python_deps() { 12 | pip install --use-feature=2020-resolver \ 13 | --user \ 14 | --requirement requirements.txt 15 | } 16 | 17 | # make clean python env 18 | pip install virtualenv 19 | python --module virtualenv venv 20 | source venv/bin/activate 21 | 22 | # install test deps 23 | install_python_deps 24 | 25 | # create project using cookiecutter.json default values 26 | cookiecutter --no-input \ 27 | --overwrite-if-exists use_docker=n \ 28 | $@ 29 | cd my_awesome_project 30 | 31 | # install project python deps 32 | install_python_deps 33 | 34 | # Output project for sanity 35 | ls -alt 36 | 37 | # run tests 38 | pytest 39 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/docs/source/development/getting_started.rst: -------------------------------------------------------------------------------- 1 | .. _getting_started_dev: 2 | 3 | .. toctree:: 4 | :glob: 5 | 6 | *************** 7 | Getting Started 8 | *************** 9 | 10 | This section provides instructions for setting up your development environment. If you follow the 11 | steps from top to bottom you should be ready to roll by the end. 12 | 13 | 14 | Get the Source 15 | ============== 16 | 17 | The source code for the `{{cookiecutter.project_name}}` project lives at 18 | `github `_. 19 | You can use `git clone` to get it. 20 | 21 | .. code-block:: bash 22 | 23 | git clone https://github.com/patdaburu/bnrml 24 | 25 | Create the Virtual Environment 26 | ============================== 27 | 28 | You can create a virtual environment and install the project's dependencies using :ref:`make `. 29 | 30 | .. code-block:: bash 31 | 32 | make venv 33 | make install 34 | source venv/bin/activate 35 | 36 | Try It Out 37 | ========== 38 | 39 | One way to test out the environment is to run the tests. You can do this with the `make test` 40 | target. 41 | 42 | .. code-block:: bash 43 | 44 | make test 45 | 46 | If the tests run and pass, you're ready to roll. 47 | 48 | Getting Answers 49 | =============== 50 | 51 | Once the environment is set up, you can perform a quick build of this project 52 | documentation using the `make answers` target. 53 | 54 | .. code-block:: bash 55 | 56 | make answers 57 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/docs/source/development/docs.rst: -------------------------------------------------------------------------------- 1 | .. _docs: 2 | 3 | .. toctree:: 4 | :glob: 5 | 6 | ************************** 7 | Building the Documentation 8 | ************************** 9 | 10 | Sphinx 11 | ------ 12 | 13 | The documentation in this project is generated by 14 | `Sphinx `_ 15 | from `reStructuredTex `_. 16 | 17 | Ubuntu/Debian 18 | ------------- 19 | 20 | This project started on `Ubuntu Linux 18.04 `_. 21 | That doesn't mean you can't use another distribution, or even another operating 22 | system, but you may need to perform some additional setup steps to get your 23 | builds working. (If you do get it working under another system, please consider 24 | adding an article to let others know how you did it!) 25 | 26 | Prerequisites 27 | ^^^^^^^^^^^^^ 28 | 29 | The project uses the Sphinx 30 | `LatexBuilder `_ 31 | to generate a `PDF `_ 32 | document. If you're using Ubuntu (or Debian) you'll need to install 33 | `texlive `_ and 34 | `latexmk `_. 35 | 36 | .. code-block:: bash 37 | 38 | sudo apt-get install texlive-latex-recommended \ 39 | texlive-latex-extra \ 40 | texlive-fonts-recommended \ 41 | latexmk 42 | 43 | make 44 | ---- 45 | 46 | Once everything is in place, you can build the documentation using the 47 | :ref:`make docs ` the target defined in the project's 48 | :ref:`Makefile `. 49 | 50 | .. code-block:: 51 | 52 | make docs -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | # The branches below must be a subset of the branches above 8 | branches: [ master ] 9 | schedule: 10 | - cron: '38 4 * * 4' 11 | 12 | jobs: 13 | analyze: 14 | name: Analyze 15 | runs-on: ubuntu-latest 16 | 17 | strategy: 18 | fail-fast: false 19 | matrix: 20 | language: [ 'python' ] 21 | 22 | steps: 23 | - name: Checkout repository 24 | uses: actions/checkout@v2 25 | 26 | # Initializes the CodeQL tools for scanning. 27 | - name: Initialize CodeQL 28 | uses: github/codeql-action/init@v1 29 | with: 30 | languages: ${{ matrix.language }} 31 | # If you wish to specify custom queries, you can do so here or in a config file. 32 | # By default, queries listed here will override any specified in a config file. 33 | # Prefix the list here with "+" to use these queries and those in the config file. 34 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 35 | 36 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 37 | # If this step fails, then you should remove it and run the build manually (see below) 38 | - name: Autobuild 39 | uses: github/codeql-action/autobuild@v1 40 | 41 | # ℹ️ Command-line programs to run using the OS shell. 42 | # 📚 https://git.io/JvXDl 43 | 44 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 45 | # and modify them (or add more) to build your code if your project 46 | # uses a compiled language 47 | 48 | #- run: | 49 | # make bootstrap 50 | # make release 51 | 52 | - name: Perform CodeQL Analysis 53 | uses: github/codeql-action/analyze@v1 54 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | 58 | # Flask stuff: 59 | instance/ 60 | .webassets-cache 61 | 62 | # Scrapy stuff: 63 | .scrapy 64 | 65 | # Sphinx documentation 66 | docs/_build/ 67 | docs/build 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # dotenv 85 | .env 86 | 87 | # virtualenv 88 | .venv 89 | venv/ 90 | ENV/ 91 | 92 | # Spyder project settings 93 | .spyderproject 94 | .spyproject 95 | 96 | # Rope project settings 97 | .ropeproject 98 | 99 | # mkdocs documentation 100 | /site 101 | 102 | # mypy 103 | .mypy_cache/ 104 | 105 | # JetBrains 106 | .idea 107 | 108 | # VS Code settings 109 | .vscode 110 | 111 | # MacOS 112 | .DS_Store -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | 58 | # Flask stuff: 59 | instance/ 60 | .webassets-cache 61 | 62 | # Scrapy stuff: 63 | .scrapy 64 | 65 | # Sphinx documentation 66 | docs/_build/ 67 | docs/build 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # dotenv 85 | .env 86 | 87 | # virtualenv 88 | .venv 89 | venv/ 90 | ENV/ 91 | 92 | # Spyder project settings 93 | .spyderproject 94 | .spyproject 95 | 96 | # Rope project settings 97 | .ropeproject 98 | 99 | # mkdocs documentation 100 | /site 101 | 102 | # mypy 103 | .mypy_cache/ 104 | 105 | # JetBrains 106 | .idea 107 | 108 | # MacOS 109 | .DS_Store 110 | 111 | # VS Code settings 112 | .vscode 113 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/Makefile: -------------------------------------------------------------------------------- 1 | .DEFAULT_GOAL := build 2 | .PHONY: build publish package coverage test lint docs venv 3 | PROJ_SLUG = {{cookiecutter.package_name}} 4 | CLI_NAME = {{cookiecutter.cli_name}} 5 | PY_VERSION = {{cookiecutter.python_version}} 6 | LINTER = {{cookiecutter.linter}} 7 | {% if cookiecutter.virtualenv == 'python3' %} 8 | SHELL = bash 9 | {% endif %} 10 | 11 | 12 | build: 13 | pip install --editable . 14 | 15 | run: 16 | $(CLI_NAME) run 17 | 18 | submit: 19 | $(CLI_NAME) submit 20 | 21 | freeze: 22 | pip freeze > requirements.txt 23 | 24 | lint: 25 | $(LINTER) $(PROJ_SLUG) 26 | 27 | test: lint 28 | py.test --cov-report term --cov=$(PROJ_SLUG) tests/ 29 | 30 | quicktest: 31 | py.test --cov-report term --cov=$(PROJ_SLUG) tests/ 32 | 33 | coverage: lint 34 | py.test --cov-report html --cov=$(PROJ_SLUG) tests/ 35 | 36 | docs: coverage 37 | mkdir -p docs/source/_static 38 | mkdir -p docs/source/_templates 39 | cd docs && $(MAKE) html 40 | {% if cookiecutter.auto_readme == 'pandoc' %}pandoc --from=markdown --to=rst --output=README.rst README.md{% endif %} 41 | 42 | answers: 43 | cd docs && $(MAKE) html 44 | xdg-open docs/build/html/index.html 45 | 46 | package: clean docs 47 | python setup.py sdist 48 | 49 | publish: package 50 | twine upload dist/* 51 | 52 | clean : 53 | rm -rf dist \ 54 | rm -rf docs/build \ 55 | rm -rf *.egg-info 56 | coverage erase 57 | 58 | venv : 59 | {% if cookiecutter.virtualenv == 'virtualenv' %} 60 | virtualenv --python python$(PY_VERSION) venv 61 | {% endif %} 62 | {% if cookiecutter.virtualenv == 'python3' %} 63 | python3 -m venv venv 64 | source venv/bin/activate && pip install pip --upgrade --index-url=https://pypi.org/simple 65 | {% endif %} 66 | 67 | install: 68 | pip install -r requirements.txt 69 | 70 | licenses: 71 | pip-licenses --with-url --format=rst \ 72 | --ignore-packages $(shell cat .pip-lic-ignore | awk '{$$1=$$1};1') 73 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/tests/test_cli.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | .. currentmodule:: test_cli 6 | .. moduleauthor:: {{cookiecutter.author_name}} <{{cookiecutter.author_email}}> 7 | 8 | This is the test module for the project's command-line interface (CLI) 9 | module. 10 | """ 11 | # fmt: off 12 | import {{cookiecutter.package_name}}.cli as cli 13 | from {{cookiecutter.package_name}} import __version__ 14 | # fmt: on 15 | from click.testing import CliRunner, Result 16 | 17 | 18 | # To learn more about testing Click applications, visit the link below. 19 | # http://click.pocoo.org/5/testing/ 20 | 21 | 22 | def test_version_displays_library_version(): 23 | """ 24 | Arrange/Act: Run the `version` subcommand. 25 | Assert: The output matches the library version. 26 | """ 27 | runner: CliRunner = CliRunner() 28 | result: Result = runner.invoke(cli.cli, ["version"]) 29 | assert ( 30 | __version__ in result.output.strip() 31 | ), "Version number should match library version." 32 | 33 | 34 | def test_verbose_output(): 35 | """ 36 | Arrange/Act: Run the `version` subcommand with the '-v' flag. 37 | Assert: The output indicates verbose logging is enabled. 38 | """ 39 | runner: CliRunner = CliRunner() 40 | result: Result = runner.invoke(cli.cli, ["-v", "version"]) 41 | assert ( 42 | "Verbose" in result.output.strip() 43 | ), "Verbose logging should be indicated in output." 44 | 45 | 46 | def test_hello_displays_expected_message(): 47 | """ 48 | Arrange/Act: Run the `version` subcommand. 49 | Assert: The output matches the library version. 50 | """ 51 | runner: CliRunner = CliRunner() 52 | result: Result = runner.invoke(cli.cli, ["hello"]) 53 | # fmt: off 54 | assert '{{cookiecutter.cli_name}}' in result.output.strip(), \ 55 | "'Hello' messages should contain the CLI name." 56 | # fmt: on 57 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/tests/test_example.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | .. currentmodule:: test_example 6 | .. moduleauthor:: {{cookiecutter.author_name}} <{{cookiecutter.author_email}}> 7 | 8 | This is a sample test module. 9 | """ 10 | 11 | import pytest 12 | 13 | """ 14 | This is just an example test suite. It will check the current project version 15 | numbers against the original version numbers and will start failing as soon as 16 | the current version numbers change. 17 | """ 18 | 19 | 20 | def test_import_getVersions_originalVersions(): 21 | """ 22 | Arrange: Load the primary module. 23 | Act: Retrieve the versions. 24 | Assert: Versions match the version numbers at the time of project creation. 25 | """ 26 | assert ( 27 | # fmt: off 28 | # '0.0.1' == {{cookiecutter.package_name}}.__version__, 29 | # fmt: on 30 | "This test is expected to fail when the version increments. " 31 | "It is here only as an example and you can remove it." 32 | ) 33 | 34 | """ 35 | This is just an example test suite that demonstrates the very useful 36 | `parameterized` module. It contains a test in which the squares of the 37 | first two parameters are added together and passes if that sum equals the 38 | third parameter. 39 | """ 40 | 41 | 42 | @pytest.mark.parametrize("a,b,c", [(1, 2, 5), (3, 4, 25)]) 43 | def test_ab_addSquares_equalsC(a, b, c): 44 | """ 45 | Arrange: Acquire the first two parameters (a and b). 46 | Act: Add the squares of the first two parameters (a and b). 47 | Assert: The sum of the squares equals the third parameter (c). 48 | 49 | :param a: the first parameter 50 | :param b: the second parameter 51 | :param c: the result of adding the squares of a and b 52 | """ 53 | assert ( 54 | a * a + b * b == c, 55 | "'c' should be the sum of the squares of 'a' and 'b'. " 56 | "This is an example test and can be removed.", 57 | ) 58 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/docs/source/development/make.rst: -------------------------------------------------------------------------------- 1 | .. _make: 2 | 3 | .. toctree:: 4 | :glob: 5 | 6 | .. _using-the-makefile: 7 | 8 | Using the `Makefile` 9 | ==================== 10 | 11 | This project includes a `Makefile `_ 12 | that you can use to perform common tasks such as running tests and building 13 | documentation. 14 | 15 | Targets 16 | ------- 17 | 18 | This section contains a brief description of the targets defined in the 19 | ``Makefile``. 20 | 21 | ``clean`` 22 | ^^^^^^^^^ 23 | 24 | Remove generated packages, documentation, temporary files, *etc*. 25 | 26 | .. _make_lint: 27 | 28 | ``lint`` 29 | ^^^^^^^^ 30 | 31 | Run `pylint `_ against the project files. 32 | 33 | .. _make_test: 34 | 35 | ``test`` 36 | ^^^^^^^^ 37 | 38 | Run the unit tests. 39 | 40 | ``quicktest`` 41 | ^^^^^^^^^^^^^ 42 | 43 | Run the unit tests without performing pre-test validations (like 44 | :ref:`linting `). 45 | 46 | .. _make_docs: 47 | 48 | ``docs`` 49 | ^^^^^^^^ 50 | 51 | Build the documentation for production. 52 | 53 | .. note:: 54 | 55 | You can also build the documents directly, bypassing validations like 56 | :ref:`linting ` and :ref:`testing ` using 57 | `Sphinx Makefile `_ 58 | directly. 59 | 60 | .. code-block:: bash 61 | 62 | cd docs 63 | make clean && make html 64 | make latexpdf 65 | 66 | .. _make_answers: 67 | 68 | ``answers`` 69 | ^^^^^^^^^^^ 70 | 71 | Perform a quick build of the documentation and open it in your browser. 72 | 73 | ``package`` 74 | ^^^^^^^^^^^ 75 | 76 | Build the package for publishing. 77 | 78 | .. _make-publish: 79 | 80 | ``publish`` 81 | ^^^^^^^^^^^ 82 | 83 | Publish the package to your repository. 84 | 85 | ``build`` 86 | ^^^^^^^^^ 87 | 88 | Install the current project locally so that you may run the command-line application. 89 | 90 | ``venv`` 91 | ^^^^^^^^ 92 | 93 | Create a virtual environment. 94 | 95 | ``install`` 96 | ^^^^^^^^^^^ 97 | 98 | Install (or update) project dependencies. 99 | 100 | ``licenses`` 101 | ^^^^^^^^^^^^ 102 | 103 | Generate a report of the projects dependencies and respective licenses. 104 | 105 | .. note:: 106 | 107 | If project dependencies change, please update this documentation. 108 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/cli.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | This is the entry point for the command-line interface (CLI) application. 6 | 7 | It can be used as a handy facility for running the task from a command line. 8 | 9 | .. note:: 10 | 11 | To learn more about Click visit the 12 | `project website `_. There is also a very 13 | helpful `tutorial video `_. 14 | 15 | To learn more about running Luigi, visit the Luigi project's 16 | `Read-The-Docs `_ page. 17 | 18 | .. currentmodule:: {{cookiecutter.package_name}}.cli 19 | .. moduleauthor:: {{cookiecutter.author_name}} <{{cookiecutter.author_email}}> 20 | """ 21 | import logging 22 | import click 23 | from .__init__ import __version__ 24 | 25 | LOGGING_LEVELS = { 26 | 0: logging.NOTSET, 27 | 1: logging.ERROR, 28 | 2: logging.WARN, 29 | 3: logging.INFO, 30 | 4: logging.DEBUG, 31 | } #: a mapping of `verbose` option counts to logging levels 32 | 33 | 34 | class Info(object): 35 | """An information object to pass data between CLI functions.""" 36 | 37 | def __init__(self): # Note: This object must have an empty constructor. 38 | """Create a new instance.""" 39 | self.verbose: int = 0 40 | 41 | 42 | # pass_info is a decorator for functions that pass 'Info' objects. 43 | #: pylint: disable=invalid-name 44 | pass_info = click.make_pass_decorator(Info, ensure=True) 45 | 46 | 47 | # Change the options to below to suit the actual options for your task (or 48 | # tasks). 49 | @click.group() 50 | @click.option("--verbose", "-v", count=True, help="Enable verbose output.") 51 | @pass_info 52 | def cli(info: Info, verbose: int): 53 | """Run {{cookiecutter.cli_name}}.""" 54 | # Use the verbosity count to determine the logging level... 55 | if verbose > 0: 56 | logging.basicConfig( 57 | level=LOGGING_LEVELS[verbose] 58 | if verbose in LOGGING_LEVELS 59 | else logging.DEBUG 60 | ) 61 | click.echo( 62 | click.style( 63 | f"Verbose logging is enabled. " 64 | f"(LEVEL={logging.getLogger().getEffectiveLevel()})", 65 | fg="yellow", 66 | ) 67 | ) 68 | info.verbose = verbose 69 | 70 | 71 | @cli.command() 72 | @pass_info 73 | def hello(_: Info): 74 | """Say 'hello' to the nice people.""" 75 | click.echo("{{cookiecutter.cli_name}} says 'hello'") 76 | 77 | 78 | @cli.command() 79 | def version(): 80 | """Get the library version.""" 81 | click.echo(click.style(f"{__version__}", bold=True)) 82 | -------------------------------------------------------------------------------- /tests/test_cookiecutter_generation.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | 4 | import pytest 5 | import sh 6 | from binaryornot.check import is_binary 7 | 8 | PATTERN = r"{{(\s?cookiecutter)[.](.*?)}}" 9 | RE_OBJ = re.compile(PATTERN) 10 | 11 | 12 | @pytest.fixture 13 | def context(): 14 | return { 15 | "project_name": "my_click_project", 16 | "package_name": "click_project", 17 | "cli_name": "click_project", 18 | "project_version": "0.0.1", 19 | "project_description": "A click command-line app.", 20 | "python_version": "3.6", 21 | "sphinx_theme": "alabaster", 22 | "author_name": "my_name", 23 | "author_email": "my_email@gmail.com", 24 | "license": "MIT", 25 | "github_user": "my_github_username", 26 | } 27 | 28 | 29 | def build_files_list(root_dir): 30 | """Build a list containing absolute paths to the generated files.""" 31 | return [ 32 | os.path.join(dirpath, file_path) 33 | for dirpath, subdirs, files in os.walk(root_dir) 34 | for file_path in files 35 | ] 36 | 37 | 38 | def check_paths(paths): 39 | """Method to check all paths have correct substitutions, 40 | used by other tests cases 41 | """ 42 | # Assert that no match is found in any of the files 43 | for path in paths: 44 | if is_binary(path): 45 | continue 46 | 47 | for line in open(path, "rb"): 48 | match = RE_OBJ.search(str(line)) 49 | msg = "cookiecutter variable not replaced in {}" 50 | assert match is None, msg.format(path) 51 | 52 | 53 | def test_project_generation(cookies, context): 54 | """ 55 | Test that project is generated and fully rendered. 56 | """ 57 | result = cookies.bake(context) 58 | assert result.exit_code == 0 59 | assert result.exception is None 60 | assert result.project.basename == context["project_name"] 61 | assert result.project.isdir() 62 | paths = build_files_list(str(result.project)) 63 | assert paths 64 | check_paths(paths) 65 | 66 | 67 | @pytest.mark.black 68 | def test_black_passes(cookies): 69 | """ 70 | Generated project should pass black. 71 | """ 72 | result = cookies.bake() 73 | 74 | try: 75 | sh.black( 76 | "--verbose", 77 | "--check", 78 | "--diff", 79 | "--exclude", 80 | "venv|docs/source/conf.py|setup.py", 81 | str(result.project), 82 | ) 83 | except sh.ErrorReturnCode as e: 84 | pytest.fail(e) 85 | 86 | 87 | @pytest.mark.flake8 88 | def test_flake8_passes(cookies, context): 89 | """ 90 | Generated project should pass flake8. 91 | """ 92 | result = cookies.bake() 93 | 94 | try: 95 | sh.flake8("--config=.flake8", str(result.project)) 96 | except sh.ErrorReturnCode as e: 97 | pytest.fail(e) 98 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/docs/source/_static/images/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 19 | 20 | 21 | 22 | 23 | 24 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/docs/source/requirements.rst: -------------------------------------------------------------------------------- 1 | .. _dependencies: 2 | 3 | ************ 4 | Dependencies 5 | ************ 6 | 7 | The ``requirements.txt`` file contains this project's module dependencies. 8 | You can install these dependencies using ``pip``. 9 | 10 | .. code-block:: bash 11 | 12 | pip install -r requirements.txt 13 | 14 | .. _requirements-txt: 15 | 16 | requirements.txt 17 | ================ 18 | 19 | .. literalinclude:: ../../requirements.txt 20 | 21 | Runtime Dependencies and Licenses 22 | ================================= 23 | 24 | +--------------------+---------+--------------------------------------+---------------------------------------------------+ 25 | | Name | Version | License | URL | 26 | +--------------------+---------+--------------------------------------+---------------------------------------------------+ 27 | | Click | 7.0 | BSD | https://palletsprojects.com/p/click/ | 28 | +--------------------+---------+--------------------------------------+---------------------------------------------------+ 29 | | bleach | 3.1.0 | Apache Software License | https://github.com/mozilla/bleach | 30 | +--------------------+---------+--------------------------------------+---------------------------------------------------+ 31 | | filelock | 3.0.12 | Public Domain | https://github.com/benediktschmitt/py-filelock | 32 | +--------------------+---------+--------------------------------------+---------------------------------------------------+ 33 | | frozenordereddict | 1.2.0 | MIT | https://github.com/wsmith323/frozenordereddict | 34 | +--------------------+---------+--------------------------------------+---------------------------------------------------+ 35 | | importlib-metadata | 0.18 | Apache Software License | http://importlib-metadata.readthedocs.io/ | 36 | +--------------------+---------+--------------------------------------+---------------------------------------------------+ 37 | | readme-renderer | 24.0 | Apache License, Version 2.0 | https://github.com/pypa/readme_renderer | 38 | +--------------------+---------+--------------------------------------+---------------------------------------------------+ 39 | | toml | 0.10.0 | MIT | https://github.com/uiri/toml | 40 | +--------------------+---------+--------------------------------------+---------------------------------------------------+ 41 | | webencodings | 0.5.1 | BSD | https://github.com/SimonSapin/python-webencodings | 42 | +--------------------+---------+--------------------------------------+---------------------------------------------------+ 43 | | zipp | 0.5.1 | UNKNOWN | https://github.com/jaraco/zipp | 44 | +--------------------+---------+--------------------------------------+---------------------------------------------------+ 45 | 46 | 47 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/README.md: -------------------------------------------------------------------------------- 1 | # {{cookiecutter.package_name}} 2 | 3 | {{cookiecutter.project_description}} 4 | 5 | ## Project Features 6 | 7 | * [{{cookiecutter.package_name}}](http://{{cookiecutter.project_name}}.readthedocs.io/) 8 | * a starter [Click](http://click.pocoo.org/5/) command-line application 9 | * automated unit tests you can run with [pytest](https://docs.pytest.org/en/latest/) 10 | * a [Sphinx](http://www.sphinx-doc.org/en/master/) documentation project 11 | 12 | ## Getting Started 13 | 14 | The project's documentation contains a section to help you 15 | [get started](https://{{cookiecutter.project_name}}.readthedocs.io/en/latest/getting_started.html) as a developer or 16 | user of the library. 17 | 18 | ## Development Prerequisites 19 | 20 | If you're going to be working in the code (rather than just using the library), you'll want a few utilities. 21 | 22 | * [GNU Make](https://www.gnu.org/software/make/) 23 | * [Pandoc](https://pandoc.org/) 24 | 25 | ## Resources 26 | 27 | Below are some handy resource links. 28 | 29 | * [Project Documentation](http://{{cookiecutter.project_name}}.readthedocs.io/) 30 | * [Click](http://click.pocoo.org/5/) is a Python package for creating beautiful command line interfaces in a composable way with as little code as necessary. 31 | * [Sphinx](http://www.sphinx-doc.org/en/master/) is a tool that makes it easy to create intelligent and beautiful documentation, written by Geog Brandl and licnsed under the BSD license. 32 | * [pytest](https://docs.pytest.org/en/latest/) helps you write better programs. 33 | * [GNU Make](https://www.gnu.org/software/make/) is a tool which controls the generation of executables and other non-source files of a program from the program's source files. 34 | 35 | 36 | ## Authors 37 | 38 | * **{{cookiecutter.author_name}}** - *Initial work* - [github](https://github.com/{{cookiecutter.github_user}}) 39 | 40 | See also the list of [contributors](https://github.com/{{cookiecutter.github_user}}/{{cookiecutter.package_name}}/contributors) who participated in this project. 41 | 42 | ## License 43 | 44 | {%- if cookiecutter.license == "MIT" -%} 45 | MIT License 46 | 47 | Copyright (c) {{cookiecutter.github_user}} 48 | 49 | Permission is hereby granted, free of charge, to any person obtaining a copy 50 | of this software and associated documentation files (the "Software"), to deal 51 | in the Software without restriction, including without limitation the rights 52 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 53 | copies of the Software, and to permit persons to whom the Software is 54 | furnished to do so, subject to the following conditions: 55 | 56 | The above copyright notice and this permission notice shall be included in all 57 | copies or substantial portions of the Software. 58 | 59 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 60 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 61 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 62 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 63 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 64 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 65 | SOFTWARE. 66 | {%- else -%} 67 | Copyright (c) {{cookiecutter.author_name}} 68 | 69 | All rights reserved. 70 | {%- endif -%} 71 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | This file is used to create the package we'll publish to PyPI. 6 | 7 | .. currentmodule:: setup.py 8 | .. moduleauthor:: {{cookiecutter.author_name}} <{{cookiecutter.author_email}}> 9 | """ 10 | 11 | import importlib.util 12 | import os 13 | from pathlib import Path 14 | from setuptools import setup, find_packages 15 | from codecs import open # Use a consistent encoding. 16 | from os import path 17 | 18 | here = path.abspath(path.dirname(__file__)) 19 | 20 | # Get the long description from the relevant file 21 | with open(path.join(here, "README.rst"), encoding="utf-8") as f: 22 | long_description = f.read() 23 | 24 | # Get the base version from the library. (We'll find it in the `version.py` 25 | # file in the src directory, but we'll bypass actually loading up the library.) 26 | vspec = importlib.util.spec_from_file_location( 27 | "version", 28 | str(Path(__file__).resolve().parent / 29 | "{{cookiecutter.package_name}}"/"version.py") 30 | ) 31 | vmod = importlib.util.module_from_spec(vspec) 32 | vspec.loader.exec_module(vmod) 33 | version = getattr(vmod, "__version__") 34 | 35 | # If the environment has a build number set... 36 | if os.getenv("buildnum") is not None: 37 | # ...append it to the version. 38 | version = f"{version}.{os.getenv('buildnum')}" 39 | 40 | setup( 41 | name='{{cookiecutter.project_name}}', 42 | description="{{cookiecutter.project_description}}", 43 | long_description=long_description, 44 | packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), 45 | version=version, 46 | install_requires=[ 47 | # Include dependencies here 48 | "click>=7.0,<8" 49 | ], 50 | entry_points=""" 51 | [console_scripts] 52 | {{cookiecutter.cli_name}}={{cookiecutter.package_name}}.cli:cli 53 | """, 54 | python_requires=">={{cookiecutter.project_version}}", 55 | license={% if cookiecutter.license != "None" %}'{{cookiecutter.license}}'{% else %}None{% endif %}, # noqa 56 | author='{{cookiecutter.author_name}}', 57 | author_email='{{cookiecutter.author_email}}', 58 | # Use the URL to the github repo. 59 | url= 'https://github.com/{{cookiecutter.github_user}}/{{cookiecutter.package_name}}', 60 | download_url=( 61 | f'https://github.com/{{cookiecutter.github_user}}/' 62 | f'{{cookiecutter.package_name}}/archive/{version}.tar.gz' 63 | ), 64 | keywords=[ 65 | # Add package keywords here. 66 | ], 67 | # See https://PyPI.python.org/PyPI?%3Aaction=list_classifiers 68 | classifiers=[ 69 | # How mature is this project? Common values are 70 | # 3 - Alpha 71 | # 4 - Beta 72 | # 5 - Production/Stable 73 | "Development Status :: 3 - Alpha", 74 | 75 | # Indicate who your project is intended for. 76 | "Intended Audience :: Developers", 77 | "Topic :: Software Development :: Libraries", 78 | 79 | # Pick your license. (It should match "license" above.) 80 | {% if cookiecutter.license != 'None' %} # noqa 81 | """License :: OSI Approved :: {{cookiecutter.license}} License""", 82 | {% else %} 83 | """License :: OSI Approved :: """, # noqa 84 | {%endif%} # noqa 85 | # Specify the Python versions you support here. In particular, ensure 86 | # that you indicate whether you support Python 2, Python 3 or both. 87 | "Programming Language :: Python :: {{cookiecutter.python_version}}", 88 | ], 89 | include_package_data=True 90 | ) 91 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/LICENSE: -------------------------------------------------------------------------------- 1 | {% if cookiecutter.license == 'MIT' %} 2 | The MIT License (MIT) 3 | Copyright (c) {% now 'utc', '%Y' %}, {{ cookiecutter.author_name }} 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | {% elif cookiecutter.license == 'BSD' %} 11 | Copyright (c) {% now 'utc', '%Y' %}, {{ cookiecutter.author_name }} 12 | All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without modification, 15 | are permitted provided that the following conditions are met: 16 | 17 | * Redistributions of source code must retain the above copyright notice, this 18 | list of conditions and the following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above copyright notice, this 21 | list of conditions and the following disclaimer in the documentation and/or 22 | other materials provided with the distribution. 23 | 24 | * Neither the name of {{ cookiecutter.project_name }} nor the names of its 25 | contributors may be used to endorse or promote products derived from this 26 | software without specific prior written permission. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 29 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 31 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 32 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 35 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 36 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 37 | OF THE POSSIBILITY OF SUCH DAMAGE. 38 | {% elif cookiecutter.license == 'GPLv3' %} 39 | Copyright (c) {% now 'utc', '%Y' %}, {{ cookiecutter.author_name }} 40 | 41 | This program is free software: you can redistribute it and/or modify 42 | it under the terms of the GNU General Public License as published by 43 | the Free Software Foundation, either version 3 of the License, or 44 | (at your option) any later version. 45 | 46 | This program is distributed in the hope that it will be useful, 47 | but WITHOUT ANY WARRANTY; without even the implied warranty of 48 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 49 | GNU General Public License for more details. 50 | 51 | You should have received a copy of the GNU General Public License 52 | along with this program. If not, see . 53 | {%- else -%} 54 | Copyright (c) {{cookiecutter.author_name}} 55 | 56 | All righs reserved. 57 | {%- endif -%} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cookiecutter Click 2 | 3 | ![](https://github.com/patdaburu/cookiecutter-click/workflows/Build/badge.svg) 4 | [![Code style: 5 | black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black) 6 | 7 | ## Powered by [Cookiecutter](https://cookiecutter.readthedocs.io/en/latest/), Cookiecutter Click generates boilerplate for production-ready [command-line interface (CLI)](http://click.pocoo.org/5/) applications. 8 | 9 | ## Features 10 | 11 | The project you create from this template has a few features to be aware of 12 | including: 13 | 14 | * A [Click](http://click.pocoo.org/5/) application to get you going 15 | * [Pytest](https://docs.pytest.org/en/latest/) unit tests 16 | * A documentation project based on 17 | [Sphinx](http://www.sphinx-doc.org/en/master/usage/quickstart.html). 18 | 19 | ## Usage 20 | 21 | Let's pretend you want to create a CLI tool called "redditcli". Rather than 22 | using standard lib argparse and then editing mundane details to include your 23 | basic cli tool configuration that always get forgotten until the worst possible 24 | moment, get cookiecutter to do all the work. 25 | 26 | First, get Cookiecutter. Trust me, it's awesome: 27 | 28 | ``` bash 29 | pip install "cookiecutter>=1.4.0"` 30 | ``` 31 | 32 | Now run it against this repo: 33 | 34 | ``` bash 35 | cookiecutter https://github.com/patdaburu/cookiecutter-click 36 | ``` 37 | 38 | You'll be prompted for some values. Provide them, then a cli tool will be 39 | created for you. 40 | 41 | Warning: After this point, change 'Vlad Doster', 'vladdoster', etc to your own 42 | information. 43 | 44 | Answer the prompts with your own desired options. For example: 45 | 46 | ``` bash 47 | Cloning into 'cookiecutter-click'... 48 | remote: Counting objects: 550, done. 49 | remote: Compressing objects: 100% (310/310), done. 50 | remote: Total 550 (delta 283), reused 479 (delta 222) 51 | Receiving objects: 100% (550/550), 127.66 KiB | 58 KiB/s, done. 52 | Resolving deltas: 100% (283/283), done. 53 | project_name [my-click-project]: Reddit CLI 54 | package_name [my-click-project]: reddit_cli 55 | cli_name [my_click_project]: reddit-cli 56 | project_version [0.0.1]: 0.0.1 57 | project_description [This is my click command-line app]: Browse Reddit from a cli tool! 58 | Select python_version: 59 | 1 - 3.6 60 | 2 - 3.7 61 | 3 - 3.8 62 | Choose from 1, 2, 3 (1, 2, 3) [1]: 1 63 | Select virtualenv: 64 | 1 - virtualenv 65 | 2 - python3 66 | Choose from 1, 2 (1, 2) [1]: 1 67 | Select linter: 68 | 1 - flake8 69 | 2 - pylint 70 | Choose from 1, 2 (1, 2) [1]: 71 | Select sphinx_theme: 72 | 1 - alabaster 73 | 2 - readthedocs 74 | Choose from 1, 2 (1, 2) [1]: 1 75 | Select auto_readme: 76 | 1 - None 77 | 2 - pandoc 78 | Choose from 1, 2 (1, 2) [1]: 1 79 | author_name [my_name]: Vlad Doster 80 | author_email [my_email]: mvdoster@gmail.com 81 | Select license: 82 | 1 - MIT 83 | 2 - BSD 84 | 3 - GPLv3 85 | 4 - Apache Software License 2.0 86 | 5 - None 87 | Choose from 1, 2, 3, 4, 5 (1, 2, 3, 4, 5) [1]: 1 88 | github_user [my_github_user]: vladdoster 89 | ``` 90 | 91 | Enter the project and take a look around: 92 | 93 | ``` bash 94 | cd reddit_cli/ 95 | source venv/bin/activate 96 | reddit_cli --help 97 | ls -a 98 | ``` 99 | 100 | Create a git repo and push it there: 101 | 102 | ``` bash 103 | git init 104 | git add . 105 | git commit -m "first awesome commit" 106 | git remote add origin git@github.com:vladdoster/reddit_cli.git 107 | git push -u origin master 108 | ``` 109 | 110 | ## `make` Targets 111 | 112 | The template contains a cookiecutter [post-generate 113 | hook](http://cookiecutter.readthedocs.io/en/latest/advanced/hooks.html) that 114 | will attempt to do the following using targets in the project's 115 | [Makefile](https://www.gnu.org/software/make/): 116 | 117 | You may want to go about this differently according to your processes, but if 118 | you want to create a virtual environment for the project, install the 119 | dependencies, and set up the comman-line application, you can use the `make` 120 | targets defined in the project like so. 121 | 122 | There are several other `make` targets so have a look at the `Makefile` if 123 | you're interested. 124 | 125 | ``` bash 126 | cd 127 | make venv 128 | make install 129 | make build 130 | ``` 131 | 132 | ## Run the Command-Line App 133 | 134 | If you have performed the steps above, you should now be able to run the 135 | application by the project name. 136 | 137 | ``` bash 138 | --help 139 | ``` 140 | 141 | If you get the template help message, you're ready to start building. 142 | 143 | ## Resources 144 | 145 | Would you like to learn more? Check out the links below! 146 | 147 | * [Cookiecutter Project 148 | Documentation](https://cookiecutter.readthedocs.io/en/latest/) 149 | * [Cookiecutter: Project Templates Made 150 | Easy](https://www.pydanny.com/cookie-project-templates-made-easy.html) 151 | * [Click](http://click.pocoo.org/5/) 152 | * [Pytest](https://docs.pytest.org/en/latest/) 153 | * [Sphinx](http://www.sphinx-doc.org/en/master/usage/quickstart.html) 154 | 155 | ## Author 156 | 157 | This program was created by [Pat Daburu](https://github.com/patdaburu). 158 | 159 | This project is [hosted on GitHub](https://github.com/patdaburu/cookiecutter-click). Please feel free to submit pull requests. 160 | 161 | ## Contributors 162 | 163 | | name | github link | 164 | |-------------|-------------------------------| 165 | | Vlad Doster | https://github.com/vladdoster | 166 | 167 | ## License 168 | 169 | Copyright © 2018–2020 Pat Daburu. This program is released under the GPLv3 license, which you can find in the file [LICENSE](LICENSE). 170 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | # 3 | # This file only contains a selection of the most common options. For a full 4 | # list see the documentation: 5 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 6 | 7 | # -- Path setup -------------------------------------------------------------- 8 | 9 | # If extensions (or modules to document with autodoc) are in another directory, 10 | # add these directories to sys.path here. If the directory is relative to the 11 | # documentation root, use os.path.abspath to make it absolute, like shown here. 12 | import os 13 | import sys 14 | from unittest.mock import MagicMock 15 | 16 | # Determine the absolute path to the directory containing the python modules. 17 | _pysrc = os.path.abspath(os.path.join(os.path.abspath(__file__), "..", "..", "..")) 18 | 19 | # Insert it into the path. 20 | sys.path.insert(0, _pysrc) 21 | 22 | # Now we can import local modules. 23 | import {{cookiecutter.package_name}} # noqa 24 | 25 | # -- Document __init__ methods by default. -------------------------------- 26 | # This section was added to allow __init__() to be documented automatically. 27 | # You can comment this section out to go back to the default behavior. 28 | # See: http://stackoverflow.com/questions/5599254 29 | 30 | 31 | def skip(app, what, name, obj, skip, options): 32 | if name == "__init__": 33 | return False 34 | return skip 35 | 36 | 37 | def setup(app): 38 | app.connect("autodoc-skip-member", skip) 39 | 40 | 41 | class Mock(MagicMock): 42 | @classmethod 43 | def __getattr__(cls, name): 44 | return MagicMock() 45 | 46 | 47 | MOCK_MODULES = [ 48 | "numpy", 49 | "scipy", 50 | "sklearn", 51 | "matplotlib", 52 | "matplotlib.pyplot", 53 | "scipy.interpolate", 54 | "scipy.special", 55 | "math", 56 | "pandas", 57 | ] 58 | sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES) 59 | 60 | # -- General configuration ------------------------------------------------ 61 | 62 | # If your documentation needs a minimal Sphinx version, state it here. 63 | # 64 | # needs_sphinx = '1.0' 65 | 66 | # Add any Sphinx extension module names here, as strings. They can be 67 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 68 | # ones. 69 | extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode", "sphinx.ext.githubpages"] 70 | 71 | # Add any paths that contain templates here, relative to this directory. 72 | templates_path = ["_templates"] 73 | 74 | # The suffix(es) of source filenames. 75 | # You can specify multiple suffix as a list of string: 76 | # 77 | # source_suffix = ['.rst', '.md'] 78 | source_suffix = ".rst" 79 | 80 | # The master toctree document. 81 | master_doc = "index" 82 | 83 | # General information about the project. 84 | project = "{{cookiecutter.package_name}}" 85 | copyright = "2019, {{cookiecutter.github_user}}" 86 | author = "{{cookiecutter.author_name}}" 87 | 88 | # The version info for the project you're documenting, acts as replacement for 89 | # |version| and |release|, also used in various other places throughout the 90 | # built documents. 91 | # 92 | # The short X.Y version. 93 | # version = {{cookiecutter.package_name}}.__version__ 94 | # The full version, including alpha/beta/rc tags. 95 | # release = {{cookiecutter.package_name}}.__release__ 96 | 97 | # The full version, including alpha/beta/rc tags 98 | 99 | release = {{cookiecutter.package_name}}.__release__ 100 | 101 | # The language for content autogenerated by Sphinx. Refer to documentation 102 | # for a list of supported languages. 103 | # 104 | # This is also used if you do content translation via gettext catalogs. 105 | # Usually you set "language" from the command line for these cases. 106 | language = None 107 | 108 | # List of patterns, relative to source directory, that match files and 109 | # directories to ignore when looking for source files. 110 | # This pattern also affects html_static_path and html_extra_path. 111 | exclude_patterns = [] 112 | 113 | # The name of the Pygments (syntax highlighting) style to use. 114 | pygments_style = "sphinx" 115 | 116 | # If true, `todo` and `todoList` produce output, else they produce nothing. 117 | todo_include_todos = False 118 | 119 | # -- Options for HTML output ---------------------------------------------- 120 | 121 | # The theme to use for HTML and HTML Help pages. See the documentation for 122 | # a list of builtin themes. 123 | 124 | # fmt: off 125 | {% if cookiecutter.sphinx_theme == 'alabaster'%} # noqa 126 | # fmt: on 127 | html_theme = "alabaster" 128 | 129 | html_theme_options = { 130 | "logo": "logo.png", 131 | "github_user": "{{cookiecutter.github_user}}", 132 | "github_repo": "{{cookiecutter.project_name}}", 133 | } 134 | # fmt: off 135 | {% endif %} # noqa 136 | {% if cookiecutter.sphinx_theme == 'readthedocs' %} # noqa 137 | # fmt: on 138 | html_theme = "sphinx_rtd_theme" 139 | html_theme_options = {} 140 | # fmt: off 141 | {% endif %} # noqa 142 | # fmt: on 143 | 144 | # Add any paths that contain custom static files (such as style sheets) here, 145 | # relative to this directory. They are copied after the builtin static files, 146 | # so a file named "default.css" will overwrite the builtin "default.css". 147 | html_static_path = ["_static"] 148 | 149 | # Custom sidebar templates, must be a dictionary that maps document names 150 | # to template names. 151 | # 152 | # This is required for the alabaster theme 153 | # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars 154 | html_sidebars = { 155 | "**": [ 156 | "about.html", 157 | "navigation.html", 158 | "relations.html", # needs 'show_related': True theme option to display 159 | "searchbox.html", 160 | "donate.html", 161 | ] 162 | } 163 | 164 | # -- Options for HTMLHelp output ------------------------------------------ 165 | 166 | # Output file base name for HTML help builder. 167 | htmlhelp_basename = "{{cookiecutter.package_name}}doc" 168 | 169 | # -- Options for LaTeX output --------------------------------------------- 170 | 171 | latex_elements = { 172 | # The paper size ('letterpaper' or 'a4paper'). 173 | # 174 | # 'papersize': 'letterpaper', 175 | # The font size ('10pt', '11pt' or '12pt'). 176 | # 177 | # 'pointsize': '10pt', 178 | # Additional stuff for the LaTeX preamble. 179 | # 180 | # 'preamble': '', 181 | # Latex figure (float) alignment 182 | # 183 | # 'figure_align': 'htbp', 184 | } 185 | 186 | # Grouping the document tree into LaTeX files. List of tuples 187 | # (source start file, target name, title, 188 | # author, documentclass [howto, manual, or own class]). 189 | latex_documents = [ 190 | ( 191 | master_doc, 192 | "{{cookiecutter.package_name}}.tex", 193 | "{{cookiecutter.package_name}} Documentation", 194 | "{{cookiecutter.github_user}}", 195 | "manual", 196 | ) 197 | ] 198 | 199 | # -- Options for manual page output --------------------------------------- 200 | 201 | # One entry per manual page. List of tuples 202 | # (source start file, name, description, authors, manual section). 203 | man_pages = [ 204 | ( 205 | master_doc, 206 | "{{cookiecutter.package_name}}", 207 | "{{cookiecutter.package_name}} Documentation", 208 | [author], 209 | 1, 210 | ) 211 | ] 212 | 213 | # -- Options for Texinfo output ------------------------------------------- 214 | 215 | # Grouping the document tree into Texinfo files. List of tuples 216 | # (source start file, target name, title, author, 217 | # dir menu entry, description, category) 218 | texinfo_documents = [ 219 | ( 220 | master_doc, 221 | "{{cookiecutter.package_name}}", 222 | "{{cookiecutter.package_name}} Documentation", 223 | author, 224 | "{{cookiecutter.package_name}}", 225 | "One line description of project.", 226 | "Miscellaneous", 227 | ) 228 | ] 229 | -------------------------------------------------------------------------------- /{{cookiecutter.project_name}}/.pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | 3 | # A comma-separated list of package or module names from where C extensions may 4 | # be loaded. Extensions are loading into the active Python interpreter and may 5 | # run arbitrary code 6 | extension-pkg-whitelist= 7 | 8 | # Add files or directories to the blacklist. They should be base names, not 9 | # paths. 10 | ignore=CVS 11 | 12 | # Add files or directories matching the regex patterns to the blacklist. The 13 | # regex matches against base names, not paths. 14 | ignore-patterns= 15 | 16 | # Python code to execute, usually for sys.path manipulation such as 17 | # pygtk.require(). 18 | #init-hook= 19 | 20 | # Use multiple processes to speed up Pylint. 21 | jobs=1 22 | 23 | # List of plugins (as comma separated values of python modules names) to load, 24 | # usually to register additional checkers. 25 | load-plugins= 26 | 27 | # Pickle collected data for later comparisons. 28 | persistent=yes 29 | 30 | # Specify a configuration file. 31 | #rcfile= 32 | 33 | # When enabled, pylint would attempt to guess common misconfiguration and emit 34 | # user-friendly hints instead of false-positive error messages 35 | suggestion-mode=yes 36 | 37 | # Allow loading of arbitrary C extensions. Extensions are imported into the 38 | # active Python interpreter and may run arbitrary code. 39 | unsafe-load-any-extension=no 40 | 41 | 42 | [MESSAGES CONTROL] 43 | 44 | # Only show warnings with the listed confidence levels. Leave empty to show 45 | # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED 46 | confidence= 47 | 48 | # Disable the message, report, category or checker with the given id(s). You 49 | # can either give multiple identifiers separated by comma (,) or put this 50 | # option multiple times (only on the command line, not in the configuration 51 | # file where it should appear only once).You can also use "--disable=all" to 52 | # disable everything first and then reenable specific checks. For example, if 53 | # you want to run only the similarities checker, you can use "--disable=all 54 | # --enable=similarities". If you want to run only the classes checker, but have 55 | # no Warning level messages displayed, use"--disable=all --enable=classes 56 | # --disable=W" 57 | disable=print-statement, 58 | parameter-unpacking, 59 | unpacking-in-except, 60 | old-raise-syntax, 61 | backtick, 62 | long-suffix, 63 | old-ne-operator, 64 | old-octal-literal, 65 | import-star-module-level, 66 | non-ascii-bytes-literal, 67 | raw-checker-failed, 68 | bad-inline-option, 69 | locally-disabled, 70 | locally-enabled, 71 | file-ignored, 72 | suppressed-message, 73 | useless-suppression, 74 | deprecated-pragma, 75 | apply-builtin, 76 | basestring-builtin, 77 | buffer-builtin, 78 | cmp-builtin, 79 | coerce-builtin, 80 | execfile-builtin, 81 | file-builtin, 82 | long-builtin, 83 | raw_input-builtin, 84 | reduce-builtin, 85 | standarderror-builtin, 86 | unicode-builtin, 87 | xrange-builtin, 88 | coerce-method, 89 | delslice-method, 90 | getslice-method, 91 | setslice-method, 92 | no-absolute-import, 93 | old-division, 94 | dict-iter-method, 95 | dict-view-method, 96 | next-method-called, 97 | metaclass-assignment, 98 | indexing-exception, 99 | raising-string, 100 | reload-builtin, 101 | oct-method, 102 | hex-method, 103 | nonzero-method, 104 | cmp-method, 105 | input-builtin, 106 | round-builtin, 107 | intern-builtin, 108 | unichr-builtin, 109 | map-builtin-not-iterating, 110 | zip-builtin-not-iterating, 111 | range-builtin-not-iterating, 112 | filter-builtin-not-iterating, 113 | using-cmp-argument, 114 | eq-without-hash, 115 | div-method, 116 | idiv-method, 117 | rdiv-method, 118 | exception-message-attribute, 119 | invalid-str-codec, 120 | sys-max-int, 121 | bad-python3-import, 122 | deprecated-string-function, 123 | deprecated-str-translate-call, 124 | deprecated-itertools-function, 125 | deprecated-types-field, 126 | next-method-defined, 127 | dict-items-not-iterating, 128 | dict-keys-not-iterating, 129 | dict-values-not-iterating, 130 | too-few-public-methods, 131 | trailing-whitespace 132 | 133 | # Enable the message, report, category or checker with the given id(s). You can 134 | # either give multiple identifier separated by comma (,) or put this option 135 | # multiple time (only on the command line, not in the configuration file where 136 | # it should appear only once). See also the "--disable" option for examples. 137 | enable=c-extension-no-member 138 | 139 | 140 | [REPORTS] 141 | 142 | # Python expression which should return a note less than 10 (10 is the highest 143 | # note). You have access to the variables errors warning, statement which 144 | # respectively contain the number of errors / warnings messages and the total 145 | # number of statements analyzed. This is used by the global evaluation report 146 | # (RP0004). 147 | evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) 148 | 149 | # Template used to display messages. This is a python new-style format string 150 | # used to format the message information. See doc for all details 151 | #msg-template= 152 | 153 | # Set the output format. Available formats are text, parseable, colorized, json 154 | # and msvs (visual studio).You can also give a reporter class, eg 155 | # mypackage.mymodule.MyReporterClass. 156 | output-format=text 157 | 158 | # Tells whether to display a full report or only the messages 159 | reports=no 160 | 161 | # Activate the evaluation score. 162 | score=yes 163 | 164 | 165 | [REFACTORING] 166 | 167 | # Maximum number of nested blocks for function / method body 168 | max-nested-blocks=5 169 | 170 | # Complete name of functions that never returns. When checking for 171 | # inconsistent-return-statements if a never returning function is called then 172 | # it will be considered as an explicit return statement and no message will be 173 | # printed. 174 | never-returning-functions=optparse.Values,sys.exit 175 | 176 | 177 | [SPELLING] 178 | 179 | # Limits count of emitted suggestions for spelling mistakes 180 | max-spelling-suggestions=4 181 | 182 | # Spelling dictionary name. Available dictionaries: none. To make it working 183 | # install python-enchant package. 184 | spelling-dict= 185 | 186 | # List of comma separated words that should not be checked. 187 | spelling-ignore-words= 188 | 189 | # A path to a file that contains private dictionary; one word per line. 190 | spelling-private-dict-file= 191 | 192 | # Tells whether to store unknown words to indicated private dictionary in 193 | # --spelling-private-dict-file option instead of raising a message. 194 | spelling-store-unknown-words=no 195 | 196 | 197 | [LOGGING] 198 | 199 | # Logging modules to check that the string format arguments are in logging 200 | # function parameter format 201 | logging-modules=logging 202 | 203 | 204 | [BASIC] 205 | 206 | # Naming style matching correct argument names 207 | argument-naming-style=snake_case 208 | 209 | # Regular expression matching correct argument names. Overrides argument- 210 | # naming-style 211 | #argument-rgx= 212 | 213 | # Naming style matching correct attribute names 214 | attr-naming-style=snake_case 215 | 216 | # Regular expression matching correct attribute names. Overrides attr-naming- 217 | # style 218 | #attr-rgx= 219 | 220 | # Bad variable names which should always be refused, separated by a comma 221 | bad-names=foo, 222 | bar, 223 | baz, 224 | toto, 225 | tutu, 226 | tata 227 | 228 | # Naming style matching correct class attribute names 229 | class-attribute-naming-style=any 230 | 231 | # Regular expression matching correct class attribute names. Overrides class- 232 | # attribute-naming-style 233 | #class-attribute-rgx= 234 | 235 | # Naming style matching correct class names 236 | class-naming-style=PascalCase 237 | 238 | # Regular expression matching correct class names. Overrides class-naming-style 239 | #class-rgx= 240 | 241 | # Naming style matching correct constant names 242 | const-naming-style=UPPER_CASE 243 | 244 | # Regular expression matching correct constant names. Overrides const-naming- 245 | # style 246 | #const-rgx= 247 | 248 | # Minimum line length for functions/classes that require docstrings, shorter 249 | # ones are exempt. 250 | docstring-min-length=-1 251 | 252 | # Naming style matching correct function names 253 | function-naming-style=snake_case 254 | 255 | # Regular expression matching correct function names. Overrides function- 256 | # naming-style 257 | #function-rgx= 258 | 259 | # Good variable names which should always be accepted, separated by a comma 260 | good-names=i, 261 | j, 262 | k, 263 | ex, 264 | Run, 265 | _ 266 | 267 | # Include a hint for the correct naming format with invalid-name 268 | include-naming-hint=no 269 | 270 | # Naming style matching correct inline iteration names 271 | inlinevar-naming-style=any 272 | 273 | # Regular expression matching correct inline iteration names. Overrides 274 | # inlinevar-naming-style 275 | #inlinevar-rgx= 276 | 277 | # Naming style matching correct method names 278 | method-naming-style=snake_case 279 | 280 | # Regular expression matching correct method names. Overrides method-naming- 281 | # style 282 | #method-rgx= 283 | 284 | # Naming style matching correct module names 285 | module-naming-style=snake_case 286 | 287 | # Regular expression matching correct module names. Overrides module-naming- 288 | # style 289 | #module-rgx= 290 | 291 | # Colon-delimited sets of names that determine each other's naming style when 292 | # the name regexes allow several styles. 293 | name-group= 294 | 295 | # Regular expression which should only match function or class names that do 296 | # not require a docstring. 297 | no-docstring-rgx=^_ 298 | 299 | # List of decorators that produce properties, such as abc.abstractproperty. Add 300 | # to this list to register other decorators that produce valid properties. 301 | property-classes=abc.abstractproperty 302 | 303 | # Naming style matching correct variable names 304 | variable-naming-style=snake_case 305 | 306 | # Regular expression matching correct variable names. Overrides variable- 307 | # naming-style 308 | #variable-rgx= 309 | 310 | 311 | [SIMILARITIES] 312 | 313 | # Ignore comments when computing similarities. 314 | ignore-comments=yes 315 | 316 | # Ignore docstrings when computing similarities. 317 | ignore-docstrings=yes 318 | 319 | # Ignore imports when computing similarities. 320 | ignore-imports=no 321 | 322 | # Minimum lines number of a similarity. 323 | min-similarity-lines=4 324 | 325 | 326 | [TYPECHECK] 327 | 328 | # List of decorators that produce context managers, such as 329 | # contextlib.contextmanager. Add to this list to register other decorators that 330 | # produce valid context managers. 331 | contextmanager-decorators=contextlib.contextmanager 332 | 333 | # List of members which are set dynamically and missed by pylint inference 334 | # system, and so shouldn't trigger E1101 when accessed. Python regular 335 | # expressions are accepted. 336 | generated-members= 337 | 338 | # Tells whether missing members accessed in mixin class should be ignored. A 339 | # mixin class is detected if its name ends with "mixin" (case insensitive). 340 | ignore-mixin-members=yes 341 | 342 | # This flag controls whether pylint should warn about no-member and similar 343 | # checks whenever an opaque object is returned when inferring. The inference 344 | # can return multiple potential results while evaluating a Python object, but 345 | # some branches might not be evaluated, which results in partial inference. In 346 | # that case, it might be useful to still emit no-member and other checks for 347 | # the rest of the inferred objects. 348 | ignore-on-opaque-inference=yes 349 | 350 | # List of class names for which member attributes should not be checked (useful 351 | # for classes with dynamically set attributes). This supports the use of 352 | # qualified names. 353 | ignored-classes=optparse.Values,thread._local,_thread._local 354 | 355 | # List of module names for which member attributes should not be checked 356 | # (useful for modules/projects where namespaces are manipulated during runtime 357 | # and thus existing member attributes cannot be deduced by static analysis. It 358 | # supports qualified module names, as well as Unix pattern matching. 359 | ignored-modules= 360 | 361 | # Show a hint with possible names when a member name was not found. The aspect 362 | # of finding the hint is based on edit distance. 363 | missing-member-hint=yes 364 | 365 | # The minimum edit distance a name should have in order to be considered a 366 | # similar match for a missing member name. 367 | missing-member-hint-distance=1 368 | 369 | # The total number of similar names that should be taken in consideration when 370 | # showing a hint for a missing member. 371 | missing-member-max-choices=1 372 | 373 | 374 | [VARIABLES] 375 | 376 | # List of additional names supposed to be defined in builtins. Remember that 377 | # you should avoid to define new builtins when possible. 378 | additional-builtins= 379 | 380 | # Tells whether unused global variables should be treated as a violation. 381 | allow-global-unused-variables=yes 382 | 383 | # List of strings which can identify a callback function by name. A callback 384 | # name must start or end with one of those strings. 385 | callbacks=cb_, 386 | _cb 387 | 388 | # A regular expression matching the name of dummy variables (i.e. expectedly 389 | # not used). 390 | dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ 391 | 392 | # Argument names that match this expression will be ignored. Default to name 393 | # with leading underscore 394 | ignored-argument-names=_.*|^ignored_|^unused_ 395 | 396 | # Tells whether we should check for unused import in __init__ files. 397 | init-import=no 398 | 399 | # List of qualified module names which can have objects that can redefine 400 | # builtins. 401 | redefining-builtins-modules=six.moves,past.builtins,future.builtins 402 | 403 | 404 | [MISCELLANEOUS] 405 | 406 | # List of note tags to take in consideration, separated by a comma. 407 | notes=FIXME, 408 | XXX, 409 | TODO 410 | 411 | 412 | [FORMAT] 413 | 414 | # Expected format of line ending, e.g. empty (any line ending), LF or CRLF. 415 | expected-line-ending-format= 416 | 417 | # Regexp for a line that is allowed to be longer than the limit. 418 | ignore-long-lines=^\s*(# )??$ 419 | 420 | # Number of spaces of indent required inside a hanging or continued line. 421 | indent-after-paren=4 422 | 423 | # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 424 | # tab). 425 | indent-string=' ' 426 | 427 | # Maximum number of characters on a single line. 428 | max-line-length=100 429 | 430 | # Maximum number of lines in a module 431 | max-module-lines=1000 432 | 433 | # List of optional constructs for which whitespace checking is disabled. `dict- 434 | # separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. 435 | # `trailing-comma` allows a space between comma and closing bracket: (a, ). 436 | # `empty-line` allows space-only lines. 437 | no-space-check=trailing-comma, 438 | dict-separator 439 | 440 | # Allow the body of a class to be on the same line as the declaration if body 441 | # contains single statement. 442 | single-line-class-stmt=no 443 | 444 | # Allow the body of an if to be on the same line as the test if there is no 445 | # else. 446 | single-line-if-stmt=no 447 | 448 | 449 | [IMPORTS] 450 | 451 | # Allow wildcard imports from modules that define __all__. 452 | allow-wildcard-with-all=no 453 | 454 | # Analyse import fallback blocks. This can be used to support both Python 2 and 455 | # 3 compatible code, which means that the block might have code that exists 456 | # only in one or another interpreter, leading to false positives when analysed. 457 | analyse-fallback-blocks=no 458 | 459 | # Deprecated modules which should not be used, separated by a comma 460 | deprecated-modules=optparse,tkinter.tix 461 | 462 | # Create a graph of external dependencies in the given file (report RP0402 must 463 | # not be disabled) 464 | ext-import-graph= 465 | 466 | # Create a graph of every (i.e. internal and external) dependencies in the 467 | # given file (report RP0402 must not be disabled) 468 | import-graph= 469 | 470 | # Create a graph of internal dependencies in the given file (report RP0402 must 471 | # not be disabled) 472 | int-import-graph= 473 | 474 | # Force import order to recognize a module as part of the standard 475 | # compatibility libraries. 476 | known-standard-library= 477 | 478 | # Force import order to recognize a module as part of a third party library. 479 | known-third-party=enchant 480 | 481 | 482 | [DESIGN] 483 | 484 | # Maximum number of arguments for function / method 485 | max-args=5 486 | 487 | # Maximum number of attributes for a class (see R0902). 488 | max-attributes=7 489 | 490 | # Maximum number of boolean expressions in a if statement 491 | max-bool-expr=5 492 | 493 | # Maximum number of branch for function / method body 494 | max-branches=12 495 | 496 | # Maximum number of locals for function / method body 497 | max-locals=15 498 | 499 | # Maximum number of parents for a class (see R0901). 500 | max-parents=7 501 | 502 | # Maximum number of public methods for a class (see R0904). 503 | max-public-methods=20 504 | 505 | # Maximum number of return / yield for function / method body 506 | max-returns=6 507 | 508 | # Maximum number of statements in function / method body 509 | max-statements=50 510 | 511 | # Minimum number of public methods for a class (see R0903). 512 | min-public-methods=2 513 | 514 | 515 | [CLASSES] 516 | 517 | # List of method names used to declare (i.e. assign) instance attributes. 518 | defining-attr-methods=__init__, 519 | __new__, 520 | setUp 521 | 522 | # List of member names, which should be excluded from the protected access 523 | # warning. 524 | exclude-protected=_asdict, 525 | _fields, 526 | _replace, 527 | _source, 528 | _make 529 | 530 | # List of valid names for the first argument in a class method. 531 | valid-classmethod-first-arg=cls 532 | 533 | # List of valid names for the first argument in a metaclass class method. 534 | valid-metaclass-classmethod-first-arg=mcs 535 | 536 | 537 | [EXCEPTIONS] 538 | 539 | # Exceptions that will emit a warning when being caught. Defaults to 540 | # "Exception" 541 | overgeneral-exceptions=Exception 542 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------