├── .gitignore ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.rst ├── ci └── travis.sh ├── cookiecutter.json ├── hooks └── post_gen_project.py ├── test-requirements.txt ├── tests └── test_stuff.py └── {{cookiecutter.project_slug}} ├── .coveragerc ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── .readthedocs.yml ├── .travis.yml ├── CHEATSHEET.rst ├── MANIFEST.in ├── README.rst ├── check.sh ├── ci.sh ├── docs-requirements.txt ├── docs ├── Makefile ├── make.bat └── source │ ├── _static │ └── .gitkeep │ ├── conf.py │ ├── history.rst │ └── index.rst ├── license-files ├── dual-mit-apache2 │ ├── LICENSE │ ├── LICENSE.APACHE2 │ └── LICENSE.MIT ├── gplv3+ │ └── LICENSE └── other │ └── LICENSE-IS-MISSING ├── mypy.ini ├── newsfragments ├── .gitkeep └── README.rst ├── pyproject.toml ├── setup.cfg ├── setup.py ├── test-requirements.txt └── {{cookiecutter.package_name}} ├── __init__.py ├── _tests ├── __init__.py ├── conftest.py └── test_example.py └── _version.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Add any project-specific files here: 2 | 3 | 4 | # Sphinx docs 5 | docs/build/ 6 | 7 | # Byte-compiled / optimized / DLL files 8 | __pycache__/ 9 | *.py[cod] 10 | *~ 11 | \#* 12 | .#* 13 | 14 | # C extensions 15 | *.so 16 | 17 | # Distribution / packaging 18 | .Python 19 | /build/ 20 | /develop-eggs/ 21 | /dist/ 22 | /eggs/ 23 | /lib/ 24 | /lib64/ 25 | /parts/ 26 | /sdist/ 27 | /var/ 28 | *.egg-info/ 29 | .installed.cfg 30 | *.egg 31 | 32 | # Installer logs 33 | pip-log.txt 34 | 35 | # Unit test / coverage reports 36 | htmlcov/ 37 | .tox/ 38 | .coverage 39 | .coverage.* 40 | .cache 41 | .pytest_cache 42 | nosetests.xml 43 | coverage.xml 44 | 45 | # Translations 46 | *.mo 47 | 48 | # Mr Developer 49 | .mr.developer.cfg 50 | .project 51 | .pydevproject 52 | 53 | # Rope 54 | .ropeproject 55 | 56 | # Django stuff: 57 | *.log 58 | *.pot 59 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - 3.5 4 | - 3.6 5 | sudo: false 6 | dist: trusty 7 | 8 | matrix: 9 | include: 10 | - python: 3.7 11 | dist: xenial 12 | sudo: required 13 | 14 | script: 15 | - ci/travis.sh 16 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | The Trio code of conduct applies to this project. See: 2 | https://trio.readthedocs.io/en/latest/code-of-conduct.html 3 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | This is an official Trio project. For the Trio contributing guide, 2 | see: 3 | https://trio.readthedocs.io/en/latest/contributing.html 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | Todo: 2 | 3 | * add a test that we can run cookiecutter, install, run tests, run 4 | towncrier, docs work (maybe run the travis script?) 5 | * switch to pytest-trio 6 | 7 | 8 | cookiecutter-trio 9 | ================= 10 | 11 | This is a cookiecutter template for Python projects that use `Trio 12 | `__. It makes it easy to start a new 13 | project, by providing a bunch of preconfigured boilerplate for: 14 | 15 | * pytest with trio integration 16 | * sphinx docs with sphinxcontrib-trio enabled 17 | * Readthedocs to publish your docs 18 | * Travis and Appveyor to test your package on all the different 19 | platforms Trio supports: Windows + MacOS + Linux, CPython + PyPy 20 | * Codecov to track code coverage information 21 | * towncrier for easy release note management 22 | * black so you don't have to think about formatting 23 | 24 | This is just an optional starting point – you don't have to use it, 25 | and if you do use it, then all it does is generate a bunch of 26 | boilerplate, so once it's done you're free to customize everything to 27 | your liking. But, this is the same basic setup used to develop Trio 28 | itself and many related projects, so the closer you stick to the 29 | template the easier it will be for new contributors to hit the ground 30 | running. 31 | 32 | 33 | Let's do this! 34 | -------------- 35 | 36 | 1. ``pip install -U cookiecutter`` (or check out the `detailed 37 | cookiecutter install instructions 38 | `__) 39 | 2. ``cookiecutter gh:python-trio/cookiecutter-trio`` 40 | 3. Answer the questions. This will create a directory named after your 41 | project (e.g., if you said your project is called 42 | ``superwhizbang``, then there will be a directory called 43 | ``superwhizbang/``). 44 | 4. Look through ``{your project}/CHEATSHEET.rst`` for a 45 | checklist of things to think about and tips on how to do basic 46 | things like running tests. 47 | 48 | 49 | License 50 | ------- 51 | 52 | This cookiecutter template is released under the CC0 Public Domain 53 | Dedication – see the file LICENSE for details. Basically what this 54 | means is that you can use it for any kind of project you want under 55 | whatever license terms you want, and you don't even have to worry 56 | about giving us credit or anything like that. 57 | -------------------------------------------------------------------------------- /ci/travis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -exu -o pipefail 4 | 5 | pip install -r test-requirements.txt 6 | 7 | pytest tests/ 8 | -------------------------------------------------------------------------------- /cookiecutter.json: -------------------------------------------------------------------------------- 1 | { 2 | "full_name": "Your name", 3 | "email": "Your address email (eq. you@example.com)", 4 | "project_name": "Name of the project", 5 | "project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '-') }}", 6 | "package_name": "{{ cookiecutter.project_slug.replace('-', '_') }}", 7 | "project_short_description": "A short description of the project (for setup.py metadata)", 8 | "project_url": "Project URL (for setup.py metadata)", 9 | "license": [ 10 | "Dual MIT/Apache 2 (like Trio)", 11 | "GPLv3 or later", 12 | "Other" 13 | ], 14 | "earliest_supported_python": [ 15 | "3.6", 16 | "3.7", 17 | "3.8" 18 | ], 19 | 20 | "_comment": [ 21 | "The above license strings are for users to look at. They're not", 22 | "super friendly for programs. So the rest of the cookiecutter never", 23 | "uses them directly, but only as keys into this table:" 24 | ], 25 | "_license_info": { 26 | "Dual MIT/Apache 2 (like Trio)": { 27 | "slug": "dual-mit-apache2", 28 | "readme": "Your choice of MIT or Apache License 2.0", 29 | "license_field": "MIT -or- Apache License 2.0", 30 | "trove": [ 31 | "License :: OSI Approved :: MIT License", 32 | "License :: OSI Approved :: Apache Software License" 33 | ] 34 | }, 35 | "GPLv3 or later": { 36 | "slug": "gplv3+", 37 | "readme": "GPLv3 as published by the Free Software Foundation, or (at your option) any later version", 38 | "license_field": "GPLv3 or later", 39 | "trove": [ 40 | "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)" 41 | ] 42 | }, 43 | "Other": { 44 | "slug": "other", 45 | "readme": "", 46 | "license_field": "", 47 | "trove": [ 48 | ] 49 | } 50 | }, 51 | 52 | "_comment": "https://docs.microsoft.com/en-us/visualstudio/python/cookiecutter#optimizing-cookiecutter-templates-for-visual-studio", 53 | "_visual_studio": { 54 | "full_name": { 55 | "label": "Full name", 56 | "description": "Your full name (for setup.py metadata)" 57 | }, 58 | "email": { 59 | "label": "Email", 60 | "description": "Your email (for setup.py metadata)" 61 | }, 62 | "project_name": { 63 | "label": "Project name", 64 | "description": "Name of the project (for human text, like docs)" 65 | }, 66 | "project_slug": { 67 | "label": "Project slug", 68 | "description": "Name of the project (for 'pip install <...>')" 69 | }, 70 | "package_name": { 71 | "label": "Package name", 72 | "description": "Name of the package (for 'import <...>')" 73 | }, 74 | "project_short_description": { 75 | "label": "Project short description", 76 | "descripton": "One line (for setup.py metadata)" 77 | }, 78 | "project_url": { 79 | "label": "Project URL", 80 | "descripton": "(for setup.py metadata)" 81 | }, 82 | "license": { 83 | "label": "License" 84 | }, 85 | "earliest_supported_python": { 86 | "label": "Earliest Python version you want to support?" 87 | } 88 | }, 89 | "_visual_studio_post_cmds": [ 90 | { 91 | "name": "File.OpenFile", 92 | "args": [ 93 | "{{ cookiecutter._output_folder_path }}\\CHEATSHEET.rst" 94 | ] 95 | } 96 | ] 97 | } 98 | -------------------------------------------------------------------------------- /hooks/post_gen_project.py: -------------------------------------------------------------------------------- 1 | from os.path import join 2 | import glob 3 | import shutil 4 | 5 | license_slug = '{{ cookiecutter["_license_info"][cookiecutter.license]["slug"] }}' 6 | 7 | for path in glob.glob(join("license-files", license_slug, "*")): 8 | shutil.move(path, ".") 9 | 10 | shutil.rmtree("license-files") 11 | -------------------------------------------------------------------------------- /test-requirements.txt: -------------------------------------------------------------------------------- 1 | cookiecutter 2 | pytest 3 | -------------------------------------------------------------------------------- /tests/test_stuff.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import cookiecutter 3 | 4 | # make venv 5 | # inside the new venv, install test requirements and check pytest works 7 | 8 | # make venv 9 | # inside the new venv, install ci/rtd-requirements.txt, and check sphinx-build 10 | # works 11 | # oh and towncrier too 12 | 13 | def test_stuff(): 14 | print("woo") 15 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch=True 3 | source={{cookiecutter.package_name}} 4 | 5 | [report] 6 | precision = 1 7 | exclude_lines = 8 | pragma: no cover 9 | abc.abstractmethod 10 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [pull_request] 4 | 5 | jobs: 6 | Windows: 7 | {%- raw %} 8 | name: 'Windows (${{ matrix.python }}, ${{ matrix.arch }}${{ matrix.extra_name }})' 9 | {%- endraw %} 10 | timeout-minutes: 20 11 | runs-on: 'windows-latest' 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | python: 16 | {%- if cookiecutter.earliest_supported_python <= "3.6" %} 17 | - '3.6' 18 | {%- endif %} 19 | {%- if cookiecutter.earliest_supported_python <= "3.7" %} 20 | - '3.7' 21 | {%- endif %} 22 | {%- if cookiecutter.earliest_supported_python <= "3.8" %} 23 | - '3.8' 24 | {%- endif %} 25 | arch: ['x86', 'x64'] 26 | {%- raw %} 27 | steps: 28 | - name: Checkout 29 | uses: actions/checkout@v2 30 | - name: Setup python 31 | uses: actions/setup-python@v1 32 | with: 33 | python-version: '${{ matrix.python }}' 34 | architecture: '${{ matrix.arch }}' 35 | - name: Run tests 36 | run: ./ci.sh 37 | shell: bash 38 | env: 39 | # Should match 'name:' up above 40 | JOB_NAME: 'Windows (${{ matrix.python }}, ${{ matrix.arch }})' 41 | {%- endraw %} 42 | 43 | Linux: 44 | {%- raw %} 45 | name: 'Linux (${{ matrix.python }}${{ matrix.extra_name }})' 46 | {%- endraw %} 47 | timeout-minutes: 10 48 | runs-on: 'ubuntu-latest' 49 | strategy: 50 | fail-fast: false 51 | matrix: 52 | python: 53 | {%- if cookiecutter.earliest_supported_python <= "3.6" %} 54 | - '3.6' 55 | {%- endif %} 56 | {%- if cookiecutter.earliest_supported_python <= "3.7" %} 57 | - '3.7' 58 | {%- endif %} 59 | {%- if cookiecutter.earliest_supported_python <= "3.8" %} 60 | - '3.8' 61 | {%- endif %} 62 | check_docs: ['0'] 63 | check_lint: ['0'] 64 | extra_name: [''] 65 | include: 66 | - python: '3.8' 67 | check_docs: '1' 68 | extra_name: ', check docs' 69 | - python: '3.8' 70 | check_lint: '1' 71 | extra_name: ', formatting and linting' 72 | {%- raw %} 73 | steps: 74 | - name: Checkout 75 | uses: actions/checkout@v2 76 | - name: Setup python 77 | uses: actions/setup-python@v1 78 | with: 79 | python-version: '${{ matrix.python }}' 80 | - name: Run tests 81 | run: ./ci.sh 82 | env: 83 | CHECK_DOCS: '${{ matrix.check_docs }}' 84 | CHECK_LINT: '${{ matrix.check_lint }}' 85 | # Should match 'name:' up above 86 | JOB_NAME: 'Linux (${{ matrix.python }}${{ matrix.extra_name }})' 87 | {%- endraw %} 88 | 89 | macOS: 90 | {%- raw %} 91 | name: 'macOS (${{ matrix.python }})' 92 | {%- endraw %} 93 | timeout-minutes: 10 94 | runs-on: 'macos-latest' 95 | strategy: 96 | fail-fast: false 97 | matrix: 98 | python: 99 | {%- if cookiecutter.earliest_supported_python <= "3.6" %} 100 | - '3.6' 101 | {%- endif %} 102 | {%- if cookiecutter.earliest_supported_python <= "3.7" %} 103 | - '3.7' 104 | {%- endif %} 105 | {%- if cookiecutter.earliest_supported_python <= "3.8" %} 106 | - '3.8' 107 | {%- endif %} 108 | {%- raw %} 109 | steps: 110 | - name: Checkout 111 | uses: actions/checkout@v2 112 | - name: Setup python 113 | uses: actions/setup-python@v1 114 | with: 115 | python-version: '${{ matrix.python }}' 116 | - name: Run tests 117 | run: ./ci.sh 118 | env: 119 | # Should match 'name:' up above 120 | JOB_NAME: 'macOS (${{ matrix.python }})' 121 | {%- endraw %} 122 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.gitignore: -------------------------------------------------------------------------------- 1 | # Add any project-specific files here: 2 | 3 | 4 | # Sphinx docs 5 | docs/build/ 6 | 7 | # Byte-compiled / optimized / DLL files 8 | __pycache__/ 9 | *.py[cod] 10 | *~ 11 | \#* 12 | .#* 13 | 14 | # C extensions 15 | *.so 16 | 17 | # Distribution / packaging 18 | .Python 19 | /build/ 20 | /develop-eggs/ 21 | /dist/ 22 | /eggs/ 23 | /lib/ 24 | /lib64/ 25 | /parts/ 26 | /sdist/ 27 | /var/ 28 | *.egg-info/ 29 | .installed.cfg 30 | *.egg 31 | 32 | # Installer logs 33 | pip-log.txt 34 | 35 | # Unit test / coverage reports 36 | htmlcov/ 37 | .tox/ 38 | .coverage 39 | .coverage.* 40 | .cache 41 | .pytest_cache 42 | nosetests.xml 43 | coverage.xml 44 | 45 | # Translations 46 | *.mo 47 | 48 | # Mr Developer 49 | .mr.developer.cfg 50 | .project 51 | .pydevproject 52 | 53 | # Rope 54 | .ropeproject 55 | 56 | # Django stuff: 57 | *.log 58 | *.pot 59 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.readthedocs.yml: -------------------------------------------------------------------------------- 1 | # https://docs.readthedocs.io/en/latest/config-file/index.html 2 | version: 2 3 | 4 | formats: 5 | - htmlzip 6 | - epub 7 | 8 | python: 9 | version: 3.7 10 | install: 11 | - requirements: docs-requirements.txt 12 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/.travis.yml: -------------------------------------------------------------------------------- 1 | os: linux 2 | language: python 3 | dist: focal 4 | 5 | jobs: 6 | include: 7 | {%- if cookiecutter.earliest_supported_python <= "3.6" %} 8 | # The pypy tests are slow, so we list them first 9 | - python: pypy3.6-7.2.0 10 | dist: bionic 11 | - language: generic 12 | env: PYPY_NIGHTLY_BRANCH=py3.6 13 | - python: 3.6-dev 14 | {%- endif %} 15 | {%- if cookiecutter.earliest_supported_python <= "3.7" %} 16 | - python: 3.7-dev 17 | {%- endif %} 18 | {%- if cookiecutter.earliest_supported_python <= "3.8" %} 19 | - python: 3.8-dev 20 | {%- endif %} 21 | - python: 3.9-dev 22 | - python: nightly 23 | 24 | script: 25 | - ./ci.sh 26 | 27 | branches: 28 | except: 29 | - /^dependabot/.*/ 30 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/CHEATSHEET.rst: -------------------------------------------------------------------------------- 1 | Finishing setting up your project 2 | ================================= 3 | 4 | Thanks for using cookiecutter-trio! This is your project now; you can 5 | customize it however you like. Here's some reminders of things you 6 | might want to do to get started: 7 | 8 | * Check this into source control (``git init .; git add .; git 9 | commit -m "Initial commit"``) 10 | 11 | * Add a CODE_OF_CONDUCT.md 12 | 13 | * Add a CONTRIBUTING.md 14 | 15 | * Search the source tree for COOKIECUTTER-TRIO-TODO to find other 16 | places to fill in. 17 | {%- if cookiecutter._license_info[cookiecutter.license].slug == "other" %} 18 | 19 | * Since you selected an "other" license: remove LICENSE-IS-MISSING and 20 | add a LICENSE file, and update ``setup.py`` and ``README.rst`` to 21 | tell people your license choice. 22 | {%- endif %} 23 | 24 | * Enable `Read the Docs `__. (Note: this 25 | project contains a ``.readthedocs.yml`` file that should be enough 26 | to get things working.) 27 | 28 | * Set up continuous integration: Currently, this project is set up to 29 | test on Linux, MacOS, and Windows using Github Actions, and to test 30 | some additional Python versions on Linux (PyPy and nightly) using 31 | Travis. 32 | 33 | If that's what you want, then go to Travis and Github Actions and enable 34 | testing for your repo. 35 | 36 | If that's not what you want, then you can trim the list by modifying 37 | (or deleting) ``.travis.yml``, ``.github/workflows/ci.yml``, ``ci.sh``. 38 | 39 | * Enable `Codecov `__ for your repo. 40 | 41 | * If you want to use static typing (mypy) in your project: 42 | 43 | * Update ``install_requires`` in ``setup.py`` to include ``"trio-typing"`` 44 | (assuming you use it). 45 | 46 | * Uncomment the dependency on ``mypy`` in ``test-requirements.txt``. 47 | 48 | * Uncomment the mypy invocation in ``check.sh``. 49 | 50 | * Create an empty ``{{cookiecutter.package_name}}/py.typed`` file, 51 | and add ``"include {{cookiecutter.package_name}}/py.typed"`` to 52 | ``MANIFEST.in``. 53 | 54 | * File bugs or pull requests on `cookiecutter-trio 55 | `__ reporting any 56 | problems or awkwardness you ran into (no matter how small!) 57 | 58 | * Delete this checklist once it's no longer useful 59 | 60 | 61 | Tips 62 | ==== 63 | 64 | To run tests 65 | ------------ 66 | 67 | * Install requirements: ``pip install -r test-requirements.txt`` 68 | (possibly in a virtualenv) 69 | 70 | * Actually run the tests: ``pytest {{cookiecutter.package_name}}`` 71 | 72 | 73 | To run black 74 | ------------ 75 | 76 | * Show what changes black wants to make: ``black --diff setup.py 77 | {{cookiecutter.package_name}}`` 78 | 79 | * Apply all changes directly to the source tree: ``black setup.py 80 | {{cookiecutter.package_name}}`` 81 | 82 | 83 | To make a release 84 | ----------------- 85 | 86 | * Update the version in ``{{cookiecutter.package_name}}/_version.py`` 87 | 88 | * Run ``towncrier`` to collect your release notes. 89 | 90 | * Review your release notes. 91 | 92 | * Check everything in. 93 | 94 | * Double-check it all works, docs build, etc. 95 | 96 | * Build your sdist and wheel: ``python setup.py sdist bdist_wheel`` 97 | 98 | * Upload to PyPI: ``twine upload dist/*`` 99 | 100 | * Use ``git tag`` to tag your version. 101 | 102 | * Don't forget to ``git push --tags``. 103 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.rst CHEATSHEET.rst LICENSE* CODE_OF_CONDUCT* CONTRIBUTING* 2 | include .coveragerc 3 | include test-requirements.txt 4 | recursive-include docs * 5 | prune docs/build 6 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/README.rst: -------------------------------------------------------------------------------- 1 | {{ cookiecutter.project_name }} 2 | {{ "=" * cookiecutter.project_name.__len__() }} 3 | 4 | Welcome to `{{cookiecutter.project_name}} <{{cookiecutter.project_url}}>`__! 5 | 6 | {{cookiecutter.project_short_description}} 7 | 8 | License: {{cookiecutter._license_info[cookiecutter.license].readme}} 9 | 10 | COOKIECUTTER-TRIO-TODO: finish filling in your README! 11 | Must be valid ReST; also used as the PyPI description. 12 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | EXIT_STATUS=0 6 | 7 | # Autoformatter *first*, to avoid double-reporting errors 8 | black --check setup.py {{cookiecutter.package_name}} \ 9 | || EXIT_STATUS=$? 10 | 11 | # Run flake8 without pycodestyle and import-related errors 12 | flake8 {{cookiecutter.package_name}}/ \ 13 | --ignore=D,E,W,F401,F403,F405,F821,F822\ 14 | || EXIT_STATUS=$? 15 | 16 | # Uncomment to run mypy (to check static typing) 17 | #mypy --strict -p {{cookiecutter.package_name}} || EXIT_STATUS=$? 18 | 19 | # Finally, leave a really clear warning of any issues and exit 20 | if [ $EXIT_STATUS -ne 0 ]; then 21 | cat <= 1.7.0 2 | sphinx_rtd_theme 3 | sphinxcontrib-trio 4 | towncrier 5 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SPHINXPROJ = {{cookiecutter.project_name}} 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_slug}}/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 | set SPHINXPROJ={{cookiecutter.project_name}} 13 | 14 | if "%1" == "" goto help 15 | 16 | %SPHINXBUILD% >NUL 2>NUL 17 | if errorlevel 9009 ( 18 | echo. 19 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 20 | echo.installed, then set the SPHINXBUILD environment variable to point 21 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 22 | echo.may add the Sphinx directory to PATH. 23 | echo. 24 | echo.If you don't have Sphinx installed, grab it from 25 | echo.http://sphinx-doc.org/ 26 | exit /b 1 27 | ) 28 | 29 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 30 | goto end 31 | 32 | :help 33 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 34 | 35 | :end 36 | popd 37 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/source/_static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python-trio/cookiecutter-trio/17f560a4aab0da9be009f1526ca5bcddc47a4c3d/{{cookiecutter.project_slug}}/docs/source/_static/.gitkeep -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/source/conf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Documentation build configuration file, created by 5 | # sphinx-quickstart on Sat Jan 21 19:11:14 2017. 6 | # 7 | # This file is execfile()d with the current directory set to its 8 | # containing dir. 9 | # 10 | # Note that not all possible configuration values are present in this 11 | # autogenerated file. 12 | # 13 | # All configuration values have a default; values that are commented out 14 | # serve to show the default. 15 | 16 | # If extensions (or modules to document with autodoc) are in another directory, 17 | # add these directories to sys.path here. If the directory is relative to the 18 | # documentation root, use os.path.abspath to make it absolute, like shown here. 19 | # 20 | import os 21 | import sys 22 | # So autodoc can import our package 23 | sys.path.insert(0, os.path.abspath('../..')) 24 | 25 | # Warn about all references to unknown targets 26 | nitpicky = True 27 | # Except for these ones, which we expect to point to unknown targets: 28 | nitpick_ignore = [ 29 | # Format is ("sphinx reference type", "string"), e.g.: 30 | ("py:obj", "bytes-like"), 31 | ] 32 | autodoc_inherit_docstrings = False 33 | default_role = "obj" 34 | 35 | # -- General configuration ------------------------------------------------ 36 | 37 | # If your documentation needs a minimal Sphinx version, state it here. 38 | # 39 | # needs_sphinx = '1.0' 40 | 41 | # Add any Sphinx extension module names here, as strings. They can be 42 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 43 | # ones. 44 | extensions = [ 45 | 'sphinx.ext.autodoc', 46 | 'sphinx.ext.intersphinx', 47 | 'sphinx.ext.coverage', 48 | 'sphinx.ext.napoleon', 49 | 'sphinxcontrib_trio', 50 | ] 51 | 52 | intersphinx_mapping = { 53 | "python": ('https://docs.python.org/3', None), 54 | "trio": ('https://trio.readthedocs.io/en/stable', None), 55 | } 56 | 57 | autodoc_member_order = "bysource" 58 | 59 | # Add any paths that contain templates here, relative to this directory. 60 | templates_path = [] 61 | 62 | # The suffix(es) of source filenames. 63 | # You can specify multiple suffix as a list of string: 64 | # 65 | # source_suffix = ['.rst', '.md'] 66 | source_suffix = '.rst' 67 | 68 | # The master toctree document. 69 | master_doc = 'index' 70 | 71 | # General information about the project. 72 | project = '{{ cookiecutter.project_name }}' 73 | copyright = 'The {{ cookiecutter.project_name }} authors' 74 | author = 'The {{ cookiecutter.project_name }} authors' 75 | 76 | # The version info for the project you're documenting, acts as replacement for 77 | # |version| and |release|, also used in various other places throughout the 78 | # built documents. 79 | # 80 | # The short X.Y version. 81 | import {{ cookiecutter.package_name }} 82 | version = {{ cookiecutter.package_name }}.__version__ 83 | # The full version, including alpha/beta/rc tags. 84 | release = version 85 | 86 | # The language for content autogenerated by Sphinx. Refer to documentation 87 | # for a list of supported languages. 88 | # 89 | # This is also used if you do content translation via gettext catalogs. 90 | # Usually you set "language" from the command line for these cases. 91 | language = None 92 | 93 | # List of patterns, relative to source directory, that match files and 94 | # directories to ignore when looking for source files. 95 | # This patterns also effect to html_static_path and html_extra_path 96 | exclude_patterns = [] 97 | 98 | # The name of the Pygments (syntax highlighting) style to use. 99 | pygments_style = 'sphinx' 100 | 101 | # The default language for :: blocks 102 | highlight_language = 'python3' 103 | 104 | # If true, `todo` and `todoList` produce output, else they produce nothing. 105 | todo_include_todos = False 106 | 107 | # Fold return type into the "Returns:" section, rather than making 108 | # a separate "Return type:" section 109 | napoleon_use_rtype = False 110 | 111 | 112 | # -- Options for HTML output ---------------------------------------------- 113 | 114 | # The theme to use for HTML and HTML Help pages. See the documentation for 115 | # a list of builtin themes. 116 | # 117 | #html_theme = 'alabaster' 118 | 119 | # We have to set this ourselves, not only because it's useful for local 120 | # testing, but also because if we don't then RTD will throw away our 121 | # html_theme_options. 122 | import sphinx_rtd_theme 123 | html_theme = 'sphinx_rtd_theme' 124 | html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] 125 | 126 | # Theme options are theme-specific and customize the look and feel of a theme 127 | # further. For a list of options available for each theme, see the 128 | # documentation. 129 | # 130 | html_theme_options = { 131 | # default is 2 132 | # show deeper nesting in the RTD theme's sidebar TOC 133 | # https://stackoverflow.com/questions/27669376/ 134 | # I'm not 100% sure this actually does anything with our current 135 | # versions/settings... 136 | "navigation_depth": 4, 137 | "logo_only": True, 138 | } 139 | 140 | # Add any paths that contain custom static files (such as style sheets) here, 141 | # relative to this directory. They are copied after the builtin static files, 142 | # so a file named "default.css" will overwrite the builtin "default.css". 143 | html_static_path = ['_static'] 144 | 145 | 146 | # -- Options for HTMLHelp output ------------------------------------------ 147 | 148 | # Output file base name for HTML help builder. 149 | htmlhelp_basename = '{{ cookiecutter.project_slug }}doc' 150 | 151 | 152 | # -- Options for LaTeX output --------------------------------------------- 153 | 154 | latex_elements = { 155 | # The paper size ('letterpaper' or 'a4paper'). 156 | # 157 | # 'papersize': 'letterpaper', 158 | 159 | # The font size ('10pt', '11pt' or '12pt'). 160 | # 161 | # 'pointsize': '10pt', 162 | 163 | # Additional stuff for the LaTeX preamble. 164 | # 165 | # 'preamble': '', 166 | 167 | # Latex figure (float) alignment 168 | # 169 | # 'figure_align': 'htbp', 170 | } 171 | 172 | # Grouping the document tree into LaTeX files. List of tuples 173 | # (source start file, target name, title, 174 | # author, documentclass [howto, manual, or own class]). 175 | latex_documents = [ 176 | (master_doc, '{{cookiecutter.project_slug}}.tex', 'Trio Documentation', 177 | author, 'manual'), 178 | ] 179 | 180 | 181 | # -- Options for manual page output --------------------------------------- 182 | 183 | # One entry per manual page. List of tuples 184 | # (source start file, name, description, authors, manual section). 185 | man_pages = [ 186 | (master_doc, '{{ cookiecutter.project_slug}}', '{{cookiecutter.project_name}} Documentation', 187 | [author], 1) 188 | ] 189 | 190 | 191 | # -- Options for Texinfo output ------------------------------------------- 192 | 193 | # Grouping the document tree into Texinfo files. List of tuples 194 | # (source start file, target name, title, author, 195 | # dir menu entry, description, category) 196 | texinfo_documents = [ 197 | (master_doc, '{{ cookiecutter.project_slug}}', '{{cookiecutter.project_name}} Documentation', 198 | author, '{{cookiecutter.project_name}}', '{{cookiecutter.project_short_description}}', 199 | 'Miscellaneous'), 200 | ] 201 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/source/history.rst: -------------------------------------------------------------------------------- 1 | Release history 2 | =============== 3 | 4 | .. currentmodule:: {{cookiecutter.package_name}} 5 | 6 | .. towncrier release notes start 7 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. documentation master file, created by 2 | sphinx-quickstart on Sat Jan 21 19:11:14 2017. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | 7 | {% set title = "{}: {}".format(cookiecutter.project_name, cookiecutter.project_short_description) -%} 8 | {{ "=" * title.__len__() }} 9 | {{ title }} 10 | {{ "=" * title.__len__() }} 11 | 12 | .. toctree:: 13 | :maxdepth: 2 14 | 15 | history.rst 16 | 17 | ==================== 18 | Indices and tables 19 | ==================== 20 | 21 | * :ref:`genindex` 22 | * :ref:`modindex` 23 | * :ref:`search` 24 | * :ref:`glossary` 25 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/license-files/dual-mit-apache2/LICENSE: -------------------------------------------------------------------------------- 1 | This software is made available under the terms of *either* of the 2 | licenses found in LICENSE.APACHE2 or LICENSE.MIT. Contributions to are 3 | made under the terms of *both* these licenses. 4 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/license-files/dual-mit-apache2/LICENSE.APACHE2: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/license-files/dual-mit-apache2/LICENSE.MIT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/license-files/gplv3+/LICENSE: -------------------------------------------------------------------------------- 1 | This program is free software: you can redistribute it and/or modify 2 | it under the terms of the GNU General Public License as published by 3 | the Free Software Foundation, either version 3 of the License, or 4 | (at your option) any later version. 5 | 6 | Full license follows: 7 | 8 | GNU GENERAL PUBLIC LICENSE 9 | Version 3, 29 June 2007 10 | 11 | Copyright (C) 2007 Free Software Foundation, Inc. 12 | Everyone is permitted to copy and distribute verbatim copies 13 | of this license document, but changing it is not allowed. 14 | 15 | Preamble 16 | 17 | The GNU General Public License is a free, copyleft license for 18 | software and other kinds of works. 19 | 20 | The licenses for most software and other practical works are designed 21 | to take away your freedom to share and change the works. By contrast, 22 | the GNU General Public License is intended to guarantee your freedom to 23 | share and change all versions of a program--to make sure it remains free 24 | software for all its users. We, the Free Software Foundation, use the 25 | GNU General Public License for most of our software; it applies also to 26 | any other work released this way by its authors. You can apply it to 27 | your programs, too. 28 | 29 | When we speak of free software, we are referring to freedom, not 30 | price. Our General Public Licenses are designed to make sure that you 31 | have the freedom to distribute copies of free software (and charge for 32 | them if you wish), that you receive source code or can get it if you 33 | want it, that you can change the software or use pieces of it in new 34 | free programs, and that you know you can do these things. 35 | 36 | To protect your rights, we need to prevent others from denying you 37 | these rights or asking you to surrender the rights. Therefore, you have 38 | certain responsibilities if you distribute copies of the software, or if 39 | you modify it: responsibilities to respect the freedom of others. 40 | 41 | For example, if you distribute copies of such a program, whether 42 | gratis or for a fee, you must pass on to the recipients the same 43 | freedoms that you received. You must make sure that they, too, receive 44 | or can get the source code. And you must show them these terms so they 45 | know their rights. 46 | 47 | Developers that use the GNU GPL protect your rights with two steps: 48 | (1) assert copyright on the software, and (2) offer you this License 49 | giving you legal permission to copy, distribute and/or modify it. 50 | 51 | For the developers' and authors' protection, the GPL clearly explains 52 | that there is no warranty for this free software. For both users' and 53 | authors' sake, the GPL requires that modified versions be marked as 54 | changed, so that their problems will not be attributed erroneously to 55 | authors of previous versions. 56 | 57 | Some devices are designed to deny users access to install or run 58 | modified versions of the software inside them, although the manufacturer 59 | can do so. This is fundamentally incompatible with the aim of 60 | protecting users' freedom to change the software. The systematic 61 | pattern of such abuse occurs in the area of products for individuals to 62 | use, which is precisely where it is most unacceptable. Therefore, we 63 | have designed this version of the GPL to prohibit the practice for those 64 | products. If such problems arise substantially in other domains, we 65 | stand ready to extend this provision to those domains in future versions 66 | of the GPL, as needed to protect the freedom of users. 67 | 68 | Finally, every program is threatened constantly by software patents. 69 | States should not allow patents to restrict development and use of 70 | software on general-purpose computers, but in those that do, we wish to 71 | avoid the special danger that patents applied to a free program could 72 | make it effectively proprietary. To prevent this, the GPL assures that 73 | patents cannot be used to render the program non-free. 74 | 75 | The precise terms and conditions for copying, distribution and 76 | modification follow. 77 | 78 | TERMS AND CONDITIONS 79 | 80 | 0. Definitions. 81 | 82 | "This License" refers to version 3 of the GNU General Public License. 83 | 84 | "Copyright" also means copyright-like laws that apply to other kinds of 85 | works, such as semiconductor masks. 86 | 87 | "The Program" refers to any copyrightable work licensed under this 88 | License. Each licensee is addressed as "you". "Licensees" and 89 | "recipients" may be individuals or organizations. 90 | 91 | To "modify" a work means to copy from or adapt all or part of the work 92 | in a fashion requiring copyright permission, other than the making of an 93 | exact copy. The resulting work is called a "modified version" of the 94 | earlier work or a work "based on" the earlier work. 95 | 96 | A "covered work" means either the unmodified Program or a work based 97 | on the Program. 98 | 99 | To "propagate" a work means to do anything with it that, without 100 | permission, would make you directly or secondarily liable for 101 | infringement under applicable copyright law, except executing it on a 102 | computer or modifying a private copy. Propagation includes copying, 103 | distribution (with or without modification), making available to the 104 | public, and in some countries other activities as well. 105 | 106 | To "convey" a work means any kind of propagation that enables other 107 | parties to make or receive copies. Mere interaction with a user through 108 | a computer network, with no transfer of a copy, is not conveying. 109 | 110 | An interactive user interface displays "Appropriate Legal Notices" 111 | to the extent that it includes a convenient and prominently visible 112 | feature that (1) displays an appropriate copyright notice, and (2) 113 | tells the user that there is no warranty for the work (except to the 114 | extent that warranties are provided), that licensees may convey the 115 | work under this License, and how to view a copy of this License. If 116 | the interface presents a list of user commands or options, such as a 117 | menu, a prominent item in the list meets this criterion. 118 | 119 | 1. Source Code. 120 | 121 | The "source code" for a work means the preferred form of the work 122 | for making modifications to it. "Object code" means any non-source 123 | form of a work. 124 | 125 | A "Standard Interface" means an interface that either is an official 126 | standard defined by a recognized standards body, or, in the case of 127 | interfaces specified for a particular programming language, one that 128 | is widely used among developers working in that language. 129 | 130 | The "System Libraries" of an executable work include anything, other 131 | than the work as a whole, that (a) is included in the normal form of 132 | packaging a Major Component, but which is not part of that Major 133 | Component, and (b) serves only to enable use of the work with that 134 | Major Component, or to implement a Standard Interface for which an 135 | implementation is available to the public in source code form. A 136 | "Major Component", in this context, means a major essential component 137 | (kernel, window system, and so on) of the specific operating system 138 | (if any) on which the executable work runs, or a compiler used to 139 | produce the work, or an object code interpreter used to run it. 140 | 141 | The "Corresponding Source" for a work in object code form means all 142 | the source code needed to generate, install, and (for an executable 143 | work) run the object code and to modify the work, including scripts to 144 | control those activities. However, it does not include the work's 145 | System Libraries, or general-purpose tools or generally available free 146 | programs which are used unmodified in performing those activities but 147 | which are not part of the work. For example, Corresponding Source 148 | includes interface definition files associated with source files for 149 | the work, and the source code for shared libraries and dynamically 150 | linked subprograms that the work is specifically designed to require, 151 | such as by intimate data communication or control flow between those 152 | subprograms and other parts of the work. 153 | 154 | The Corresponding Source need not include anything that users 155 | can regenerate automatically from other parts of the Corresponding 156 | Source. 157 | 158 | The Corresponding Source for a work in source code form is that 159 | same work. 160 | 161 | 2. Basic Permissions. 162 | 163 | All rights granted under this License are granted for the term of 164 | copyright on the Program, and are irrevocable provided the stated 165 | conditions are met. This License explicitly affirms your unlimited 166 | permission to run the unmodified Program. The output from running a 167 | covered work is covered by this License only if the output, given its 168 | content, constitutes a covered work. This License acknowledges your 169 | rights of fair use or other equivalent, as provided by copyright law. 170 | 171 | You may make, run and propagate covered works that you do not 172 | convey, without conditions so long as your license otherwise remains 173 | in force. You may convey covered works to others for the sole purpose 174 | of having them make modifications exclusively for you, or provide you 175 | with facilities for running those works, provided that you comply with 176 | the terms of this License in conveying all material for which you do 177 | not control copyright. Those thus making or running the covered works 178 | for you must do so exclusively on your behalf, under your direction 179 | and control, on terms that prohibit them from making any copies of 180 | your copyrighted material outside their relationship with you. 181 | 182 | Conveying under any other circumstances is permitted solely under 183 | the conditions stated below. Sublicensing is not allowed; section 10 184 | makes it unnecessary. 185 | 186 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 187 | 188 | No covered work shall be deemed part of an effective technological 189 | measure under any applicable law fulfilling obligations under article 190 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 191 | similar laws prohibiting or restricting circumvention of such 192 | measures. 193 | 194 | When you convey a covered work, you waive any legal power to forbid 195 | circumvention of technological measures to the extent such circumvention 196 | is effected by exercising rights under this License with respect to 197 | the covered work, and you disclaim any intention to limit operation or 198 | modification of the work as a means of enforcing, against the work's 199 | users, your or third parties' legal rights to forbid circumvention of 200 | technological measures. 201 | 202 | 4. Conveying Verbatim Copies. 203 | 204 | You may convey verbatim copies of the Program's source code as you 205 | receive it, in any medium, provided that you conspicuously and 206 | appropriately publish on each copy an appropriate copyright notice; 207 | keep intact all notices stating that this License and any 208 | non-permissive terms added in accord with section 7 apply to the code; 209 | keep intact all notices of the absence of any warranty; and give all 210 | recipients a copy of this License along with the Program. 211 | 212 | You may charge any price or no price for each copy that you convey, 213 | and you may offer support or warranty protection for a fee. 214 | 215 | 5. Conveying Modified Source Versions. 216 | 217 | You may convey a work based on the Program, or the modifications to 218 | produce it from the Program, in the form of source code under the 219 | terms of section 4, provided that you also meet all of these conditions: 220 | 221 | a) The work must carry prominent notices stating that you modified 222 | it, and giving a relevant date. 223 | 224 | b) The work must carry prominent notices stating that it is 225 | released under this License and any conditions added under section 226 | 7. This requirement modifies the requirement in section 4 to 227 | "keep intact all notices". 228 | 229 | c) You must license the entire work, as a whole, under this 230 | License to anyone who comes into possession of a copy. This 231 | License will therefore apply, along with any applicable section 7 232 | additional terms, to the whole of the work, and all its parts, 233 | regardless of how they are packaged. This License gives no 234 | permission to license the work in any other way, but it does not 235 | invalidate such permission if you have separately received it. 236 | 237 | d) If the work has interactive user interfaces, each must display 238 | Appropriate Legal Notices; however, if the Program has interactive 239 | interfaces that do not display Appropriate Legal Notices, your 240 | work need not make them do so. 241 | 242 | A compilation of a covered work with other separate and independent 243 | works, which are not by their nature extensions of the covered work, 244 | and which are not combined with it such as to form a larger program, 245 | in or on a volume of a storage or distribution medium, is called an 246 | "aggregate" if the compilation and its resulting copyright are not 247 | used to limit the access or legal rights of the compilation's users 248 | beyond what the individual works permit. Inclusion of a covered work 249 | in an aggregate does not cause this License to apply to the other 250 | parts of the aggregate. 251 | 252 | 6. Conveying Non-Source Forms. 253 | 254 | You may convey a covered work in object code form under the terms 255 | of sections 4 and 5, provided that you also convey the 256 | machine-readable Corresponding Source under the terms of this License, 257 | in one of these ways: 258 | 259 | a) Convey the object code in, or embodied in, a physical product 260 | (including a physical distribution medium), accompanied by the 261 | Corresponding Source fixed on a durable physical medium 262 | customarily used for software interchange. 263 | 264 | b) Convey the object code in, or embodied in, a physical product 265 | (including a physical distribution medium), accompanied by a 266 | written offer, valid for at least three years and valid for as 267 | long as you offer spare parts or customer support for that product 268 | model, to give anyone who possesses the object code either (1) a 269 | copy of the Corresponding Source for all the software in the 270 | product that is covered by this License, on a durable physical 271 | medium customarily used for software interchange, for a price no 272 | more than your reasonable cost of physically performing this 273 | conveying of source, or (2) access to copy the 274 | Corresponding Source from a network server at no charge. 275 | 276 | c) Convey individual copies of the object code with a copy of the 277 | written offer to provide the Corresponding Source. This 278 | alternative is allowed only occasionally and noncommercially, and 279 | only if you received the object code with such an offer, in accord 280 | with subsection 6b. 281 | 282 | d) Convey the object code by offering access from a designated 283 | place (gratis or for a charge), and offer equivalent access to the 284 | Corresponding Source in the same way through the same place at no 285 | further charge. You need not require recipients to copy the 286 | Corresponding Source along with the object code. If the place to 287 | copy the object code is a network server, the Corresponding Source 288 | may be on a different server (operated by you or a third party) 289 | that supports equivalent copying facilities, provided you maintain 290 | clear directions next to the object code saying where to find the 291 | Corresponding Source. Regardless of what server hosts the 292 | Corresponding Source, you remain obligated to ensure that it is 293 | available for as long as needed to satisfy these requirements. 294 | 295 | e) Convey the object code using peer-to-peer transmission, provided 296 | you inform other peers where the object code and Corresponding 297 | Source of the work are being offered to the general public at no 298 | charge under subsection 6d. 299 | 300 | A separable portion of the object code, whose source code is excluded 301 | from the Corresponding Source as a System Library, need not be 302 | included in conveying the object code work. 303 | 304 | A "User Product" is either (1) a "consumer product", which means any 305 | tangible personal property which is normally used for personal, family, 306 | or household purposes, or (2) anything designed or sold for incorporation 307 | into a dwelling. In determining whether a product is a consumer product, 308 | doubtful cases shall be resolved in favor of coverage. For a particular 309 | product received by a particular user, "normally used" refers to a 310 | typical or common use of that class of product, regardless of the status 311 | of the particular user or of the way in which the particular user 312 | actually uses, or expects or is expected to use, the product. A product 313 | is a consumer product regardless of whether the product has substantial 314 | commercial, industrial or non-consumer uses, unless such uses represent 315 | the only significant mode of use of the product. 316 | 317 | "Installation Information" for a User Product means any methods, 318 | procedures, authorization keys, or other information required to install 319 | and execute modified versions of a covered work in that User Product from 320 | a modified version of its Corresponding Source. The information must 321 | suffice to ensure that the continued functioning of the modified object 322 | code is in no case prevented or interfered with solely because 323 | modification has been made. 324 | 325 | If you convey an object code work under this section in, or with, or 326 | specifically for use in, a User Product, and the conveying occurs as 327 | part of a transaction in which the right of possession and use of the 328 | User Product is transferred to the recipient in perpetuity or for a 329 | fixed term (regardless of how the transaction is characterized), the 330 | Corresponding Source conveyed under this section must be accompanied 331 | by the Installation Information. But this requirement does not apply 332 | if neither you nor any third party retains the ability to install 333 | modified object code on the User Product (for example, the work has 334 | been installed in ROM). 335 | 336 | The requirement to provide Installation Information does not include a 337 | requirement to continue to provide support service, warranty, or updates 338 | for a work that has been modified or installed by the recipient, or for 339 | the User Product in which it has been modified or installed. Access to a 340 | network may be denied when the modification itself materially and 341 | adversely affects the operation of the network or violates the rules and 342 | protocols for communication across the network. 343 | 344 | Corresponding Source conveyed, and Installation Information provided, 345 | in accord with this section must be in a format that is publicly 346 | documented (and with an implementation available to the public in 347 | source code form), and must require no special password or key for 348 | unpacking, reading or copying. 349 | 350 | 7. Additional Terms. 351 | 352 | "Additional permissions" are terms that supplement the terms of this 353 | License by making exceptions from one or more of its conditions. 354 | Additional permissions that are applicable to the entire Program shall 355 | be treated as though they were included in this License, to the extent 356 | that they are valid under applicable law. If additional permissions 357 | apply only to part of the Program, that part may be used separately 358 | under those permissions, but the entire Program remains governed by 359 | this License without regard to the additional permissions. 360 | 361 | When you convey a copy of a covered work, you may at your option 362 | remove any additional permissions from that copy, or from any part of 363 | it. (Additional permissions may be written to require their own 364 | removal in certain cases when you modify the work.) You may place 365 | additional permissions on material, added by you to a covered work, 366 | for which you have or can give appropriate copyright permission. 367 | 368 | Notwithstanding any other provision of this License, for material you 369 | add to a covered work, you may (if authorized by the copyright holders of 370 | that material) supplement the terms of this License with terms: 371 | 372 | a) Disclaiming warranty or limiting liability differently from the 373 | terms of sections 15 and 16 of this License; or 374 | 375 | b) Requiring preservation of specified reasonable legal notices or 376 | author attributions in that material or in the Appropriate Legal 377 | Notices displayed by works containing it; or 378 | 379 | c) Prohibiting misrepresentation of the origin of that material, or 380 | requiring that modified versions of such material be marked in 381 | reasonable ways as different from the original version; or 382 | 383 | d) Limiting the use for publicity purposes of names of licensors or 384 | authors of the material; or 385 | 386 | e) Declining to grant rights under trademark law for use of some 387 | trade names, trademarks, or service marks; or 388 | 389 | f) Requiring indemnification of licensors and authors of that 390 | material by anyone who conveys the material (or modified versions of 391 | it) with contractual assumptions of liability to the recipient, for 392 | any liability that these contractual assumptions directly impose on 393 | those licensors and authors. 394 | 395 | All other non-permissive additional terms are considered "further 396 | restrictions" within the meaning of section 10. If the Program as you 397 | received it, or any part of it, contains a notice stating that it is 398 | governed by this License along with a term that is a further 399 | restriction, you may remove that term. If a license document contains 400 | a further restriction but permits relicensing or conveying under this 401 | License, you may add to a covered work material governed by the terms 402 | of that license document, provided that the further restriction does 403 | not survive such relicensing or conveying. 404 | 405 | If you add terms to a covered work in accord with this section, you 406 | must place, in the relevant source files, a statement of the 407 | additional terms that apply to those files, or a notice indicating 408 | where to find the applicable terms. 409 | 410 | Additional terms, permissive or non-permissive, may be stated in the 411 | form of a separately written license, or stated as exceptions; 412 | the above requirements apply either way. 413 | 414 | 8. Termination. 415 | 416 | You may not propagate or modify a covered work except as expressly 417 | provided under this License. Any attempt otherwise to propagate or 418 | modify it is void, and will automatically terminate your rights under 419 | this License (including any patent licenses granted under the third 420 | paragraph of section 11). 421 | 422 | However, if you cease all violation of this License, then your 423 | license from a particular copyright holder is reinstated (a) 424 | provisionally, unless and until the copyright holder explicitly and 425 | finally terminates your license, and (b) permanently, if the copyright 426 | holder fails to notify you of the violation by some reasonable means 427 | prior to 60 days after the cessation. 428 | 429 | Moreover, your license from a particular copyright holder is 430 | reinstated permanently if the copyright holder notifies you of the 431 | violation by some reasonable means, this is the first time you have 432 | received notice of violation of this License (for any work) from that 433 | copyright holder, and you cure the violation prior to 30 days after 434 | your receipt of the notice. 435 | 436 | Termination of your rights under this section does not terminate the 437 | licenses of parties who have received copies or rights from you under 438 | this License. If your rights have been terminated and not permanently 439 | reinstated, you do not qualify to receive new licenses for the same 440 | material under section 10. 441 | 442 | 9. Acceptance Not Required for Having Copies. 443 | 444 | You are not required to accept this License in order to receive or 445 | run a copy of the Program. Ancillary propagation of a covered work 446 | occurring solely as a consequence of using peer-to-peer transmission 447 | to receive a copy likewise does not require acceptance. However, 448 | nothing other than this License grants you permission to propagate or 449 | modify any covered work. These actions infringe copyright if you do 450 | not accept this License. Therefore, by modifying or propagating a 451 | covered work, you indicate your acceptance of this License to do so. 452 | 453 | 10. Automatic Licensing of Downstream Recipients. 454 | 455 | Each time you convey a covered work, the recipient automatically 456 | receives a license from the original licensors, to run, modify and 457 | propagate that work, subject to this License. You are not responsible 458 | for enforcing compliance by third parties with this License. 459 | 460 | An "entity transaction" is a transaction transferring control of an 461 | organization, or substantially all assets of one, or subdividing an 462 | organization, or merging organizations. If propagation of a covered 463 | work results from an entity transaction, each party to that 464 | transaction who receives a copy of the work also receives whatever 465 | licenses to the work the party's predecessor in interest had or could 466 | give under the previous paragraph, plus a right to possession of the 467 | Corresponding Source of the work from the predecessor in interest, if 468 | the predecessor has it or can get it with reasonable efforts. 469 | 470 | You may not impose any further restrictions on the exercise of the 471 | rights granted or affirmed under this License. For example, you may 472 | not impose a license fee, royalty, or other charge for exercise of 473 | rights granted under this License, and you may not initiate litigation 474 | (including a cross-claim or counterclaim in a lawsuit) alleging that 475 | any patent claim is infringed by making, using, selling, offering for 476 | sale, or importing the Program or any portion of it. 477 | 478 | 11. Patents. 479 | 480 | A "contributor" is a copyright holder who authorizes use under this 481 | License of the Program or a work on which the Program is based. The 482 | work thus licensed is called the contributor's "contributor version". 483 | 484 | A contributor's "essential patent claims" are all patent claims 485 | owned or controlled by the contributor, whether already acquired or 486 | hereafter acquired, that would be infringed by some manner, permitted 487 | by this License, of making, using, or selling its contributor version, 488 | but do not include claims that would be infringed only as a 489 | consequence of further modification of the contributor version. For 490 | purposes of this definition, "control" includes the right to grant 491 | patent sublicenses in a manner consistent with the requirements of 492 | this License. 493 | 494 | Each contributor grants you a non-exclusive, worldwide, royalty-free 495 | patent license under the contributor's essential patent claims, to 496 | make, use, sell, offer for sale, import and otherwise run, modify and 497 | propagate the contents of its contributor version. 498 | 499 | In the following three paragraphs, a "patent license" is any express 500 | agreement or commitment, however denominated, not to enforce a patent 501 | (such as an express permission to practice a patent or covenant not to 502 | sue for patent infringement). To "grant" such a patent license to a 503 | party means to make such an agreement or commitment not to enforce a 504 | patent against the party. 505 | 506 | If you convey a covered work, knowingly relying on a patent license, 507 | and the Corresponding Source of the work is not available for anyone 508 | to copy, free of charge and under the terms of this License, through a 509 | publicly available network server or other readily accessible means, 510 | then you must either (1) cause the Corresponding Source to be so 511 | available, or (2) arrange to deprive yourself of the benefit of the 512 | patent license for this particular work, or (3) arrange, in a manner 513 | consistent with the requirements of this License, to extend the patent 514 | license to downstream recipients. "Knowingly relying" means you have 515 | actual knowledge that, but for the patent license, your conveying the 516 | covered work in a country, or your recipient's use of the covered work 517 | in a country, would infringe one or more identifiable patents in that 518 | country that you have reason to believe are valid. 519 | 520 | If, pursuant to or in connection with a single transaction or 521 | arrangement, you convey, or propagate by procuring conveyance of, a 522 | covered work, and grant a patent license to some of the parties 523 | receiving the covered work authorizing them to use, propagate, modify 524 | or convey a specific copy of the covered work, then the patent license 525 | you grant is automatically extended to all recipients of the covered 526 | work and works based on it. 527 | 528 | A patent license is "discriminatory" if it does not include within 529 | the scope of its coverage, prohibits the exercise of, or is 530 | conditioned on the non-exercise of one or more of the rights that are 531 | specifically granted under this License. You may not convey a covered 532 | work if you are a party to an arrangement with a third party that is 533 | in the business of distributing software, under which you make payment 534 | to the third party based on the extent of your activity of conveying 535 | the work, and under which the third party grants, to any of the 536 | parties who would receive the covered work from you, a discriminatory 537 | patent license (a) in connection with copies of the covered work 538 | conveyed by you (or copies made from those copies), or (b) primarily 539 | for and in connection with specific products or compilations that 540 | contain the covered work, unless you entered into that arrangement, 541 | or that patent license was granted, prior to 28 March 2007. 542 | 543 | Nothing in this License shall be construed as excluding or limiting 544 | any implied license or other defenses to infringement that may 545 | otherwise be available to you under applicable patent law. 546 | 547 | 12. No Surrender of Others' Freedom. 548 | 549 | If conditions are imposed on you (whether by court order, agreement or 550 | otherwise) that contradict the conditions of this License, they do not 551 | excuse you from the conditions of this License. If you cannot convey a 552 | covered work so as to satisfy simultaneously your obligations under this 553 | License and any other pertinent obligations, then as a consequence you may 554 | not convey it at all. For example, if you agree to terms that obligate you 555 | to collect a royalty for further conveying from those to whom you convey 556 | the Program, the only way you could satisfy both those terms and this 557 | License would be to refrain entirely from conveying the Program. 558 | 559 | 13. Use with the GNU Affero General Public License. 560 | 561 | Notwithstanding any other provision of this License, you have 562 | permission to link or combine any covered work with a work licensed 563 | under version 3 of the GNU Affero General Public License into a single 564 | combined work, and to convey the resulting work. The terms of this 565 | License will continue to apply to the part which is the covered work, 566 | but the special requirements of the GNU Affero General Public License, 567 | section 13, concerning interaction through a network will apply to the 568 | combination as such. 569 | 570 | 14. Revised Versions of this License. 571 | 572 | The Free Software Foundation may publish revised and/or new versions of 573 | the GNU General Public License from time to time. Such new versions will 574 | be similar in spirit to the present version, but may differ in detail to 575 | address new problems or concerns. 576 | 577 | Each version is given a distinguishing version number. If the 578 | Program specifies that a certain numbered version of the GNU General 579 | Public License "or any later version" applies to it, you have the 580 | option of following the terms and conditions either of that numbered 581 | version or of any later version published by the Free Software 582 | Foundation. If the Program does not specify a version number of the 583 | GNU General Public License, you may choose any version ever published 584 | by the Free Software Foundation. 585 | 586 | If the Program specifies that a proxy can decide which future 587 | versions of the GNU General Public License can be used, that proxy's 588 | public statement of acceptance of a version permanently authorizes you 589 | to choose that version for the Program. 590 | 591 | Later license versions may give you additional or different 592 | permissions. However, no additional obligations are imposed on any 593 | author or copyright holder as a result of your choosing to follow a 594 | later version. 595 | 596 | 15. Disclaimer of Warranty. 597 | 598 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 599 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 600 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 601 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 602 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 603 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 604 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 605 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 606 | 607 | 16. Limitation of Liability. 608 | 609 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 610 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 611 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 612 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 613 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 614 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 615 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 616 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 617 | SUCH DAMAGES. 618 | 619 | 17. Interpretation of Sections 15 and 16. 620 | 621 | If the disclaimer of warranty and limitation of liability provided 622 | above cannot be given local legal effect according to their terms, 623 | reviewing courts shall apply local law that most closely approximates 624 | an absolute waiver of all civil liability in connection with the 625 | Program, unless a warranty or assumption of liability accompanies a 626 | copy of the Program in return for a fee. 627 | 628 | END OF TERMS AND CONDITIONS 629 | 630 | How to Apply These Terms to Your New Programs 631 | 632 | If you develop a new program, and you want it to be of the greatest 633 | possible use to the public, the best way to achieve this is to make it 634 | free software which everyone can redistribute and change under these terms. 635 | 636 | To do so, attach the following notices to the program. It is safest 637 | to attach them to the start of each source file to most effectively 638 | state the exclusion of warranty; and each file should have at least 639 | the "copyright" line and a pointer to where the full notice is found. 640 | 641 | 642 | Copyright (C) 643 | 644 | This program is free software: you can redistribute it and/or modify 645 | it under the terms of the GNU General Public License as published by 646 | the Free Software Foundation, either version 3 of the License, or 647 | (at your option) any later version. 648 | 649 | This program is distributed in the hope that it will be useful, 650 | but WITHOUT ANY WARRANTY; without even the implied warranty of 651 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 652 | GNU General Public License for more details. 653 | 654 | You should have received a copy of the GNU General Public License 655 | along with this program. If not, see . 656 | 657 | Also add information on how to contact you by electronic and paper mail. 658 | 659 | If the program does terminal interaction, make it output a short 660 | notice like this when it starts in an interactive mode: 661 | 662 | Copyright (C) 663 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 664 | This is free software, and you are welcome to redistribute it 665 | under certain conditions; type `show c' for details. 666 | 667 | The hypothetical commands `show w' and `show c' should show the appropriate 668 | parts of the General Public License. Of course, your program's commands 669 | might be different; for a GUI interface, you would use an "about box". 670 | 671 | You should also get your employer (if you work as a programmer) or school, 672 | if any, to sign a "copyright disclaimer" for the program, if necessary. 673 | For more information on this, and how to apply and follow the GNU GPL, see 674 | . 675 | 676 | The GNU General Public License does not permit incorporating your program 677 | into proprietary programs. If your program is a subroutine library, you 678 | may consider it more useful to permit linking proprietary applications with 679 | the library. If this is what you want to do, use the GNU Lesser General 680 | Public License instead of this License. But first, please read 681 | . 682 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/license-files/other/LICENSE-IS-MISSING: -------------------------------------------------------------------------------- 1 | COOKIECUTTER-TRIO-TODO: add a LICENSE file and record your choice in setup.py and README.rst. 2 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | implicit_reexport = True 3 | 4 | [mypy-{{cookiecutter.package_name}}._tests.*] 5 | # Allow tests to not use type hints (but still check them if they do) 6 | allow_untyped_defs = True 7 | allow_untyped_calls = True 8 | check_untyped_defs = False 9 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/newsfragments/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python-trio/cookiecutter-trio/17f560a4aab0da9be009f1526ca5bcddc47a4c3d/{{cookiecutter.project_slug}}/newsfragments/.gitkeep -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/newsfragments/README.rst: -------------------------------------------------------------------------------- 1 | Adding newsfragments 2 | ==================== 3 | 4 | This directory collects "newsfragments": short files that each contain 5 | a snippet of ReST-formatted text that will be added to the next 6 | release notes. This should be a description of aspects of the change 7 | (if any) that are relevant to users. (This contrasts with your commit 8 | message and PR description, which are a description of the change as 9 | relevant to people working on the code itself.) 10 | 11 | Each file should be named like ``..rst``, where 12 | ```` is an issue numbers, and ```` is one of: 13 | 14 | * ``feature`` 15 | * ``bugfix`` 16 | * ``doc`` 17 | * ``removal`` 18 | * ``misc`` 19 | 20 | So for example: ``123.feature.rst``, ``456.bugfix.rst`` 21 | 22 | If your PR fixes an issue, use that number here. If there is no issue, 23 | then after you submit the PR and get the PR number you can add a 24 | newsfragment using that instead. 25 | 26 | Note that the ``towncrier`` tool will automatically 27 | reflow your text, so don't try to do any fancy formatting. You can 28 | install ``towncrier`` and then run ``towncrier --draft`` if you want 29 | to get a preview of how your change will look in the final release 30 | notes. 31 | 32 | 33 | Making releases 34 | =============== 35 | 36 | ``pip install towncrier``, then run ``towncrier``. (You can use 37 | ``towncrier --draft`` to get a preview of what this will do.) 38 | 39 | You can configure ``towncrier`` (for example: customizing the 40 | different types of changes) by modifying ``pyproject.toml``. 41 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.towncrier] 2 | package = "{{cookiecutter.package_name}}" 3 | filename = "docs/source/history.rst" 4 | directory = "newsfragments" 5 | underlines = ["-", "~", "^"] 6 | # COOKIECUTTER-TRIO-TODO: fill in the URL below to point to your issue tracker: 7 | issue_format = "`#{issue} `__" 8 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/setup.cfg: -------------------------------------------------------------------------------- 1 | [tool:pytest] 2 | xfail_strict = true 3 | faulthandler_timeout=60 4 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | exec(open("{{cookiecutter.package_name}}/_version.py", encoding="utf-8").read()) 4 | 5 | LONG_DESC = open("README.rst", encoding="utf-8").read() 6 | 7 | setup( 8 | name="{{cookiecutter.project_slug}}", 9 | version=__version__, 10 | description="{{cookiecutter.project_short_description}}", 11 | url="{{cookiecutter.project_url}}", 12 | long_description=LONG_DESC, 13 | author="{{cookiecutter.full_name}}", 14 | author_email="{{cookiecutter.email}}", 15 | license="{{cookiecutter._license_info[cookiecutter.license].license_field}}", 16 | packages=find_packages(), 17 | include_package_data=True, 18 | install_requires=["trio"], 19 | keywords=[ 20 | # COOKIECUTTER-TRIO-TODO: add some keywords 21 | # "async", "io", "networking", ... 22 | ], 23 | python_requires=">={{ cookiecutter.earliest_supported_python }}", 24 | classifiers=[ 25 | {% for classifier in cookiecutter["_license_info"][cookiecutter.license]["trove"] -%} 26 | "{{classifier}}", 27 | {% endfor -%} 28 | "Framework :: Trio", 29 | # COOKIECUTTER-TRIO-TODO: Remove any of these classifiers that don't 30 | # apply: 31 | "Operating System :: POSIX :: Linux", 32 | "Operating System :: MacOS :: MacOS X", 33 | "Operating System :: Microsoft :: Windows", 34 | "Programming Language :: Python :: 3 :: Only", 35 | "Programming Language :: Python :: Implementation :: CPython", 36 | "Programming Language :: Python :: Implementation :: PyPy", 37 | # COOKIECUTTER-TRIO-TODO: Consider adding trove classifiers for: 38 | # 39 | # - Development Status 40 | # - Intended Audience 41 | # - Topic 42 | # 43 | # For the full list of options, see: 44 | # https://pypi.org/classifiers/ 45 | ], 46 | ) 47 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/test-requirements.txt: -------------------------------------------------------------------------------- 1 | # Testing 2 | pytest 3 | pytest-cov 4 | pytest-trio 5 | 6 | # Tools 7 | black == 19.10b0; implementation_name == "cpython" 8 | #mypy >= 0.750; implementation_name == "cpython" 9 | flake8 10 | 11 | # typed-ast is required by black + mypy and doesn't build on PyPy; 12 | # it will be unconstrained in requirements.txt if we don't 13 | # constrain it here 14 | typed-ast; implementation_name == "cpython" 15 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/{{cookiecutter.package_name}}/__init__.py: -------------------------------------------------------------------------------- 1 | """Top-level package for {{ cookiecutter.project_name }}.""" 2 | 3 | from ._version import __version__ 4 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/{{cookiecutter.package_name}}/_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python-trio/cookiecutter-trio/17f560a4aab0da9be009f1526ca5bcddc47a4c3d/{{cookiecutter.project_slug}}/{{cookiecutter.package_name}}/_tests/__init__.py -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/{{cookiecutter.package_name}}/_tests/conftest.py: -------------------------------------------------------------------------------- 1 | from pytest_trio.enable_trio_mode import * 2 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/{{cookiecutter.package_name}}/_tests/test_example.py: -------------------------------------------------------------------------------- 1 | import trio 2 | 3 | # We can just use 'async def test_*' to define async tests. 4 | # This also uses a virtual clock fixture, so time passes quickly and 5 | # predictably. 6 | async def test_sleep_with_autojump_clock(autojump_clock): 7 | assert trio.current_time() == 0 8 | 9 | for i in range(10): 10 | print("Sleeping {} seconds".format(i)) 11 | start_time = trio.current_time() 12 | await trio.sleep(i) 13 | end_time = trio.current_time() 14 | 15 | assert end_time - start_time == i 16 | -------------------------------------------------------------------------------- /{{cookiecutter.project_slug}}/{{cookiecutter.package_name}}/_version.py: -------------------------------------------------------------------------------- 1 | # This file is imported from __init__.py and exec'd from setup.py 2 | 3 | __version__ = "0.0.0" 4 | --------------------------------------------------------------------------------