diff --git a/{{cookiecutter.project_name}}/.github/ISSUE_TEMPLATE/bug_report.yml b/{{cookiecutter.project_name}}/.github/ISSUE_TEMPLATE/bug_report.yml index 6104b9e6..b205ae96 100644 --- a/{{cookiecutter.project_name}}/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/{{cookiecutter.project_name}}/.github/ISSUE_TEMPLATE/bug_report.yml @@ -19,6 +19,31 @@ body: validations: required: true + - type: textarea + id: code + attributes: + label: Minimal code sample + description: | + Reproducible code sample. Must list dependencies in [inline script metadata][]. When put in a file named `issue.py` using [uv run][] i.e., `uv run issue.py`, should show the issue. + + [uv run]: https://docs.astral.sh/uv/guides/scripts/#running-a-script-with-dependencies + [inline script metadata]: https://packaging.python.org/en/latest/specifications/inline-script-metadata/#example + render: python + value: | + ```python + # /// script + # requires-python = ">=3.12" + # dependencies = [ + # "{{cookiecutter.package_name}}@git+https://github.com/scverse/{{cookiecutter.project_name}}.git@main", + # ] + # /// + # + # This script automatically imports the development branch of {{cookiecutter.package_name}} to check for issues + + import {{cookiecutter.package_name}} + # your reproducer code + ``` + - type: textarea id: versions attributes: