From f17096242ff50942194b075aa4bdaa3e956b0614 Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Wed, 2 Apr 2025 12:38:41 +0100 Subject: [PATCH 1/5] Change `license.file` to `license-files` I encountered this issue when making a release https://github.com/astro-informatics/sleplet/pull/451 --- {{cookiecutter.project_slug}}/pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index 91498d7d..dbdacf6e 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -29,6 +29,9 @@ dynamic = [ ] keywords = [ ] +license-files = [ + "LICENSE.md", +] name = "{{cookiecutter.project_slug}}" optional-dependencies = {dev = [ "build", @@ -49,7 +52,6 @@ optional-dependencies = {dev = [ ]} readme = "README.md" requires-python = ">={{cookiecutter.min_python_version}}" -license.file = "LICENSE.md" urls.homepage = "{{cookiecutter.__repo_url}}" [tool.coverage] From 9d21a88afa24b11912841d8430ff5ac853f4b139 Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Wed, 2 Apr 2025 12:41:06 +0100 Subject: [PATCH 2/5] Fix test --- tests/data/test_package_generation/pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/data/test_package_generation/pyproject.toml b/tests/data/test_package_generation/pyproject.toml index 078b80a5..4d49700a 100644 --- a/tests/data/test_package_generation/pyproject.toml +++ b/tests/data/test_package_generation/pyproject.toml @@ -26,6 +26,9 @@ dynamic = [ ] keywords = [ ] +license-files = [ + "LICENSE.md", +] name = "cookiecutter-test" optional-dependencies = {dev = [ "build", @@ -46,7 +49,6 @@ optional-dependencies = {dev = [ ]} readme = "README.md" requires-python = ">=3.11" -license.file = "LICENSE.md" urls.homepage = "https://github.com/test-user/cookiecutter-test" [tool.coverage] From 28a36deb6e8e14deca881ad007d4559ad2a206c2 Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Wed, 2 Apr 2025 16:01:13 +0100 Subject: [PATCH 3/5] Add `license` field to test Co-authored-by: Matt Graham --- tests/data/test_package_generation/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/data/test_package_generation/pyproject.toml b/tests/data/test_package_generation/pyproject.toml index 4d49700a..6a488554 100644 --- a/tests/data/test_package_generation/pyproject.toml +++ b/tests/data/test_package_generation/pyproject.toml @@ -26,6 +26,7 @@ dynamic = [ ] keywords = [ ] +license = "MIT" license-files = [ "LICENSE.md", ] From 6e2a2c87b3677a0353b5b9c06400e6d06b9ac6a9 Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Wed, 2 Apr 2025 16:01:31 +0100 Subject: [PATCH 4/5] Add `license` to top level pyproject Co-authored-by: Matt Graham --- {{cookiecutter.project_slug}}/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index dbdacf6e..64cacb44 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -29,6 +29,7 @@ dynamic = [ ] keywords = [ ] +license = "{{cookiecutter.license}}" license-files = [ "LICENSE.md", ] From 6a85dc14390cb8b9a75bb26cf790ade71f05d47d Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Wed, 2 Apr 2025 16:05:57 +0100 Subject: [PATCH 5/5] Rename `BSD-3` to be SPDX-compliant --- cookiecutter.json | 2 +- {{cookiecutter.project_slug}}/LICENSE.md | 2 +- {{cookiecutter.project_slug}}/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 61a867f5..a461cfab 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -11,7 +11,7 @@ "github_owner": "{{cookiecutter.author_given_names.lower().replace(' ', '-')}}-{{cookiecutter.author_family_names.lower().replace(' ', '-')}}", "min_python_version": ["3.11", "3.12", "3.13"], "max_python_version": ["3.13", "3.12", "3.11"], - "license": ["MIT", "BSD-3", "GPL-3.0"], + "license": ["MIT", "BSD-3-Clause", "GPL-3.0"], "funder": "", "__repo_name": "{{cookiecutter.github_owner}}/{{cookiecutter.project_slug}}", "__repo_url": "https://github.com/{{cookiecutter.__repo_name}}", diff --git a/{{cookiecutter.project_slug}}/LICENSE.md b/{{cookiecutter.project_slug}}/LICENSE.md index 866f8c19..a8d6580e 100644 --- a/{{cookiecutter.project_slug}}/LICENSE.md +++ b/{{cookiecutter.project_slug}}/LICENSE.md @@ -23,7 +23,7 @@ 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. -{%- elif cookiecutter.license == "BSD-3" -%} +{%- elif cookiecutter.license == "BSD-3-Clause" -%} Copyright (c) {% now 'utc', '%Y' %}, {{cookiecutter.author_given_names}} {{cookiecutter.author_family_names}} All rights reserved. diff --git a/{{cookiecutter.project_slug}}/README.md b/{{cookiecutter.project_slug}}/README.md index 8451edf1..f7edbf5c 100644 --- a/{{cookiecutter.project_slug}}/README.md +++ b/{{cookiecutter.project_slug}}/README.md @@ -15,7 +15,7 @@ [documentation-link]: {{cookiecutter.__repo_url}}/actions/workflows/docs.yml {%- if cookiecutter.license == "MIT" %} [license-badge]: https://img.shields.io/badge/License-MIT-yellow.svg -{%- elif cookiecutter.license == "BSD-3" %} +{%- elif cookiecutter.license == "BSD-3-Clause" %} [license-badge]: https://img.shields.io/badge/License-BSD_3--Clause-blue.svg {%- elif cookiecutter.license == "GPL-3.0" %} [license-badge]: https://img.shields.io/badge/License-GPLv3-blue.svg