Skip to content

Commit d9b9beb

Browse files
lwjohnst86signekb
andauthored
refactor: ♻️ revise pyproject.toml.jinja to use Jinja variables (#76)
# Description Converted the template's pyproject file to use Jinja variables. This PR needs a quick review. --------- Co-authored-by: Signe Kirk Brødbæk <40836345+signekb@users.noreply.github.com>
1 parent 2b170e1 commit d9b9beb

File tree

2 files changed

+37
-10
lines changed

2 files changed

+37
-10
lines changed

copier.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
11
_subdirectory: template
2+
3+
# Questions:
4+
5+
package_github_repo:
6+
type: str
7+
default: "NA"
8+
help: "What is the GitHub repository spec for the package (in the form of 'user/repo'))?"
9+
placeholder: "user/repo"
10+
11+
author_given_name:
12+
type: str
13+
help: "What is your first/given name?"
14+
15+
author_family_name:
16+
type: str
17+
help: "What is your last/family name?"
18+
19+
author_email:
20+
type: str
21+
help: "What is your email address?"
22+
23+
package_abbrev:
24+
type: str
25+
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'."

template/pyproject.toml.jinja

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
[project]
2-
name = "template-data-package"
2+
name = {{ package_abbrev }}
33
version = "0.1.0"
4-
description = "A template for structuring all the pieces for a data package."
4+
# TODO: Add a description of the package.
5+
description = ""
56
authors = [
6-
{name = "Luke W. Johnston", email = "lwjohnst@gmail.com" },
7-
{name = "Kristiane Beicher", email = "kris.beicher@clin.au.dk" },
7+
{name = "{{ author_given_name }} {{ author_family_name }}", email = "{{ author_email }}" },
8+
# TODO: Add more authors as needed.
89
]
910
maintainers = [
10-
{name = "Luke W. Johnston", email = "lwjohnst@gmail.com" },
11-
{name = "Kristiane Beicher", email = "kris.beicher@clin.au.dk" },
11+
{name = "{{ author_given_name }} {{ author_family_name }}", email = "{{ author_email }}" },
12+
# TODO: Add more maintainers as needed.
1213
]
1314
readme = "README.md"
14-
license = "MIT"
15+
# TODO: Add a license for the package.
16+
license = ""
1517
license-files = ["LICENSE.md"]
1618
requires-python = ">=3.12"
1719
dependencies = [
1820
"polars>=1.27.0",
19-
"pyjanitor>=0.31.0",
2021
"seedcase-sprout>=0.46.3",
2122
]
2223

24+
{{ if package_github != "NA" }}
2325
[project.urls]
24-
issues = "https://github.com/seedcase-project/REPO/issues"
25-
repository = "https://github.com/seedcase-project/REPO"
26+
issues = "https://github.com/{{ package_github_repo }}/issues"
27+
repository = "https://github.com/{{ package_github_repo }}"
28+
{{ endif }}
2629

2730
[dependency-groups]
2831
dev = [

0 commit comments

Comments
 (0)