Skip to content

Commit 8dcb30c

Browse files
committed
Add Windows path separator normalization for constraints reference
During rebase, the Windows path fix (forward slash normalization) was lost. This commit restores the .replace("\\", "/") calls that ensure pip can correctly interpret constraint paths on all platforms. Related to #22 and #25
1 parent 78df434 commit 8dcb30c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/mxdev/processing.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,13 @@ def write(state: State) -> None:
283283
# Calculate relative path from requirements directory to constraints file
284284
try:
285285
constraints_ref = os.path.relpath(const_path, req_path.parent)
286+
# Convert backslashes to forward slashes for pip compatibility
287+
# pip expects forward slashes even on Windows
288+
constraints_ref = constraints_ref.replace("\\", "/")
286289
except ValueError:
287290
# On Windows, relpath can fail if paths are on different drives
288-
# In that case, use absolute path
289-
constraints_ref = str(const_path.absolute())
291+
# In that case, use absolute path with forward slashes
292+
constraints_ref = str(const_path.absolute()).replace("\\", "/")
290293

291294
fio.write("#" * 79 + "\n")
292295
fio.write("# mxdev combined constraints\n")

0 commit comments

Comments
 (0)