diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9219ede..572bafa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -75,6 +75,12 @@ jobs: py311-pip213, py311-piplatest, py311-pipgit, + py312-pip192, + py312-pip193, + py312-pip203, + py312-pip213, + py312-piplatest, + py312-pipgit, mypy, ] diff --git a/tests/conftest.py b/tests/conftest.py index 088eb80..77dd195 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -20,6 +20,7 @@ import pytest import os import subprocess +import sys from tempfile import TemporaryDirectory try: @@ -51,6 +52,14 @@ def _venv_install_pip(venv): if MICROPIPENV_TEST_SETUPTOOLS_VERSION is not None: venv.install(f"setuptools{MICROPIPENV_TEST_SETUPTOOLS_VERSION}") + elif sys.version_info >= (3, 12): + # pytest-venv does not work with Python 3.12 + # because it uses pkg_resources in venv but + # setuptools is not in the venv by default for 3.12+ + # This branch can be removed when + # https://github.com/mmerickel/pytest-venv/issues/5 + # is fixed and released + venv.install("setuptools") def _venv_get_version_or_none(self, package): diff --git a/tox.ini b/tox.ini index 14a1705..5eb8608 100644 --- a/tox.ini +++ b/tox.ini @@ -11,6 +11,7 @@ envlist = py310-pip{latest,git}-pytoml py310-pip{latest,git}-tomli py311-pip{192,193,203,213,latest,git} + py312-pip{192,193,203,213,latest,git} mypy [testenv]