From d0920c4b3f9577aada79b9a974cbc40d9d2c6795 Mon Sep 17 00:00:00 2001 From: delucchi-cmu Date: Fri, 10 Mar 2023 14:26:55 -0500 Subject: [PATCH 1/4] Project license options --- copier.yml | 9 ++++++ ...roject_license == 'BSD' %}LICENSE{% endif} | 28 +++++++++++++++++++ ...roject_license == 'MIT' %}LICENSE{% endif} | 21 ++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 python-project-template/{% if project_license == 'BSD' %}LICENSE{% endif} create mode 100644 python-project-template/{% if project_license == 'MIT' %}LICENSE{% endif} diff --git a/copier.yml b/copier.yml index 765b44ba..20c958f7 100644 --- a/copier.yml +++ b/copier.yml @@ -26,6 +26,15 @@ author_email: help: Your preferred email address? default: name@you.com +project_license: + help: What license would you like to use? + type: str + default: MIT + choices: + MIT: MIT + BSD: BSD + none: none + preferred_linter: help: What tooling would you like to use to enforce code style? type: str diff --git a/python-project-template/{% if project_license == 'BSD' %}LICENSE{% endif} b/python-project-template/{% if project_license == 'BSD' %}LICENSE{% endif} new file mode 100644 index 00000000..10e96fc3 --- /dev/null +++ b/python-project-template/{% if project_license == 'BSD' %}LICENSE{% endif} @@ -0,0 +1,28 @@ +BSD 3-Clause License + +Copyright (c) 2023, Astronomy Data Commons + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/python-project-template/{% if project_license == 'MIT' %}LICENSE{% endif} b/python-project-template/{% if project_license == 'MIT' %}LICENSE{% endif} new file mode 100644 index 00000000..b30da8c7 --- /dev/null +++ b/python-project-template/{% if project_license == 'MIT' %}LICENSE{% endif} @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 LSST Dark Energy Science Collaboration (DESC) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file From 8947745f5a6b8ec89b256338b5eb82b0131d2243 Mon Sep 17 00:00:00 2001 From: delucchi-cmu Date: Fri, 10 Mar 2023 14:31:27 -0500 Subject: [PATCH 2/4] Pyproject include --- python-project-template/pyproject.toml.jinja | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python-project-template/pyproject.toml.jinja b/python-project-template/pyproject.toml.jinja index 2fc86cb1..67e153bb 100644 --- a/python-project-template/pyproject.toml.jinja +++ b/python-project-template/pyproject.toml.jinja @@ -7,7 +7,11 @@ authors = [ ] classifiers = [ "Development Status :: 4 - Beta", +{% if project_license == 'MIT' %} "License :: OSI Approved :: MIT License", +{% elif project_license == 'MIT' %} + "License :: OSI Approved :: BSD License", +{% endif %} "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Operating System :: OS Independent", From 498fc09a00f9901dbc151870a0cb8c7165086efa Mon Sep 17 00:00:00 2001 From: delucchi-cmu Date: Fri, 10 Mar 2023 14:34:03 -0500 Subject: [PATCH 3/4] Fix file names --- python-project-template/pyproject.toml.jinja | 2 +- ...dif} => {% if project_license == 'BSD' %}LICENSE{% endif %}} | 0 ...ndif} => {% if project_license == 'MIT' %}LICENSE{% endif%}} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename python-project-template/{{% if project_license == 'BSD' %}LICENSE{% endif} => {% if project_license == 'BSD' %}LICENSE{% endif %}} (100%) rename python-project-template/{{% if project_license == 'MIT' %}LICENSE{% endif} => {% if project_license == 'MIT' %}LICENSE{% endif%}} (100%) diff --git a/python-project-template/pyproject.toml.jinja b/python-project-template/pyproject.toml.jinja index 67e153bb..83c23384 100644 --- a/python-project-template/pyproject.toml.jinja +++ b/python-project-template/pyproject.toml.jinja @@ -9,7 +9,7 @@ classifiers = [ "Development Status :: 4 - Beta", {% if project_license == 'MIT' %} "License :: OSI Approved :: MIT License", -{% elif project_license == 'MIT' %} +{% elif project_license == 'BSD' %} "License :: OSI Approved :: BSD License", {% endif %} "Intended Audience :: Developers", diff --git a/python-project-template/{% if project_license == 'BSD' %}LICENSE{% endif} b/python-project-template/{% if project_license == 'BSD' %}LICENSE{% endif %} similarity index 100% rename from python-project-template/{% if project_license == 'BSD' %}LICENSE{% endif} rename to python-project-template/{% if project_license == 'BSD' %}LICENSE{% endif %} diff --git a/python-project-template/{% if project_license == 'MIT' %}LICENSE{% endif} b/python-project-template/{% if project_license == 'MIT' %}LICENSE{% endif%} similarity index 100% rename from python-project-template/{% if project_license == 'MIT' %}LICENSE{% endif} rename to python-project-template/{% if project_license == 'MIT' %}LICENSE{% endif%} From e4ddc2b1be538772dad07f2f3cd30e8378e1546c Mon Sep 17 00:00:00 2001 From: delucchi-cmu Date: Fri, 10 Mar 2023 14:38:48 -0500 Subject: [PATCH 4/4] create 'main' isntead of 'master' on init --- copier.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copier.yml b/copier.yml index 20c958f7..445f145c 100644 --- a/copier.yml +++ b/copier.yml @@ -72,4 +72,4 @@ _skip_if_exists: # Tasks to execute after generating or updating a project. _tasks: - - "git init" + - "git init --initial-branch=main"