-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Relative paths improvements for editable installs #5896
Conversation
…into editable-relative-refinment
# appending the non-common parts of the absolute path | ||
rel_parts = up_levels + list(abs_path.parts[common_parts:]) | ||
relative_path = Path(*rel_parts) | ||
return relative_path.as_posix() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
Is it possible that Path.cwd()
is not the virtual environment root path (i.e typically where the Pipfile is located?). I thought all paths were always relative to the Pipfile etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it has to be where the Pipfile is located because pipenv changes directories to that location when its invoked, if we ever change that assumption this here will break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So when pipenv is executed it changes the current working directory for the process to the location of the Pipfile? If so, I get it now, I just don't understand why the code path that manually constructs a relative code path is required if that's the case.
Thank you for contributing to Pipenv!
The issue
Relative paths are preferable for editable installs.
The fix
Fixes #5858
The checklist
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 #.