Commit

Initial commit
Daniel Moch committed 5 years ago (Tree)

Diffstat

 LICENSE | 21 
 cookiecutter.json | 13 
 {{cookiecutter.project_slug}}/LICENSE | 111 
 {{cookiecutter.project_slug}}/README.md | 7 
 {{cookiecutter.project_slug}}/pyproject.toml | 21 
 {{cookiecutter.project_slug}}/tests/__init__.py | 3 
 {{cookiecutter.project_slug}}/tests/test_{{cookiecutter.project_slug}}.py | 56 
 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/__init__.py | 8 
 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}.py | 3 

LICENSE (created)

1 +The MIT License (MIT)
2 +
3 +Copyright (c) 2018 Daniel Moch
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in
13 +all copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 +THE SOFTWARE.

cookiecutter.json (created)

1 +{
2 + "full_name": "Daniel Moch",
3 + "email": "djmoch@example.com",
4 + "github_username": "djmoch",
5 + "project_name": "Flit Boilerplate",
6 + "project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}",
7 + "project_homepage": "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug.replace('_', '-') }}",
8 + "project_short_description": "Flit Boilerplate contains all the boilerplate you need to create a Python Flit package.",
9 + "pypi_username": "{{ cookiecutter.github_username }}",
10 + "version": "0.1.0",
11 + "use_pytest": "n",
12 + "open_source_license": ["MIT license", "BSD license", "ISC license", "Apache Software License 2.0", "GNU General Public License v3", "Not open source"]
13 +}

{{cookiecutter.project_slug}}/LICENSE (created)

1 +{% if cookiecutter.open_source_license == 'MIT license' -%}
2 +MIT License
3 +
4 +Copyright (c) {% now 'local', '%Y' %}, {{ cookiecutter.full_name }}
5 +
6 +Permission is hereby granted, free of charge, to any person obtaining a copy
7 +of this software and associated documentation files (the "Software"), to deal
8 +in the Software without restriction, including without limitation the rights
9 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 +copies of the Software, and to permit persons to whom the Software is
11 +furnished to do so, subject to the following conditions:
12 +
13 +The above copyright notice and this permission notice shall be included in all
14 +copies or substantial portions of the Software.
15 +
16 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 +SOFTWARE.
23 +{% elif cookiecutter.open_source_license == 'BSD license' %}
24 +
25 +BSD License
26 +
27 +Copyright (c) {% now 'local', '%Y' %}, {{ cookiecutter.full_name }}
28 +All rights reserved.
29 +
30 +Redistribution and use in source and binary forms, with or without modification,
31 +are permitted provided that the following conditions are met:
32 +
33 +* Redistributions of source code must retain the above copyright notice, this
34 + list of conditions and the following disclaimer.
35 +
36 +* Redistributions in binary form must reproduce the above copyright notice, this
37 + list of conditions and the following disclaimer in the documentation and/or
38 + other materials provided with the distribution.
39 +
40 +* Neither the name of the copyright holder nor the names of its
41 + contributors may be used to endorse or promote products derived from this
42 + software without specific prior written permission.
43 +
44 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
45 +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
46 +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
47 +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
48 +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
49 +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
50 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
51 +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
52 +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
53 +OF THE POSSIBILITY OF SUCH DAMAGE.
54 +{% elif cookiecutter.open_source_license == 'ISC license' -%}
55 +ISC License
56 +
57 +Copyright (c) {% now 'local', '%Y' %}, {{ cookiecutter.full_name }}
58 +
59 +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
60 +
61 +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
62 +{% elif cookiecutter.open_source_license == 'Apache Software License 2.0' -%}
63 +Apache Software License 2.0
64 +
65 +Copyright (c) {% now 'local', '%Y' %}, {{ cookiecutter.full_name }}
66 +
67 +Licensed under the Apache License, Version 2.0 (the "License");
68 +you may not use this file except in compliance with the License.
69 +You may obtain a copy of the License at
70 +
71 +http://www.apache.org/licenses/LICENSE-2.0
72 +
73 +Unless required by applicable law or agreed to in writing, software
74 +distributed under the License is distributed on an "AS IS" BASIS,
75 +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
76 +See the License for the specific language governing permissions and
77 +limitations under the License.
78 +{% elif cookiecutter.open_source_license == 'GNU General Public License v3' -%}
79 +GNU GENERAL PUBLIC LICENSE
80 + Version 3, 29 June 2007
81 +
82 + {{ cookiecutter.project_short_description }}
83 + Copyright (C) {% now 'local', '%Y' %} {{ cookiecutter.full_name }}
84 +
85 + This program is free software: you can redistribute it and/or modify
86 + it under the terms of the GNU General Public License as published by
87 + the Free Software Foundation, either version 3 of the License, or
88 + (at your option) any later version.
89 +
90 + This program is distributed in the hope that it will be useful,
91 + but WITHOUT ANY WARRANTY; without even the implied warranty of
92 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
93 + GNU General Public License for more details.
94 +
95 + You should have received a copy of the GNU General Public License
96 + along with this program. If not, see <http://www.gnu.org/licenses/>.
97 +
98 +Also add information on how to contact you by electronic and paper mail.
99 +
100 + You should also get your employer (if you work as a programmer) or school,
101 +if any, to sign a "copyright disclaimer" for the program, if necessary.
102 +For more information on this, and how to apply and follow the GNU GPL, see
103 +<http://www.gnu.org/licenses/>.
104 +
105 + The GNU General Public License does not permit incorporating your program
106 +into proprietary programs. If your program is a subroutine library, you
107 +may consider it more useful to permit linking proprietary applications with
108 +the library. If this is what you want to do, use the GNU Lesser General
109 +Public License instead of this License. But first, please read
110 +<http://www.gnu.org/philosophy/why-not-lgpl.html>.
111 +{% endif %}

