From 35e588053bf75de8e74d48c90b24af8f4dfbcef5 Mon Sep 17 00:00:00 2001 From: "Luke W. Johnston" Date: Tue, 15 Jul 2025 10:03:30 +0200 Subject: [PATCH 1/2] refactor: :recycle: revise `pyproject.toml.jinja` to use Jinja variables --- copier.yaml | 24 ++++++++++++++++++++++++ template/pyproject.toml.jinja | 23 +++++++++++++---------- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/copier.yaml b/copier.yaml index 9978e0c..a99376c 100644 --- a/copier.yaml +++ b/copier.yaml @@ -1 +1,25 @@ _subdirectory: template + +# Questions: + +package_github: + type: str + default: "NA" + help: "What is the GitHub repository spec for the package (in the form of 'user/repo'))?" + placeholder: "user/repo" + +author_given_name: + type: str + help: "What is your first/given name?" + +author_family_name: + type: str + help: "What is your last/family name?" + +author_email: + type: str + help: "What is your email address?" + +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'." diff --git a/template/pyproject.toml.jinja b/template/pyproject.toml.jinja index 17102b9..b08e8d3 100644 --- a/template/pyproject.toml.jinja +++ b/template/pyproject.toml.jinja @@ -1,28 +1,31 @@ [project] -name = "template-data-package" +name = {{ package_abbrev }} version = "0.1.0" -description = "A template for structuring all the pieces for a data package." +# TODO: Add a description of the package. +description = "" authors = [ - {name = "Luke W. Johnston", email = "lwjohnst@gmail.com" }, - {name = "Kristiane Beicher", email = "kris.beicher@clin.au.dk" }, + {name = "{{ author_given_name }} {{ author_family_name }}", email = "{{ author_email }}" }, + # TODO: Add more authors as needed. ] maintainers = [ - {name = "Luke W. Johnston", email = "lwjohnst@gmail.com" }, - {name = "Kristiane Beicher", email = "kris.beicher@clin.au.dk" }, + {name = "{{ author_given_name }} {{ author_family_name }}", email = "{{ author_email }}" }, + # TODO: Add more maintainers as needed. ] readme = "README.md" -license = "MIT" +# TODO: Add a license for the package. +license = "" license-files = ["LICENSE.md"] requires-python = ">=3.12" dependencies = [ "polars>=1.27.0", - "pyjanitor>=0.31.0", "seedcase-sprout>=0.46.3", ] +{{ if package_github != "NA" }} [project.urls] -issues = "https://github.com/seedcase-project/REPO/issues" -repository = "https://github.com/seedcase-project/REPO" +issues = "https://github.com/{{ package_github }}/issues" +repository = "https://github.com/{{ package_github }}" +{{ endif }} [dependency-groups] dev = [ From 1f7f2aee724ebd301590649aa3042c430cb44313 Mon Sep 17 00:00:00 2001 From: "Luke W. Johnston" Date: Tue, 15 Jul 2025 13:38:44 +0200 Subject: [PATCH 2/2] refactor: :pencil2: edits from review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Signe Kirk Brødbæk <40836345+signekb@users.noreply.github.com> --- copier.yaml | 2 +- template/pyproject.toml.jinja | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/copier.yaml b/copier.yaml index a99376c..00f2384 100644 --- a/copier.yaml +++ b/copier.yaml @@ -2,7 +2,7 @@ _subdirectory: template # Questions: -package_github: +package_github_repo: type: str default: "NA" help: "What is the GitHub repository spec for the package (in the form of 'user/repo'))?" diff --git a/template/pyproject.toml.jinja b/template/pyproject.toml.jinja index b08e8d3..8b09b0c 100644 --- a/template/pyproject.toml.jinja +++ b/template/pyproject.toml.jinja @@ -23,8 +23,8 @@ dependencies = [ {{ if package_github != "NA" }} [project.urls] -issues = "https://github.com/{{ package_github }}/issues" -repository = "https://github.com/{{ package_github }}" +issues = "https://github.com/{{ package_github_repo }}/issues" +repository = "https://github.com/{{ package_github_repo }}" {{ endif }} [dependency-groups]