-
Notifications
You must be signed in to change notification settings - Fork 0
Add LICENSE to the template #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or a better default could be {{current_year}}, The pyfar developers, because this is most common
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
| @@ -1,3 +1,8 @@ | |||
| author: | |||
| type: str | |||
| help: "Your name or the name of your organization" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| help: "Your name or the name of your organization" | |
| help: "The author or authors of the package, can also be an organization." |
ahms5
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small comment, after that you can merge. Thanks
Changes proposed in this pull request:
copier.ymlfile: