Skip to content

Commit 51ef944

Browse files
committed
Avoid modifying path placeholders created by editable installs
The setuptools implementation of editable installs will insert a placeholder entry into sys.path as part of its magic to register its custom import mechanism. These are not real filesystem paths and as such should not be rewritten to absolute paths.
1 parent f57c658 commit 51ef944

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

changelog/1028.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix compatiblity issue between `looponfail` and editable installs.

src/xdist/looponfail.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ def init_worker_session(channel, args, option_dict):
160160
newpaths = []
161161
for p in sys.path:
162162
if p:
163-
if not os.path.isabs(p):
163+
# Ignore path placeholders created for editable installs
164+
if not os.path.isabs(p) and not p.endswith(".__path_hook__"):
164165
p = os.path.abspath(p)
165166
newpaths.append(p)
166167
sys.path[:] = newpaths

0 commit comments

Comments
 (0)