Skip to content

Commit 9cbe1a2

Browse files
committed
feat: add multi-license support with MIT, Apache 2.0, GPL-3.0 and other options
1 parent 2202dfb commit 9cbe1a2

16 files changed

Lines changed: 410 additions & 52 deletions

{% if include_license %}LICENSE{% endif %}.jinja renamed to LICENSE

File renamed without changes.

LICENSE.jinja

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% include 'licenses/' + license_type %}

copier.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,21 @@ include_license:
3939
help: "Include a LICENSE file in the project?"
4040
default: false
4141

42+
license_type:
43+
type: str
44+
help: "Choose a license type"
45+
choices:
46+
MIT: mit
47+
Apache 2.0: apache-2.0
48+
GNU General Public License v2.0: gpl-2.0
49+
GNU General Public License v3.0: gpl-3.0
50+
GNU Lesser General Public License v2.0: lgpl-2.0
51+
GNU Lesser General Public License v2.1: lgpl-2.1
52+
GNU Lesser General Public License v3.0: lgpl-3.0
53+
Mozilla Public License 2.0: mpl-2.0
54+
default: mit
55+
when: "{{ include_license }}"
56+
4257
_templates_suffix: .jinja
4358
_envops:
4459
block_start_string: "{%"
@@ -59,5 +74,7 @@ _exclude:
5974
- ".pytest_cache"
6075
- ".ruff_cache"
6176
- ".DS_Store"
77+
- "licenses"
6278

63-
_tasks: []
79+
_tasks:
80+
- "{% if not include_license %}rm -f LICENSE{% endif %}"

licenses/apache-2.0

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Apache License
2+
Version 2.0, January 2004
3+
4+
Copyright 2025 {{ author_name }}
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.

licenses/gpl-2.0

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
GNU GENERAL PUBLIC LICENSE
2+
Version 2, June 1991
3+
4+
Copyright (C) 2025 {{ author_name }}
5+
6+
This program is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU General Public License
8+
as published by the Free Software Foundation; either version 2
9+
of the License, or (at your option) any later version.
10+
11+
This program is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU General Public License for more details.
15+
16+
You should have received a copy of the GNU General Public License
17+
along with this program; if not, write to the Free Software
18+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19+
20+
For the full license text, see: https://www.gnu.org/licenses/gpl-2.0.txt

licenses/gpl-3.0

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
GNU GENERAL PUBLIC LICENSE
2+
Version 3, 29 June 2007
3+
4+
Copyright (C) 2025 {{ author_name }}
5+
6+
This program is free software: you can redistribute it and/or modify
7+
it under the terms of the GNU General Public License as published by
8+
the Free Software Foundation, either version 3 of the License, or
9+
(at your option) any later version.
10+
11+
This program is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU General Public License for more details.
15+
16+
You should have received a copy of the GNU General Public License
17+
along with this program. If not, see <https://www.gnu.org/licenses/>.

licenses/lgpl-2.0

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
GNU LIBRARY GENERAL PUBLIC LICENSE
2+
Version 2, June 1991
3+
4+
Copyright (C) 2025 {{ author_name }}
5+
6+
This library is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU Library General Public
8+
License as published by the Free Software Foundation; either
9+
version 2 of the License, or (at your option) any later version.
10+
11+
This library is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
Library General Public License for more details.
15+
16+
You should have received a copy of the GNU Library General Public License
17+
along with this library; if not, write to the Free Software
18+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19+
20+
For the full license text, see: https://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt

licenses/lgpl-2.1

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
GNU LESSER GENERAL PUBLIC LICENSE
2+
Version 2.1, February 1999
3+
4+
Copyright (C) 2025 {{ author_name }}
5+
6+
This library is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU Lesser General Public
8+
License as published by the Free Software Foundation; either
9+
version 2.1 of the License, or (at your option) any later version.
10+
11+
This library is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
Lesser General Public License for more details.
15+
16+
You should have received a copy of the GNU Lesser General Public License
17+
along with this library; if not, write to the Free Software
18+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19+
20+
For the full license text, see: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt

licenses/lgpl-3.0

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
GNU LESSER GENERAL PUBLIC LICENSE
2+
Version 3, 29 June 2007
3+
4+
Copyright (C) 2025 {{ author_name }}
5+
6+
This library is free software: you can redistribute it and/or modify
7+
it under the terms of the GNU Lesser General Public License as published by
8+
the Free Software Foundation, either version 3 of the License, or
9+
(at your option) any later version.
10+
11+
This library is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU Lesser General Public License for more details.
15+
16+
You should have received a copy of the GNU Lesser General Public License
17+
along with this library. If not, see <https://www.gnu.org/licenses/>.
18+
19+
For the full license text, see: https://www.gnu.org/licenses/lgpl-3.0.txt

licenses/mit

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 {{ author_name }}
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 all
13+
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 THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)