Skip to content

Commit 1c952f2

Browse files
committed
cookiecutter: attempt to edit context by jinja templates
1 parent dec5e79 commit 1c952f2

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

cookiecutter.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,26 @@
4141
"GNU General Public License Version 3": "GPL-3.0-or-later",
4242
"ISC License": "ISC",
4343
"Unlicense": "Unlicense"
44-
}
44+
},
45+
"_LICENSE_CLASSIFIERS": {
46+
"MIT": "MIT License",
47+
"BSD-2-Clause": "BSD License",
48+
"BSD 3-Clause": "BSD License",
49+
"Apache-2.0": "Apache Software License",
50+
"GPL-3.0-or-later": "GNU General Public License v3 or later (GPLv3+)",
51+
"LGPL-3.0-or-later": "GNU Lesser General Public License v3 or later (LGPLv3+)",
52+
"ISC": "ISC License (ISCL)",
53+
"Unlicense": "The Unlicense (Unlicense)"
54+
},
55+
"_LICENSE_SPDX": {
56+
"MIT License": "MIT",
57+
"BSD 2-Clause License": "BSD-2-Clause",
58+
"BSD 3-Clause License": "BSD-3-Clause",
59+
"Apache License Version 2.0": "Apache-2.0",
60+
"GNU General Public License Version 3": "GPL-3.0-or-later",
61+
"ISC License": "ISC",
62+
"Unlicense": "Unlicense"
63+
},
64+
"_license_classifier": "{{ cookiecutter._LICENSE_CLASSIFIERS.get(cookiecutter.license) }}",
65+
"_license_spdx": "{{ cookiecutter._LICENSE_SPDX.get(cookiecutter.license) }}"
4566
}

{{cookiecutter.project_slug}}/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ packages = [ "{{ cookiecutter.package_name }}" ]
1111
name = "{{ cookiecutter.project_slug }}"
1212
version = "0.0.1"
1313
description = "{{ cookiecutter.short_description }}"
14-
license = "{{ cookiecutter.license_spdx }}"
14+
license = "{{ cookiecutter._license_spdx }}"
1515
maintainers = [
1616
"{{ cookiecutter.author_full_name }} <{{ cookiecutter.author_email }}>"
1717
]
@@ -25,7 +25,7 @@ classifiers = [
2525
"Development Status :: 2 - Pre-Alpha",
2626
"Intended Audience :: Developers",
2727
"Intended Audience :: Science/Research",
28-
"License :: OSI Approved :: {{ cookiecutter.license_classifier }}",
28+
"License :: OSI Approved :: {{ cookiecutter._license_classifier }}",
2929
"Operating System :: OS Independent",
3030
"Programming Language :: Python",
3131
"Topic :: Scientific/Engineering :: Bio-Informatics"

0 commit comments

Comments
 (0)