From 46aa4e5e26e1a9662bd76566a9bea679adaa0ec6 Mon Sep 17 00:00:00 2001 From: Fabio Zadrozny Date: Sun, 18 Feb 2024 14:34:20 -0300 Subject: [PATCH] Make sure that paths in setup.py are relative. --- setup.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index ef77ed54..d90f4491 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,7 @@ class BinaryDistribution(Distribution): + def is_pure(self): return False @@ -47,15 +48,19 @@ def accept_file(f): return f in ["readme", "makefile"] +def make_rel(p): + return os.path.relpath(p, this_dir) + + data_files.append( ( "pydevd_attach_to_process", - [os.path.join(attach_to_process_dir, f) for f in os.listdir(attach_to_process_dir) if accept_file(f)], + [make_rel(os.path.join(attach_to_process_dir, f)) for f in os.listdir(attach_to_process_dir) if accept_file(f)], ) ) for root, dirs, files in os.walk(attach_to_process_dir): for d in dirs: - data_files.append((os.path.join(root, d), [os.path.join(root, d, f) for f in os.listdir(os.path.join(root, d)) if accept_file(f)])) + data_files.append((make_rel(os.path.join(root, d)), [make_rel(os.path.join(root, d, f)) for f in os.listdir(os.path.join(root, d)) if accept_file(f)])) import pydevd