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 191ac17 commit 68ab9b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/kubernetes_validate/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import platform
import re
import sys
from distutils.version import LooseVersion
from packaging.version import Version
from typing import Any, Dict, Generator, List

import jsonschema
Expand Down Expand Up @@ -46,7 +46,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 68ab9b5

Please sign in to comment.