diff --git a/CHANGES.rst b/CHANGES.rst index 25463fe3c..db9877435 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -25,8 +25,13 @@ Unreleased 1381`_ and `pull 1388`_). Slightly improved performance when using the C trace function, as most environments do. +- The conditions for using tomllib from the standard library have been made + more precise, so that 3.11 alphas will continue to work. Closes `issue + 1390`_. + .. _pull 1381: https://github.com/nedbat/coveragepy/pull/1381 .. _pull 1388: https://github.com/nedbat/coveragepy/pull/1388 +.. _issue 1390: https://github.com/nedbat/coveragepy/issues/1390 .. _changes_64: diff --git a/coverage/tomlconfig.py b/coverage/tomlconfig.py index b04d66e24..148c34f89 100644 --- a/coverage/tomlconfig.py +++ b/coverage/tomlconfig.py @@ -12,7 +12,7 @@ from coverage.misc import import_third_party, substitute_variables -if env.PYVERSION >= (3, 11): +if env.PYVERSION >= (3, 11, 0, "alpha", 7): import tomllib # pylint: disable=import-error else: # TOML support on Python 3.10 and below is an install-time extra option. diff --git a/setup.py b/setup.py index 969592502..67aedc1bf 100644 --- a/setup.py +++ b/setup.py @@ -108,7 +108,7 @@ def better_set_verbosity(v): extras_require={ # Enable pyproject.toml support. - 'toml': ['tomli; python_version < "3.11"'], + 'toml': ['tomli; python_full_version<="3.11.0a6"'], }, # We need to get HTML assets from our htmlfiles directory.