Skip to content

Conversation

@h-chmeruk
Copy link
Contributor

Changes proposed in this pull request:

  • New parameters added to the copier.yml file:
    • license: 6 options for the most common licenses and the option “other” if a user wants to use a different/no license.
    • copyright_holder: person/organization that owns the package. Used in the LICENSE file.
    • year: year of publication of the package, also used in the LICENSE file
  • LICENSE file added to the template folder.
  • Tests added to verify the correct creation of the LICENSE file in the new package.

@h-chmeruk h-chmeruk added the enhancement New feature or request label Dec 10, 2025
@h-chmeruk h-chmeruk requested review from ahms5 and Copilot December 10, 2025 13:15
Copy link
Contributor

Copilot AI left a 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, and year
  • 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.

Copy link
Member

@ahms5 ahms5 left a 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
Comment on lines 53 to 61
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 }}"
Copy link
Member

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

Copy link
Member

@ahms5 ahms5 Dec 10, 2025

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

Copy link
Contributor Author

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

?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sth like this

Suggested change
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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

@h-chmeruk h-chmeruk requested a review from ahms5 December 10, 2025 16:45
@h-chmeruk h-chmeruk self-assigned this Dec 10, 2025
@ahms5 ahms5 added this to the v0.1.0 milestone Dec 10, 2025
@ahms5 ahms5 added enhancement New feature or request and removed enhancement New feature or request labels Dec 10, 2025
@@ -1,3 +1,8 @@
author:
type: str
help: "Your name or the name of your organization"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
help: "Your name or the name of your organization"
help: "The author or authors of the package, can also be an organization."

Copy link
Member

@ahms5 ahms5 left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants