Skip to content

refactor: ♻️ tweak copier settings #91

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

Merged
merged 12 commits into from
Jul 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion copier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ _subdirectory: template
# Questions:
package_github_repo:
type: str
default: "NA"
help: "What is the GitHub repository spec for the package (in the form of 'user/repo'))?"
placeholder: "user/repo"

Expand All @@ -22,3 +21,18 @@ author_email:
package_abbrev:
type: str
help: "What is the abbreviated name of the package? This could be the name of your GitHub repository and should be a short, lowercase name without spaces or special characters. For example, 'template-data-package'."
default: "{{ _copier_conf.dst_path | basename }}"

review_team:
type: str
help: What GitHub team is responsible for reviewing pull requests?
default: >-
{{ "@%s/developers" % package_github_repo.split('/')[0] if package_github_repo else "" }}

github_board_number:
type: str
help: "What is the number of the GitHub project board to add issues and PRs to?"
validator: |
{% if github_board_number and not github_board_number.isdigit() %}
The board number must be an integer.
{% endif %}
4 changes: 3 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ test:
--data package_github_repo="first-last/${test_name}" \
--data author_given_name="First" \
--data author_family_name="Last" \
--data author_email="first.last@example.com"
--data author_email="first.last@example.com" \
--data review_team="@first-last/developers" \
--data github_board_number=22
# TODO: Other checks/tests?

cleanup:
Expand Down
2 changes: 1 addition & 1 deletion template/.github/CODEOWNERS.jinja
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# All members on Developers team get added to review PRs
* @seedcase-project/developers
* {{ review_team }}

# Ignore these so we don't get added to sync PRs
/.github/
Expand Down
2 changes: 1 addition & 1 deletion template/.github/workflows/add-to-project.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
add-to-project:
uses: seedcase-project/.github/.github/workflows/reusable-add-to-project.yml@main
with:
board-number: 18
board-number: {{ github_board_number }}
app-id: {{ '${{ vars.ADD_TO_BOARD_APP_ID }}' }}
secrets:
add-to-board-token: {{ '${{ secrets.ADD_TO_BOARD }}' }}
Expand Down
2 changes: 1 addition & 1 deletion template/CITATION.cff.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ keywords:
# TODO: Add a data license for the data package.
license: ""
message: "If you use this data package, please cite it using these metadata."
repository-code: "https://github.com/{{ package_github }}"
repository-code: "https://github.com/{{ package_github_repo }}"
# TODO: Add a URL for any website for the data package.
# url: ""
8 changes: 4 additions & 4 deletions template/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# import polars as pl
import seedcase_sprout as sp

from scripts.properties import properties
# from scripts.properties import properties

# from scripts.resource_properties import resource_properties

Expand All @@ -26,14 +26,14 @@ def main():
# )

## Save the properties to `datapackage.json`.
sp.write_properties(properties=properties)
# sp.write_properties(properties=properties)

## README

## Create the README text for the data package.
readme_text = sp.as_readme_text(properties)
# readme_text = sp.as_readme_text(properties)
## Write the README text to a `README.md` file.
sp.write_file(readme_text, package_path.readme())
# sp.write_file(readme_text, package_path.readme())

## BATCH DATA

Expand Down
4 changes: 2 additions & 2 deletions template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = {{ package_abbrev }}
name = "{{ package_abbrev }}"
version = "0.1.0"
# TODO: Add a description of the package.
description = ""
Expand All @@ -21,7 +21,7 @@ dependencies = [
"seedcase-sprout>=0.46.3",
]

{% if package_github_repo != "NA" %}
{% if package_github_repo %}
[project.urls]
issues = "https://github.com/{{ package_github_repo }}/issues"
repository = "https://github.com/{{ package_github_repo }}"
Expand Down
Loading