Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds LICENSE file generation functionality to the copier template, allowing users to select from common open-source licenses when creating a new project. The implementation includes template parameters for license type, copyright holder, and publication year, along with corresponding test coverage.
- Added three new template parameters:
license(with 6 predefined options plus "Other"),copyright_holder, andyear - Created LICENSE template files for MIT, BSD-3-Clause, Apache-2.0, GPL-3.0-only, EUPL-1.2, and MPL-2.0
- Implemented tests to verify LICENSE file generation and content validation
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| copier.yml | Adds three new parameters (license, copyright_holder, year) with appropriate defaults and help text for license selection |
| tests/conftest.py | Updates test defaults to include license type ("MIT") and copyright holder ("pyfar contributors") |
| tests/test_copier.py | Adds LICENSE to file existence test, plus new tests for default license content and parametrized tests for all license types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ahms5
left a comment
There was a problem hiding this comment.
Thanky hanna, looks fine, I would just combine these two options to be more flexible.
otherwise approved
copier.yml
Outdated
| copyright_holder: | ||
| type: str | ||
| help: "Who is the copyright holder, for example, yourself or your organization? Used in copyright statements." | ||
| default: "{{ git_username }}" | ||
|
|
||
| year: | ||
| type: str | ||
| help: "What is the starting year of the project? Used in copyright statements." | ||
| default: "{{ '%Y' | strftime }}" No newline at end of file |
There was a problem hiding this comment.
maybe we can combine year and holder to copyright_statement. This will be more flexible, because in some packages we have custum statements, e.g. sparpy
for copyright_statement we could make a default like {{current_year}}, {{author}}
There was a problem hiding this comment.
or a better default could be {{current_year}}, The pyfar developers, because this is most common
There was a problem hiding this comment.
Thank you for the review! I'm not sure I know how to combine the parameters... Do you mean something like:
copyright_statement:
type: str
help: ""
default:
author: The pyfar developers
year: {{current_year}}
?
There was a problem hiding this comment.
sth like this
| copyright_holder: | |
| type: str | |
| help: "Who is the copyright holder, for example, yourself or your organization? Used in copyright statements." | |
| default: "{{ git_username }}" | |
| year: | |
| type: str | |
| help: "What is the starting year of the project? Used in copyright statements." | |
| default: "{{ '%Y' | strftime }}" | |
| copyright_statement: | |
| type: str | |
| help: "What is the copyright statement. Usually it is sth like publication year, name of copyright holder." | |
| default: "{{ '%Y' | strftime }}, The pyfar developers" |
copier.yml
Outdated
| copyright_statement: | ||
| type: str | ||
| help: "What is the copyright statement? For example publication year, copyright holder." | ||
| default: "{{ '%Y' | strftime }}, The pyfar developers" |
There was a problem hiding this comment.
| default: "{{ '%Y' | strftime }}, The pyfar developers" | |
| default: "{{ '%Y' | strftime }}, {{ authors }}" |
we can add an other fiedl for authors, since this will be need somewhere else.
ahms5
left a comment
There was a problem hiding this comment.
Just a small comment, after that you can merge. Thanks
Co-authored-by: Anne Heimes <64446926+ahms5@users.noreply.github.com>
Changes proposed in this pull request:
copier.ymlfile: