From f1f2ed55e3d342c9ea3e08b8e683d8cd492d3509 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Sat, 12 Oct 2024 08:03:07 -0400 Subject: [PATCH] Added support for Python 3.13, removed support for Python 3.8. --- .pre-commit-config.yaml | 4 ++-- README.md | 2 +- changelog.d/+e1c61bf0.breaking.md | 1 + pyproject.toml | 7 +++---- src/jinjanator/cli.py | 8 +++++--- src/jinjanator/context.py | 4 +++- src/jinjanator/formats.py | 7 ++++++- tests/__init__.py | 7 ++++++- tests/conftest.py | 2 +- tests/test_argparse.py | 6 +++++- tests/test_output_file.py | 2 +- tests/test_plugin/jinjanator_test_plugin.py | 7 ++++++- tests/test_plugin/pyproject.toml | 4 ++-- workflow-support/versions.json | 2 +- 14 files changed, 43 insertions(+), 20 deletions(-) create mode 100644 changelog.d/+e1c61bf0.breaking.md diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e7e040f..e9cbb44 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,10 @@ repos: - repo: https://github.com/tox-dev/pyproject-fmt - rev: "2.2.1" + rev: "2.3.0" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.1 + rev: v0.6.9 hooks: - id: ruff-format - id: ruff diff --git a/README.md b/README.md index 9ac2cd9..32f2387 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Open Source Initiative Approved License logo [![CI](https://github.com/kpfleming/jinjanator/workflows/CI%20checks/badge.svg)](https://github.com/kpfleming/jinjanator/actions?query=workflow%3ACI%20checks) -[![Python](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/release/python-3812/) +[![Python](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/release/python-3920/) [![License - Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-9400d3.svg)](https://spdx.org/licenses/Apache-2.0.html) [![Types - Mypy](https://img.shields.io/badge/Types-Mypy-blue.svg)](https://github.com/python/mypy) [![Code Style and Quality - Ruff](https://img.shields.io/badge/Code%20Quality-Ruff-red.svg)](https://github.com/astral-sh/ruff) diff --git a/changelog.d/+e1c61bf0.breaking.md b/changelog.d/+e1c61bf0.breaking.md new file mode 100644 index 0000000..88e0c80 --- /dev/null +++ b/changelog.d/+e1c61bf0.breaking.md @@ -0,0 +1 @@ +Added support for Python 3.13, and removed support for Python 3.8. diff --git a/pyproject.toml b/pyproject.toml index ffbe0ef..f98b69b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ authors = [ { name = "Kevin P. Fleming", email = "jinjanator@kevin.km6g.us" }, { name = "Mark Vartanyan", email = "kolypto@gmail.com" }, ] -requires-python = ">=3.8" +requires-python = ">=3.9" classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Console", @@ -23,11 +23,11 @@ classifiers = [ "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Typing :: Typed", ] dynamic = [ @@ -136,7 +136,6 @@ dependencies = [ [[tool.hatch.envs.ci.matrix]] python = [ - "3.8", "3.9", "3.10", "3.11", @@ -292,7 +291,7 @@ name = "Fixes" showcontent = true [tool.mypy] -python_version = 3.8 +python_version = 3.9 namespace_packages = true explicit_package_bases = true check_untyped_defs = true diff --git a/src/jinjanator/cli.py b/src/jinjanator/cli.py index 14a53cd..16648ff 100644 --- a/src/jinjanator/cli.py +++ b/src/jinjanator/cli.py @@ -5,13 +5,15 @@ import os import sys +from typing import TYPE_CHECKING + + +if TYPE_CHECKING: # pragma: no cover + from collections.abc import Iterable, Mapping, Sequence from pathlib import Path from typing import ( Any, Callable, - Iterable, - Mapping, - Sequence, TextIO, cast, ) diff --git a/src/jinjanator/context.py b/src/jinjanator/context.py index cabbb8c..fbfaffa 100644 --- a/src/jinjanator/context.py +++ b/src/jinjanator/context.py @@ -1,9 +1,11 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Mapping, TextIO +from typing import TYPE_CHECKING, Any, TextIO if TYPE_CHECKING: # pragma: no cover + from collections.abc import Mapping + from jinjanator_plugins import ( Format, ) diff --git a/src/jinjanator/formats.py b/src/jinjanator/formats.py index 0cfaad5..5485cb5 100644 --- a/src/jinjanator/formats.py +++ b/src/jinjanator/formats.py @@ -4,8 +4,13 @@ import json import keyword +from typing import TYPE_CHECKING + + +if TYPE_CHECKING: # pragma: no cover + from collections.abc import Iterable, Mapping from io import StringIO -from typing import Any, Iterable, Mapping +from typing import Any import yaml diff --git a/tests/__init__.py b/tests/__init__.py index b8c488e..676a9b8 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,7 +1,12 @@ from __future__ import annotations +from typing import TYPE_CHECKING + + +if TYPE_CHECKING: # pragma: no cover + from collections.abc import Mapping, Sequence from pathlib import Path -from typing import Callable, Mapping, Sequence +from typing import Callable from attrs import define diff --git a/tests/conftest.py b/tests/conftest.py index e6123f1..2eb9407 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,7 +7,7 @@ from . import FilePair, FilePairFactory -if TYPE_CHECKING: +if TYPE_CHECKING: # pragma: no cover from pathlib import Path diff --git a/tests/test_argparse.py b/tests/test_argparse.py index 8ff05da..284c91e 100644 --- a/tests/test_argparse.py +++ b/tests/test_argparse.py @@ -1,6 +1,10 @@ from __future__ import annotations -from typing import Iterable, Mapping +from typing import TYPE_CHECKING + + +if TYPE_CHECKING: # pragma: no cover + from collections.abc import Iterable, Mapping import pytest diff --git a/tests/test_output_file.py b/tests/test_output_file.py index 82a0bab..735342c 100644 --- a/tests/test_output_file.py +++ b/tests/test_output_file.py @@ -8,7 +8,7 @@ ) -if TYPE_CHECKING: +if TYPE_CHECKING: # pragma: no cover import pathlib diff --git a/tests/test_plugin/jinjanator_test_plugin.py b/tests/test_plugin/jinjanator_test_plugin.py index 7f76d39..967f549 100644 --- a/tests/test_plugin/jinjanator_test_plugin.py +++ b/tests/test_plugin/jinjanator_test_plugin.py @@ -1,6 +1,11 @@ from __future__ import annotations -from typing import Iterable, Mapping +from typing import TYPE_CHECKING + + +if TYPE_CHECKING: # pragma: no cover + from collections.abc import Iterable, Mapping + from jinjanator_plugins import ( Extensions, diff --git a/tests/test_plugin/pyproject.toml b/tests/test_plugin/pyproject.toml index efddbad..4baacd8 100644 --- a/tests/test_plugin/pyproject.toml +++ b/tests/test_plugin/pyproject.toml @@ -7,14 +7,14 @@ requires = [ [project] name = "jinjanator-test-plugin" version = "0.0.0" -requires-python = ">=3.8" +requires-python = ">=3.9" classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] entry-points.jinjanator.test = "jinjanator_test_plugin" diff --git a/workflow-support/versions.json b/workflow-support/versions.json index 2dc44cb..5fdb6f0 100644 --- a/workflow-support/versions.json +++ b/workflow-support/versions.json @@ -1 +1 @@ -versions={"python": ["3.8", "3.9", "3.10", "3.11", "3.12"]} +versions={"python": ["3.9", "3.10", "3.11", "3.12"]}