Skip to content

Commit

Permalink
Deprecate python 3.8, add support for python 3.13 (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw authored Feb 15, 2025
1 parent 3e728f9 commit 77b1416
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 23 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci-copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
minimal-python-version: [py38, py310]
minimal-python-version: [py39, py311, py313]
steps:
- name: Checkout branch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
fetch-depth: 0
- name: Set up pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
with:
Expand All @@ -73,10 +74,10 @@ jobs:
--data github_user="LandoCalrissian" \
--data author_name="Lando Calrissian" \
--data author_email="[email protected]" \
--data project_slug="package" \
--data minimal_python_version="${{ matrix.minimal-python-version }}" \
--defaults \
--trust \
--vcs-ref HEAD \
. out
cd out
# Replace actions trigger with on: [push]
Expand Down
6 changes: 3 additions & 3 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ minimal_python_version:
type: str
help: What is the minimal Python version you want to support?
choices:
- py38
- py39
- py310
- py311
- py312
default: py38
- py313
default: py39

minimal_python_version_sortable:
type: str
default: "{{ minimal_python_version.replace('py38', 'py308').replace('py39', 'py309') }}"
default: "{{ minimal_python_version.replace('py39', 'py309') }}"
when: false

use_devcontainer:
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 @@ -32,7 +32,7 @@ jobs:
strategy:
fail-fast: false
matrix:
{%- set python_versions = ["py38", "py39", "py310", "py311", "py312"] %}
{%- set python_versions = ["py39", "py310", "py311", "py312", "py313"] %}
{%- set minimal_version_index = python_versions.index(minimal_python_version) %}
environment:
{%- for python_version in python_versions[minimal_version_index:] %}
Expand Down
14 changes: 7 additions & 7 deletions template/pixi.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ platforms = ["osx-arm64", "osx-64", "linux-64", "win-64"]
postinstall = "pip install --no-build-isolation --no-deps --disable-pip-version-check -e ."

[dependencies]
python = ">={{ minimal_python_version[2:].replace('3', '3.') }}"
python = ">={{ minimal_python_version.replace('py3', '3.') }}"

[host-dependencies]
pip = "*"
Expand Down Expand Up @@ -43,23 +43,20 @@ typos = "*"
pre-commit-install = "pre-commit install"
pre-commit-run = "pre-commit run -a"

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

[environments]
default = ["test"]
{%- if minimal_python_version_sortable <= "py308" %}
py38 = ["py38", "test"]
{%- endif %}
{%- if minimal_python_version_sortable <= "py309" %}
py39 = ["py39", "test"]
{%- endif %}
Expand All @@ -72,6 +69,9 @@ py311 = ["py311", "test"]
{%- if minimal_python_version_sortable <= "py312" %}
py312 = ["py312", "test"]
{%- endif %}
{%- if minimal_python_version_sortable <= "py313" %}
py313 = ["py313", "test"]
{%- endif %}
{%- if build_docs %}
docs = ["docs"]
{%- endif %}
Expand Down
10 changes: 5 additions & 5 deletions template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ authors = [{ name = "{{ author_name }}", email = "{{ author_email }}" }]
dynamic = ["version"]
classifiers = [
"Programming Language :: Python :: 3",
{%- if minimal_python_version_sortable <= "py308" %}
"Programming Language :: Python :: 3.8",
{%- endif %}
{%- if minimal_python_version_sortable <= "py309" %}
"Programming Language :: Python :: 3.9",
{%- endif %}
Expand All @@ -23,9 +20,12 @@ classifiers = [
{%- if minimal_python_version_sortable <= "py311" %}
"Programming Language :: Python :: 3.11",
{%- endif %}
{%- if minimal_python_version_sortable <= "py312" %}
"Programming Language :: Python :: 3.12",
{%- endif %}
"Programming Language :: Python :: 3.13",
]
requires-python = ">={{ minimal_python_version[2:].replace('3', '3.') }}"
requires-python = ">={{ minimal_python_version.replace('py3', '3.') }}"
readme = "README.md"
dependencies = []

Expand Down Expand Up @@ -65,7 +65,7 @@ quote-style = "double"
indent-style = "space"

[tool.mypy]
python_version = '{{ minimal_python_version[2:].replace('3', '3.') }}'
python_version = '{{ minimal_python_version.replace('py3', '3.') }}'
no_implicit_optional = true
check_untyped_defs = true

Expand Down
8 changes: 3 additions & 5 deletions tests/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,11 @@ def test_add_autobump_workflow(generate_project, add_autobump_workflow):


@pytest.mark.parametrize(
"minimal_python_version", ["py38", "py39", "py310", "py311", "py312"]
"minimal_python_version", ["py39", "py310", "py311", "py312", "py313"]
)
def test_minimal_python_version(generate_project, minimal_python_version: str):
minimal_python_version_str = minimal_python_version.replace("py", "").replace(
"3", "3."
)
all_supported_python_versions = ["3.8", "3.9", "3.10", "3.11", "3.12"]
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_envs = [
f"py{version.replace('.', '')}" for version in all_supported_python_versions
]
Expand Down

0 comments on commit 77b1416

Please sign in to comment.