Skip to content

Commit 388d46b

Browse files
committed
🐛 fix: change how Python versions show in the template README.md.jinja and in copier.yaml
1 parent 27b1676 commit 388d46b

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

copier.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,19 @@ min_python_version:
122122
type: str
123123
help: "Choose the minimum Python version the project should support:"
124124
default: "3.10"
125-
choices:
126-
- "3.10"
127-
- "3.11"
128-
- "3.12"
129-
- "3.13"
125+
choices: |
126+
{%- if python_version|float >= 3.10 %}
127+
- "3.10"
128+
{%- endif %}
129+
{% if python_version|float >= 3.11 %}
130+
- "3.11"
131+
{%- endif %}
132+
{% if python_version|float >= 3.12 %}
133+
- "3.12"
134+
{%- endif %}
135+
{% if python_version|float >= 3.13 %}
136+
- "3.13"
137+
{%- endif %}
130138
131139
py_versions:
132140
default: ["3.10", "3.11", "3.12", "3.13"]

template/README.md.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-orange.json)](https://github.com/copier-org/copier)
88
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
9-
[![Python Versions](https://img.shields.io/badge/python-{{ min_python_version }}%20|%20{% for minor in range(min_python_version.split('.')[1]|int, 14) %}3.{{ minor }}{% if not loop.last %}%20|%20{% endif %}{% endfor %}-blue.svg)]()
9+
[![Python Versions](https://img.shields.io/badge/python-{% for minor in range(min_python_version.split('.')[1]|int, 14) %}3.{{ minor }}{% if not loop.last %}%20|%20{% endif %}{% endfor %}-blue.svg)]()
1010
{%- if publish_to_pypi %}
1111
[![PyPI](https://img.shields.io/pypi/v/{{ project_name }})](https://pypi.org/project/{{ project_name }}/)
1212
{%- endif %}

0 commit comments

Comments
 (0)