Skip to content

Commit

Permalink
fix(templates): Include package license metadata conditionally in tem…
Browse files Browse the repository at this point in the history
…plates (#2862)

* Include package license metadata conditionally

* Also apply for target and mapper templates

* Optimistically reference `LICENSE` file

* Add a replay file for the no license case

---------

Co-authored-by: Edgar Ramírez-Mondragón <edgarrm358@gmail.com>
  • Loading branch information
ReubenFrankel and edgarrmondragon authored Jan 31, 2025
1 parent a609f4b commit 3c80245
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ keywords = [
]
classifiers = [
"Intended Audience :: Developers",
{%- if cookiecutter.license == "Apache-2.0" %}
"License :: OSI Approved :: Apache Software License",
{%- endif %}
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
license = "Apache-2.0"
{%- if cookiecutter.license != "None" %}
license = "{{cookiecutter.license}}"
{%- endif %}
license-files = [ "LICENSE" ]
requires-python = ">=3.9"
dependencies = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@ keywords = [
]
classifiers = [
"Intended Audience :: Developers",
{%- if cookiecutter.license == "Apache-2.0" %}
"License :: OSI Approved :: Apache Software License",
{%- endif %}
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
license = "Apache-2.0"
{%- if cookiecutter.license != "None" %}
license = "{{cookiecutter.license}}"
{%- endif %}
license-files = [ "LICENSE" ]
requires-python = ">=3.9"
dependencies = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@ keywords = [
]
classifiers = [
"Intended Audience :: Developers",
{%- if cookiecutter.license == "Apache-2.0" %}
"License :: OSI Approved :: Apache Software License",
{%- endif %}
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
license = "Apache-2.0"
{%- if cookiecutter.license != "None" %}
license = "{{cookiecutter.license}}"
{%- endif %}
license-files = [ "LICENSE" ]
requires-python = ">=3.9"
dependencies = [
Expand Down
18 changes: 18 additions & 0 deletions e2e-tests/cookiecutters/tap-no-license.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"cookiecutter": {
"source_name": "AutomaticTestTap",
"admin_name": "Automatic Tester",
"admin_email": "auto.tester@example.com",
"tap_id": "tap-no-license",
"library_name": "tap_no_license",
"variant": "None (Skip)",
"stream_type": "REST",
"auth_method": "Basic Auth",
"include_ci_files": "None (Skip)",
"faker_extra": false,
"license": "None",
"ide": "VSCode",
"_template": "../tap-template/",
"_output_dir": "."
}
}

0 comments on commit 3c80245

Please sign in to comment.