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 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 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"