diff --git a/copier.yaml b/copier.yaml index 59254cd..4689448 100644 --- a/copier.yaml +++ b/copier.yaml @@ -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" @@ -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 %} diff --git a/justfile b/justfile index 1b9950f..1c7fdc7 100644 --- a/justfile +++ b/justfile @@ -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: diff --git a/template/.github/CODEOWNERS.jinja b/template/.github/CODEOWNERS.jinja index 22da67d..f7e542d 100644 --- a/template/.github/CODEOWNERS.jinja +++ b/template/.github/CODEOWNERS.jinja @@ -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/ diff --git a/template/.github/workflows/add-to-project.yml.jinja b/template/.github/workflows/add-to-project.yml.jinja index c2c5d94..6ecc2ac 100644 --- a/template/.github/workflows/add-to-project.yml.jinja +++ b/template/.github/workflows/add-to-project.yml.jinja @@ -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 }}' }} diff --git a/template/CITATION.cff.jinja b/template/CITATION.cff.jinja index 6fb460e..c53c6eb 100644 --- a/template/CITATION.cff.jinja +++ b/template/CITATION.cff.jinja @@ -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: "" diff --git a/template/main.py b/template/main.py index 1ffd986..b04b517 100644 --- a/template/main.py +++ b/template/main.py @@ -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 @@ -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 diff --git a/template/pyproject.toml.jinja b/template/pyproject.toml.jinja index 998d740..d2a25f5 100644 --- a/template/pyproject.toml.jinja +++ b/template/pyproject.toml.jinja @@ -1,5 +1,5 @@ [project] -name = {{ package_abbrev }} +name = "{{ package_abbrev }}" version = "0.1.0" # TODO: Add a description of the package. description = "" @@ -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 }}"