From 9eabc28dc13f1662e5c5b881b8efb4e6b37ee831 Mon Sep 17 00:00:00 2001 From: Pavel Karateev Date: Tue, 26 Aug 2025 15:39:42 +0200 Subject: [PATCH] PY-83588 support `pydevd-pycharm` installation on Linux & <=3.10 Python with PEP 517 support (introduced in PY-81877) building wheels is done in isolation, that means - there is no `setup_cython.py` available for import, one suggested workaround (used in `debugpy` as well) is to prepend the project root to `sys.path` - ugly but works (cherry picked from commit 67e6d93f0d19e20b16685255714c46a7563a037f) IJ-MR-173624 GitOrigin-RevId: 13457b1c9c447b296b6378d4ad1933d371b5c9d8 --- python/helpers/pydev/setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/helpers/pydev/setup.py b/python/helpers/pydev/setup.py index b5917ea400ae..d10e1e0d8925 100644 --- a/python/helpers/pydev/setup.py +++ b/python/helpers/pydev/setup.py @@ -29,6 +29,11 @@ from distutils.extension import Extension from setuptools import setup from setuptools.dist import Distribution +# PEP 517 compatibility +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from setup_cython import get_frame_eval_extension_name +del sys.path[0] + class BinaryDistribution(Distribution): def is_pure(self): @@ -192,7 +197,6 @@ if sys.platform not in ('darwin', 'win32'): ] )) if (3, 6) <= sys.version_info <= (3, 10): - from setup_cython import get_frame_eval_extension_name frame_eval_extension_name = get_frame_eval_extension_name() args_with_binaries["ext_modules"].append( # In this setup, don't even try to compile with cython, just go with the .c file which should've