Skip to content
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

Correctly normalize relative paths for 'pip show' #10206

Merged
merged 4 commits into from
Jul 31, 2021

Conversation

uranusjr
Copy link
Member

@uranusjr uranusjr commented Jul 26, 2021

Fix #10204. Fix #10231.

Since the legacy installed-files.txt writes paths relatively to the egg-info directory, we need to introduce a new property on BaseDistribution to return that directory's path (analoguous to pkg_resources.Distribution.egg_info).

Entries in RECORD are normalized with pathlib.Path so they have the correct path component separator depending on the platform (e.g. / on Windows), to match the previous behavior.

@pradyunsg
Copy link
Member

mypy isn't happy.

This is passing against 21.1.3, but not main. The installed-files.txt
test case is substentially rewritten to correctly test against a legacy
setuptools installation.
Since the legacy installed-files.txt writes paths relatively to the
egg-info directory, we need to introduce a new property on
BaseDistribution to return that directory's path (analoguous to
pkg_resources's Distribution.egg_info).

Entries in RECORD are normalized with pathlib.Path so they have the
correct path component separator depending on the platform (e.g. '/' on
Windows), to match the previous behavior.
@uranusjr
Copy link
Member Author

@JAK0723 @mallamanis would be awesome if both of you could try this out with

pip install https://github.com/uranusjr/pip/archive/refs/heads/pip-show-files-paths.zip

@mallamanis
Copy link

Thanks a lot @uranusjr !
In a few local/manual tests I just run, I cannot observe the problem of #10204, so it looks like this has been resolved 😃

@JAK0723
Copy link

JAK0723 commented Jul 31, 2021

@uranusjr It seems to be working fine.

@uranusjr
Copy link
Member Author

Awesome! I’ll release 21.2.2 soon.

@uranusjr uranusjr changed the title Correctly normalize paths relative to install path Correctly normalize relative paths for 'pip show' Jul 31, 2021
@uranusjr uranusjr merged commit 6a22806 into pypa:main Jul 31, 2021
@uranusjr uranusjr deleted the pip-show-files-paths branch July 31, 2021 06:55
@uranusjr uranusjr mentioned this pull request Jul 31, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants