From 353b3ebe7445bc8fee1c9a4dd5193581e2f3d465 Mon Sep 17 00:00:00 2001 From: Sander van Rijn Date: Mon, 8 Dec 2025 17:29:15 +0100 Subject: [PATCH 1/3] update license-related keys in pyproject.toml --- template/pyproject.toml.jinja | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/template/pyproject.toml.jinja b/template/pyproject.toml.jinja index bc99e00d..c2a1e0ee 100644 --- a/template/pyproject.toml.jinja +++ b/template/pyproject.toml.jinja @@ -4,7 +4,7 @@ # - https://www.python.org/dev/peps/pep-0621/ [build-system] -requires = ["setuptools>=64.0.0", "setuptools-scm", "wheel"] +requires = ["setuptools>=77.0.3", "setuptools-scm", "wheel"] build-backend = "setuptools.build_meta" [project] @@ -15,13 +15,6 @@ classifiers = [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", - "{{ {'Apache Software License 2.0': 'License :: OSI Approved :: Apache Software License', - 'MIT license': 'License :: OSI Approved :: MIT License', - 'BSD license': 'License :: OSI Approved :: BSD License', - 'ISC license': 'License :: OSI Approved :: ISC License (ISCL)', - 'GNU General Public License v3 or later': 'License :: OSI Approved :: GNU General Public License', - 'Not open source': 'License :: Other/Proprietary License' - }[license] }}", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.12", @@ -35,7 +28,17 @@ keywords = [ "{{ item }}"{{ "," if not loop.last }} {%- endfor -%} ] -license = {file = "LICENSE"} +{% if license != "Other" -%} +license = "{{ {'Apachev2': 'Apache-2.0', + 'MIT': 'MIT', + 'BSD': 'BSD-3-Clause', + 'ISC': 'ISC', + 'GNUv3': 'GPL-3.0-or-later', + 'GNULesserv3': 'LGPL-3.0-or-later', +}[license] }}" +{% endif -%} +{#- NOTICE file is only present for Apache -#} +license-files = ["LICENSE"{% if license == "Apachev2" %}, "NOTICE"{% endif %}] name = "{{ package_name }}" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.12" From 375a7c58cbc4f50bf1a49331df4ab1205befbe52 Mon Sep 17 00:00:00 2001 From: Sander van Rijn Date: Tue, 9 Dec 2025 01:42:44 +0100 Subject: [PATCH 2/3] make NOTICE entry in MANIFEST.in license dependent --- template/MANIFEST.in.jinja | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/template/MANIFEST.in.jinja b/template/MANIFEST.in.jinja index 67ee1713..541b112d 100644 --- a/template/MANIFEST.in.jinja +++ b/template/MANIFEST.in.jinja @@ -1,4 +1,8 @@ -{% if AddCitation -%}include CITATION.cff{%- endif %} +{%- if AddCitation %} +include CITATION.cff +{%- endif %} include LICENSE +{%- if license == "Apachev2" %} include NOTICE +{%- endif %} include README.md From 0f8d85dc9651638e00a8097c77e85ac92cc7ad14 Mon Sep 17 00:00:00 2001 From: Sander van Rijn Date: Tue, 9 Dec 2025 02:08:17 +0100 Subject: [PATCH 3/3] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9557220d..e0c4b9b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### Changed +* Following [PEP 639](https://peps.python.org/pep-0639/#specification), updated `license` and `license-files` keys in `pyproject.toml` [#707](https://github.com/NLeSC/python-template/pull/707) * Update CI actions to use Python 3.14 instead of 3.12 [#703](https://github.com/NLeSC/python-template/pull/703) * Recommend `ruff format` instead of `yapf` for fixing code style readability [#695](https://github.com/NLeSC/python-template/pull/695) * Replace optional dependencies with dependency groups in template [#705](https://github.com/NLeSC/python-template/pull/705)