Skip to content

Commit e0c85ef

Browse files
authored
refactor: ♻️ tweak copier settings (#91)
# Description This PR tweaks some copier settings. Closes #47 closes #46 This PR needs a quick review. ## Checklist - [x] Formatted Markdown - [x] Ran `just run-all`
1 parent 1abb05f commit e0c85ef

File tree

7 files changed

+27
-11
lines changed

7 files changed

+27
-11
lines changed

copier.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ _subdirectory: template
33
# Questions:
44
package_github_repo:
55
type: str
6-
default: "NA"
76
help: "What is the GitHub repository spec for the package (in the form of 'user/repo'))?"
87
placeholder: "user/repo"
98

@@ -22,3 +21,18 @@ author_email:
2221
package_abbrev:
2322
type: str
2423
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'."
24+
default: "{{ _copier_conf.dst_path | basename }}"
25+
26+
review_team:
27+
type: str
28+
help: What GitHub team is responsible for reviewing pull requests?
29+
default: >-
30+
{{ "@%s/developers" % package_github_repo.split('/')[0] if package_github_repo else "" }}
31+
32+
github_board_number:
33+
type: str
34+
help: "What is the number of the GitHub project board to add issues and PRs to?"
35+
validator: |
36+
{% if github_board_number and not github_board_number.isdigit() %}
37+
The board number must be an integer.
38+
{% endif %}

justfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ test:
4242
--data package_github_repo="first-last/${test_name}" \
4343
--data author_given_name="First" \
4444
--data author_family_name="Last" \
45-
--data author_email="first.last@example.com"
45+
--data author_email="first.last@example.com" \
46+
--data review_team="@first-last/developers" \
47+
--data github_board_number=22
4648
# TODO: Other checks/tests?
4749

4850
cleanup:

template/.github/CODEOWNERS.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# All members on Developers team get added to review PRs
2-
* @seedcase-project/developers
2+
* {{ review_team }}
33

44
# Ignore these so we don't get added to sync PRs
55
/.github/

template/.github/workflows/add-to-project.yml.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
add-to-project:
1919
uses: seedcase-project/.github/.github/workflows/reusable-add-to-project.yml@main
2020
with:
21-
board-number: 18
21+
board-number: {{ github_board_number }}
2222
app-id: {{ '${{ vars.ADD_TO_BOARD_APP_ID }}' }}
2323
secrets:
2424
add-to-board-token: {{ '${{ secrets.ADD_TO_BOARD }}' }}

template/CITATION.cff.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ keywords:
2121
# TODO: Add a data license for the data package.
2222
license: ""
2323
message: "If you use this data package, please cite it using these metadata."
24-
repository-code: "https://github.com/{{ package_github }}"
24+
repository-code: "https://github.com/{{ package_github_repo }}"
2525
# TODO: Add a URL for any website for the data package.
2626
# url: ""

template/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# import polars as pl
22
import seedcase_sprout as sp
33

4-
from scripts.properties import properties
4+
# from scripts.properties import properties
55

66
# from scripts.resource_properties import resource_properties
77

@@ -26,14 +26,14 @@ def main():
2626
# )
2727

2828
## Save the properties to `datapackage.json`.
29-
sp.write_properties(properties=properties)
29+
# sp.write_properties(properties=properties)
3030

3131
## README
3232

3333
## Create the README text for the data package.
34-
readme_text = sp.as_readme_text(properties)
34+
# readme_text = sp.as_readme_text(properties)
3535
## Write the README text to a `README.md` file.
36-
sp.write_file(readme_text, package_path.readme())
36+
# sp.write_file(readme_text, package_path.readme())
3737

3838
## BATCH DATA
3939

template/pyproject.toml.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = {{ package_abbrev }}
2+
name = "{{ package_abbrev }}"
33
version = "0.1.0"
44
# TODO: Add a description of the package.
55
description = ""
@@ -21,7 +21,7 @@ dependencies = [
2121
"seedcase-sprout>=0.46.3",
2222
]
2323

24-
{% if package_github_repo != "NA" %}
24+
{% if package_github_repo %}
2525
[project.urls]
2626
issues = "https://github.com/{{ package_github_repo }}/issues"
2727
repository = "https://github.com/{{ package_github_repo }}"

0 commit comments

Comments
 (0)