summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-06-01 11:38:02 -0400
committerNed Batchelder <ned@nedbatchelder.com>2022-06-01 11:38:02 -0400
commit3a23d8ace3a38dc51ca6336834da03e5d15d8e4d (patch)
tree13f3bb6b165ec8dabff6d8efd354b26f8c2a815f
parenta8758a6878553902e8fea05c0a60adcdb55831bf (diff)
downloadpython-coveragepy-git-3a23d8ace3a38dc51ca6336834da03e5d15d8e4d.tar.gz
fix: use tomli for [toml] under more precise conditions. #1390
-rw-r--r--CHANGES.rst5
-rw-r--r--coverage/tomlconfig.py2
-rw-r--r--setup.py2
3 files changed, 7 insertions, 2 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index 25463fe3..db987743 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 b04d66e2..148c34f8 100644
--- a/coverage/tomlconfig.py
+++ b/coverage/tomlconfig.py
@@ -12,7 +12,7 @@ from coverage.exceptions import ConfigError
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 96959250..67aedc1b 100644
--- a/setup.py
+++ b/setup.py
@@ -108,7 +108,7 @@ setup_args = dict(
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.