Skip to content

Commit

Permalink
Update test suite ready for python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
willthames committed Dec 9, 2023
1 parent 526bb8c commit 4eb3b53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/kubernetes_validate/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
import platform
import re
import sys
<<<<<<< HEAD
from distutils.version import LooseVersion
from typing import Any, Dict, Generator, List, Union
from typing_extensions import Protocol
from packaging.version import Version

import jsonschema
import pkg_resources
Expand Down Expand Up @@ -51,7 +53,7 @@ def all_versions() -> List[str]:
schemas = pkg_resources.resource_listdir('kubernetes_validate', '/kubernetes-json-schema')
version_regex = re.compile(r'^v([^-]*).*')
return sorted([version_regex.sub(r"\1", schema) for schema in schemas if version_regex.match(schema)],
key=LooseVersion)
key=Version)


def major_minor(version: str) -> str:
Expand Down
10 changes: 5 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[tox]
minversion = 1.6
envlist = py{38,39,310}-{pytest,flake8},mypy
envlist = py{310,311,312}-{pytest,flake8},mypy

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310, mypy
3.11: py311, mypy
3.12: py312, mypy

[testenv]

[testenv:py{38,39,310}-pytest]
[testenv:py{310,311,312}-pytest]
deps =
-rtest-deps.txt
commands = pytest
passenv = HOME
recreate = False

[testenv:py{38,39,310}-flake8]
[testenv:py{310,311,312}-flake8]
platform = linux|darwin
deps = flake8
commands = python -m flake8 src
Expand Down

0 comments on commit 4eb3b53

Please sign in to comment.