Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/workflows/ci-copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
minimal-python-version: [py39, py311, py313]
minimal-python-version: [py310, py311, py314]
steps:
- name: Checkout branch
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand Down Expand Up @@ -126,3 +126,20 @@ jobs:
do
curl -Ls --header "$AUTH" --request POST "$GITHUB_API_URL/repos/${GITHUB_REPOSITORY}/actions/runs/$line/cancel" > /dev/null
done

finalize:
name: Test CI of generated package (all)
timeout-minutes: 5
runs-on: ubuntu-latest
needs: test-generated-package-ci
if: always() && !cancelled()
steps:
- if: needs.test-generated-package-ci.result == 'success'
name: All tests passed
run: echo All tests passed

- if: needs.test-generated-package-ci.result != 'success'
name: Some tests failed
run: |
echo Some tests failed
exit 1
9 changes: 2 additions & 7 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,12 @@ minimal_python_version:
type: str
help: What is the minimal Python version you want to support?
choices:
- py39
- py310
- py311
- py312
- py313
default: py39

minimal_python_version_sortable:
type: str
default: "{{ minimal_python_version.replace('py39', 'py309') }}"
when: false
- py314
default: py310

use_devcontainer:
type: bool
Expand Down
2 changes: 1 addition & 1 deletion template/.github/workflows/ci.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
strategy:
fail-fast: false
matrix:
{%- set python_versions = ["py39", "py310", "py311", "py312", "py313"] %}
{%- set python_versions = ["py310", "py311", "py312", "py313", "py314"] %}
{%- set minimal_version_index = python_versions.index(minimal_python_version) %}
environment:
{%- for python_version in python_versions[minimal_version_index:] %}
Expand Down
26 changes: 13 additions & 13 deletions template/pixi.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -42,35 +42,35 @@ zizmor = "*"
pre-commit-install = "lefthook install"
lint = "lefthook run pre-commit --all-files"

{% if minimal_python_version_sortable <= "py309" %}[feature.py39.dependencies]
python = "3.9.*"
{% endif %}{% if minimal_python_version_sortable <= "py310" %}[feature.py310.dependencies]
{% if minimal_python_version <= "py310" %}[feature.py310.dependencies]
python = "3.10.*"
{% endif %}{% if minimal_python_version_sortable <= "py311" %}[feature.py311.dependencies]
{% endif %}{% if minimal_python_version <= "py311" %}[feature.py311.dependencies]
python = "3.11.*"
{% endif %}{% if minimal_python_version_sortable <= "py312" %}[feature.py312.dependencies]
{% endif %}{% if minimal_python_version <= "py312" %}[feature.py312.dependencies]
python = "3.12.*"
{% endif %}{% if minimal_python_version_sortable <= "py313" %}[feature.py313.dependencies]
{% endif %}{% if minimal_python_version <= "py313" %}[feature.py313.dependencies]
python = "3.13.*"
{% endif %}{% if minimal_python_version <= "py314" %}[feature.py314.dependencies]
python = "3.14.*"
{%- endif %}

[environments]
default = ["test", "lint"]
{%- if minimal_python_version_sortable <= "py309" %}
py39 = ["py39", "test"]
{%- endif %}
{%- if minimal_python_version_sortable <= "py310" %}
{%- if minimal_python_version <= "py310" %}
py310 = ["py310", "test"]
{%- endif %}
{%- if minimal_python_version_sortable <= "py311" %}
{%- if minimal_python_version <= "py311" %}
py311 = ["py311", "test"]
{%- endif %}
{%- if minimal_python_version_sortable <= "py312" %}
{%- if minimal_python_version <= "py312" %}
py312 = ["py312", "test"]
{%- endif %}
{%- if minimal_python_version_sortable <= "py313" %}
{%- if minimal_python_version <= "py313" %}
py313 = ["py313", "test"]
{%- endif %}
{%- if minimal_python_version <= "py314" %}
py314 = ["py314", "test"]
{%- endif %}
{%- if build_docs %}
docs = ["docs"]
{%- endif %}
Expand Down
12 changes: 6 additions & 6 deletions template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ authors = [{ name = "{{ author_name }}", email = "{{ author_email }}" }]
dynamic = ["version"]
classifiers = [
"Programming Language :: Python :: 3",
{%- if minimal_python_version_sortable <= "py309" %}
"Programming Language :: Python :: 3.9",
{%- endif %}
{%- if minimal_python_version_sortable <= "py310" %}
{%- if minimal_python_version <= "py310" %}
"Programming Language :: Python :: 3.10",
{%- endif %}
{%- if minimal_python_version_sortable <= "py311" %}
{%- if minimal_python_version <= "py311" %}
"Programming Language :: Python :: 3.11",
{%- endif %}
{%- if minimal_python_version_sortable <= "py312" %}
{%- if minimal_python_version <= "py312" %}
"Programming Language :: Python :: 3.12",
{%- endif %}
{%- if minimal_python_version <= "py313" %}
"Programming Language :: Python :: 3.13",
{%- endif %}
"Programming Language :: Python :: 3.14",
]
requires-python = ">={{ minimal_python_version.replace('py3', '3.') }}"
readme = "README.md"
Expand Down
4 changes: 2 additions & 2 deletions tests/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ def test_add_autobump_workflow(generate_project, add_autobump_workflow):


@pytest.mark.parametrize(
"minimal_python_version", ["py39", "py310", "py311", "py312", "py313"]
"minimal_python_version", ["py310", "py311", "py312", "py313", "py314"]
)
def test_minimal_python_version(generate_project, minimal_python_version: str):
minimal_python_version_str = minimal_python_version.replace("py3", "3.")
all_supported_python_versions = ["3.9", "3.10", "3.11", "3.12", "3.13"]
all_supported_python_versions = ["3.10", "3.11", "3.12", "3.13", "3.14"]
all_supported_python_envs = [
f"py{version.replace('.', '')}" for version in all_supported_python_versions
]
Expand Down