From 367a2b75a94f0bef75c8282f2c70fe9267edb130 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 1a854574..58b34680 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.10", @@ -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.10" From 45b2f02f09537c6bd5ed7b0d128a1c8a9ccb3a4a 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 914acedcc45c0ee24d9ce270f57af8141a3a2e01 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 ec7d3e4d..5b5114f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,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) * Recommend `ruff format` instead of `yapf` for fixing code style readability [#695](https://github.com/NLeSC/python-template/pull/695) ### Removed