From 4c0e09b7ca55b56b87bf5ca50d416814c0b86ca7 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Tue, 13 Jul 2021 09:29:50 -0400 Subject: [PATCH] Use sysconfig instead of distutils for Python 3.10 compatability (#2100) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- docs/changelog/2100.misc.rst | 2 ++ src/tox/helper/get_site_package_dir.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 docs/changelog/2100.misc.rst diff --git a/docs/changelog/2100.misc.rst b/docs/changelog/2100.misc.rst new file mode 100644 index 000000000..60dab49b6 --- /dev/null +++ b/docs/changelog/2100.misc.rst @@ -0,0 +1,2 @@ +``tox`` no longer shows deprecation warnings for ``distutils.sysconfig`` on +Python 3.10 - by :user:`9999years` diff --git a/src/tox/helper/get_site_package_dir.py b/src/tox/helper/get_site_package_dir.py index 584f5103e..942c85754 100644 --- a/src/tox/helper/get_site_package_dir.py +++ b/src/tox/helper/get_site_package_dir.py @@ -1,8 +1,8 @@ from __future__ import unicode_literals -import distutils.sysconfig import json import sys +import sysconfig -data = json.dumps({"dir": distutils.sysconfig.get_python_lib(prefix=sys.argv[1])}) +data = json.dumps({"dir": sysconfig.get_path("purelib", vars={"base": sys.argv[1]})}) print(data)