{{cookiecutter.project_slug}}/README.md (created)

1 +# {{ cookiecutter.project_name }}
2 +
3 +{{ cookiecutter.project_short_description }}
4 +
5 +# Features
6 +
7 +* TODO

{{cookiecutter.project_slug}}/pyproject.toml (created)

1 +[build-system]
2 +requires = ["flit"]
3 +build-backend = "flit.buildapi"
4 +
5 +[tool.flit.metadata]
6 +module = "{{ cookiecutter.project_slug }}"
7 +author = "{{ cookiecutter.full_name }}"
8 +author-email = "{{ cookiecutter.email }}"
9 +home-page = "{{ cookiecutter.project_homepage }}"
10 +description-file = "README.md"
11 +{% if cookiecutter.open_source_license == 'MIT license' -%}
12 +classifiers = ["License :: OSI Approved :: MIT License"]
13 +{% elif cookiecutter.open_source_license == 'BSD license' %}
14 +classifiers = ["License :: OSI Approved :: BSD License"]
15 +{% elif cookiecutter.open_source_license == 'ISC license' -%}
16 +classifiers = ["License :: OSI Approved :: ISC License (ISCL)"]
17 +{% elif cookiecutter.open_source_license == 'Apache Software License 2.0' -%}
18 +classifiers = ["License :: OSI Approved :: Apache Software License"]
19 +{% elif cookiecutter.open_source_license == 'GNU General Public License v3' -%}
20 +classifiers = ["License :: OSI Approved :: GNU General Public License v3 (GPLv3)"]
21 +{% endif %}

{{cookiecutter.project_slug}}/tests/__init__.py (created)

1 +# -*- coding: utf-8 -*-
2 +
3 +"""Unit test package for {{ cookiecutter.project_slug }}."""

{{cookiecutter.project_slug}}/tests/test_{{cookiecutter.project_slug}}.py (created)

1 +# -*- coding: utf-8 -*-
2 +
3 +"""Tests for `{{ cookiecutter.project_slug }}` package."""
4 +
5 +{% if cookiecutter.use_pytest == 'y' -%}
6 +import pytest
7 +{% else %}
8 +import unittest
9 +{%- endif %}
10 +
11 +from {{ cookiecutter.project_slug }} import {{ cookiecutter.project_slug }}
12 +
13 +{%- if cookiecutter.use_pytest == 'y' %}
14 +
15 +
16 +@pytest.fixture
17 +def response():
18 + """Sample pytest fixture.
19 +
20 + See more at: http://doc.pytest.org/en/latest/fixture.html
21 + """
22 + # import requests
23 + # return requests.get('https://github.com/audreyr/cookiecutter-pypackage')
24 +
25 +
26 +def test_content(response):
27 + """Sample pytest test function with the pytest fixture as an argument."""
28 + # from bs4 import BeautifulSoup
29 + # assert 'GitHub' in BeautifulSoup(response.content).title.string
30 +{%- else %}
31 +
32 +
33 +class Test{{ cookiecutter.project_slug|title }}(unittest.TestCase):
34 + """Tests for `{{ cookiecutter.project_slug }}` package."""
35 +
36 + def setUp(self):
37 + """Set up test fixtures, if any."""
38 +
39 + def tearDown(self):
40 + """Tear down test fixtures, if any."""
41 +
42 + def test_000_something(self):
43 + """Test something."""
44 +{%- if cookiecutter.command_line_interface|lower == 'click' %}
45 +
46 + def test_command_line_interface(self):
47 + """Test the CLI."""
48 + runner = CliRunner()
49 + result = runner.invoke(cli.main)
50 + assert result.exit_code == 0
51 + assert '{{ cookiecutter.project_slug }}.cli.main' in result.output
52 + help_result = runner.invoke(cli.main, ['--help'])
53 + assert help_result.exit_code == 0
54 + assert '--help Show this message and exit.' in help_result.output
55 +{%- endif %}
56 +{%- endif %}

{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/__init__.py (created)

1 +# -*- coding: utf-8 -*-
2 +
3 +"""{{ cookiecutter.project_short_description }}"""
4 +
5 +__author__ = '{{ cookiecutter.full_name }}'
6 +__email__ = '{{ cookiecutter.email }}'
7 +__version__ = '{{ cookiecutter.version }}'
8 +__copyright__ = 'Copyright (c) {% now 'local', '%Y' %}, {{ cookiecutter.full_name }}'

{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}.py (created)

1 +# -*- coding: utf-8 -*-
2 +
3 +"""Main module."""