Skip to content

Fix editable installation from relative paths on Windows #6416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2025

Conversation

stewartmiles
Copy link
Contributor

When running pipenv install -e .\..\mypackage the pip requirement line -e .\..\mypackage is written to a temporary requirements file which is passed to pip to install the package. pip fails to install the package from the requirements file as it incorrectly interprets the relative path, treating the slashes as escapes. To work around this issue replace all back slashes (windows directory separators) with forward slashes (POSIX directory separators) in pip lines for editable package installs.

Thank you for contributing to Pipenv!

The issue

What is the thing you want to fix? Is it associated with an issue on GitHub? Please mention it.

Always consider opening an issue first to describe your problem, so we can discuss what is the best way to amend it. Note that if you do not describe the goal of this change or link to a related issue, the maintainers may close the PR without further review.

If your pull request makes a significant change to Pipenv, such as the user interface or intended functionality, please open a discussion or issue report first.

The fix

How does this pull request fix your problem? Did you consider any alternatives? Why is this the best solution, in your opinion?

The checklist

  • Associated issue
  • A news fragment in the news/ directory to describe this fix with the extension .bugfix.rst, .feature.rst, .behavior.rst, .doc.rst. .vendor.rst. or .trivial.rst (this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.

@stewartmiles stewartmiles force-pushed the fix_relative_editable_install_win branch 2 times, most recently from cba3996 to fd75794 Compare June 4, 2025 21:59
@stewartmiles
Copy link
Contributor Author

Oh things still break when locking as the Windows style path is written to Pipfile, I'll fix that instead / as well. Until then hold off on reviewing this.

@stewartmiles stewartmiles force-pushed the fix_relative_editable_install_win branch from fd75794 to f4b93ba Compare June 4, 2025 23:32
@stewartmiles
Copy link
Contributor Author

Oh things still break when locking as the Windows style path is written to Pipfile, I'll fix that instead / as well. Until then hold off on reviewing this.

I had to fiddle with a few more code paths to get this to work when locking after installing a package from the parent directory of the configured pipenv venv directory.

@stewartmiles stewartmiles force-pushed the fix_relative_editable_install_win branch from f4b93ba to 5c217b9 Compare June 4, 2025 23:34
When running `pipenv install -e .\..\mypackage` the pip requirement
line `-e .\..\mypackage` is written to a temporary requirements file
which is passed to pip to install the package. pip fails to install
the package from the requirements file as it incorrectly interprets
the relative path, treating the slashes as escapes. To work around
this issue replace all back slashes (windows directory separators)
with forward slashes (POSIX directory separators) in pip requirements
for editable package installs.
@stewartmiles stewartmiles force-pushed the fix_relative_editable_install_win branch from 5c217b9 to aef9e6f Compare June 4, 2025 23:35
@matteius matteius merged commit 0b3bc13 into pypa:main Jun 6, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants