Skip to content

Commit a4e407c

Browse files
authored
Update supported Python range to 3.9-3.13 (#508)
- Update the lower bound from 3.8 to 3.9 - Update the highest tested version from 3.12 to 3.13 - Remove importlib-resources dependency (for <3.9)
1 parent a9da72e commit a4e407c

File tree

8 files changed

+18
-32
lines changed

8 files changed

+18
-32
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
py: ["3.x"]
1212
include:
1313
- toxenv: py-mindeps
14-
py: "3.8"
14+
py: "3.9"
1515

1616
runs-on: ubuntu-latest
1717
name: "Run '${{ matrix.toxenv }}' on python ${{ matrix.py }}"
@@ -62,7 +62,7 @@ jobs:
6262
strategy:
6363
matrix:
6464
os: [ubuntu-latest, windows-latest, macos-latest]
65-
py: ['3.8', '3.9', '3.10', '3.11', '3.12']
65+
py: ['3.9', '3.10', '3.11', '3.12', '3.13']
6666
name: "Run tests on ${{ matrix.os }}, py${{ matrix.py }}"
6767
runs-on: ${{ matrix.os }}
6868
steps:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ repos:
4242
rev: v3.19.1
4343
hooks:
4444
- id: pyupgrade
45-
args: ["--py37-plus"]
45+
args: ["--py39-plus"]

.readthedocs.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ sphinx:
44
configuration: docs/conf.py
55

66
build:
7-
os: ubuntu-20.04
7+
os: ubuntu-24.04
88
tools:
9-
python: "3.10"
9+
python: "3.13"
1010

1111
python:
1212
install:
1313
- method: pip
1414
path: .
1515
extra_requirements:
1616
- docs
17-

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Unreleased
1111
.. vendor-insert-here
1212
1313
- Update vendored schemas (2024-12-22)
14+
- Drop support for Python 3.8
1415

1516
0.30.0
1617
------

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ classifiers = [
1515
"License :: OSI Approved :: Apache Software License",
1616
"Programming Language :: Python :: 3",
1717
]
18-
requires-python = ">=3.8"
18+
requires-python = ">=3.9"
1919
dependencies = [
20-
'importlib-resources>=1.4.0;python_version<"3.9"',
2120
'tomli>=2.0;python_version<"3.11"',
2221
"ruamel.yaml==0.18.6",
2322
"jsonschema>=4.18.0,<5.0",

src/check_jsonschema/builtin_schemas/__init__.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
from __future__ import annotations
22

3-
try:
4-
# first, try to import the installed package version
5-
import importlib_resources
6-
except ImportError:
7-
# if it's not installed, assume that the stdlib version is new enough (e.g. py3.10)
8-
import importlib.resources as importlib_resources # type: ignore[no-redef]
9-
3+
import importlib.resources
104
import json
115
import typing as t
126

@@ -20,7 +14,7 @@ def _get(package: str, resource: str, name: str) -> dict[str, t.Any]:
2014
return t.cast(
2115
"dict[str, t.Any]",
2216
json.loads(
23-
importlib_resources.files(package).joinpath(resource).read_bytes()
17+
importlib.resources.files(package).joinpath(resource).read_bytes()
2418
),
2519
)
2620
except (FileNotFoundError, ModuleNotFoundError):

src/check_jsonschema/cli/main_command.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import os
4-
import sys
54
import textwrap
65
import typing as t
76

@@ -24,11 +23,6 @@
2423
from .param_types import CommaDelimitedList, LazyBinaryReadFile, ValidatorClassName
2524
from .parse_result import ParseResult, SchemaLoadingMode
2625

27-
if sys.version_info >= (3, 8):
28-
from typing import Literal
29-
else:
30-
from typing_extensions import Literal
31-
3226
BUILTIN_SCHEMA_NAMES = [f"vendor.{k}" for k in SCHEMA_CATALOG.keys()] + [
3327
f"custom.{k}" for k in CUSTOM_SCHEMA_NAMES
3428
]
@@ -236,13 +230,13 @@ def main(
236230
no_cache: bool,
237231
cache_filename: str | None,
238232
disable_formats: tuple[list[str], ...],
239-
format_regex: Literal["python", "default"],
240-
default_filetype: Literal["json", "yaml", "toml", "json5"],
241-
traceback_mode: Literal["full", "short"],
242-
data_transform: Literal["azure-pipelines", "gitlab-ci"] | None,
233+
format_regex: t.Literal["python", "default"],
234+
default_filetype: t.Literal["json", "yaml", "toml", "json5"],
235+
traceback_mode: t.Literal["full", "short"],
236+
data_transform: t.Literal["azure-pipelines", "gitlab-ci"] | None,
243237
fill_defaults: bool,
244238
validator_class: type[jsonschema.protocols.Validator] | None,
245-
output_format: Literal["text", "json"],
239+
output_format: t.Literal["text", "json"],
246240
verbose: int,
247241
quiet: int,
248242
instancefiles: tuple[t.IO[bytes], ...],

tox.ini

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
envlist =
33
mypy
44
cov_clean
5-
py38-mindeps{,-format}
6-
py{312,311,310,39,38}
7-
py{38,312}-{json5,pyjson5}{,-format}
8-
py{38,312}-{disable_orjson}
5+
py39-mindeps{,-format}
6+
py{313,312,311,310,39}
7+
py{39,313}-{json5,pyjson5}{,-format}
8+
py{39,313}-{disable_orjson}
99
cov
1010
skip_missing_interpreters = true
1111
minversion = 4.0.0
@@ -24,7 +24,6 @@ deps =
2424
mindeps: jsonschema==4.18.0
2525
mindeps: click==8.0.0
2626
mindeps: requests==2.0.0
27-
mindeps: importlib-resources==1.4.0
2827
!disable_orjson: orjson
2928
json5: json5
3029
pyjson5: pyjson5

0 commit comments

Comments
 (0)