From: Julian Gilbey Date: Mon, 5 Sep 2022 20:56:24 +0000 (+0100) Subject: Handle Debian's purelib setting X-Git-Tag: archive/raspbian/2.8.0+git20220826.8ee4065+ds-1+rpi1^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b301cb08cfc169a48f7d7411cc571f25f51a38b4;p=pydevd.git Handle Debian's purelib setting Forwarded: not-needed Last-Update: 2022-06-21 In Python 3.9 (and presumably earlier), sysconfig.get_path('purelib') returns a path which does not exist on Debian, breaking a test. This is already reported as a Debian bug (#998739). As Python 3.9 is being retired from Debian, we just skip the problematic parts of this test. Gbp-Pq: Name test_convert_utilities.patch --- diff --git a/tests_python/test_convert_utilities.py b/tests_python/test_convert_utilities.py index 54e664d..0fc9398 100644 --- a/tests_python/test_convert_utilities.py +++ b/tests_python/test_convert_utilities.py @@ -1,6 +1,6 @@ # coding: utf-8 import os.path -from _pydevd_bundle.pydevd_constants import IS_WINDOWS +from _pydevd_bundle.pydevd_constants import IS_WINDOWS, IS_PY310_OR_GREATER import io from _pydev_bundle.pydev_log import log_context import pytest @@ -307,7 +307,8 @@ def test_relative_paths(tmpdir): pydevd_file_utils.NORM_PATHS_AND_BASE_CONTAINER.clear() pydevd_file_utils.NORM_PATHS_CONTAINER.clear() abs_path = pydevd_file_utils.get_abs_path_real_path_and_base_from_file('my_dir/my_file.pyx')[0] - assert 'site-packages' in abs_path + if IS_PY310_OR_GREATER: + assert 'site-packages' in abs_path or 'dist-packages' in abs_path assert os.path.normcase(str(tmpdir)) not in abs_path assert not pydevd_file_utils.exists('my_dir/my_file.pyx') @@ -321,7 +322,8 @@ def test_relative_paths(tmpdir): pydevd_file_utils.NORM_PATHS_AND_BASE_CONTAINER.clear() pydevd_file_utils.NORM_PATHS_CONTAINER.clear() abs_path = pydevd_file_utils.get_abs_path_real_path_and_base_from_file('my_dir/my_file.pyx')[0] - assert 'site-packages' not in abs_path + if IS_PY310_OR_GREATER: + assert 'site-packages' not in abs_path and 'dist-packages' not in abs_path assert str(tmpdir) in abs_path assert pydevd_file_utils.exists('my_dir/my_file.pyx') finally: