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

Work around Debian bug in get_python_lib() #10255

Merged
merged 1 commit into from
Aug 6, 2021

Conversation

uranusjr
Copy link
Member

@uranusjr uranusjr commented Aug 1, 2021

#10151 (comment)
#10151 (comment)
#10151 (comment)
#10151 (comment)
#10217 (comment)

@siddhpant @Molkree @pdxjohnny @KanTakahiro

It turns out this is a bug in Debian’s distutils.sysconfig.get_python_lib() implementation. This function is called when pip builds a package from source (to create a build-time isolated environment), so it does not happen when you install a wheel (or when installing a package from source for a second time, because pip would cache the previously-built wheel). This patch basically just tries to detect that bug and pretend nothing happens when it triggers the warning.

Please give this a try and tell me if it can correctly suppress the warning.

@uranusjr uranusjr added this to the 21.2.3 milestone Aug 1, 2021
@uranusjr uranusjr changed the title Try to make distutils not emit relative paths Work around Debian bug in get_python_lib() Aug 1, 2021
@Molkree
Copy link
Contributor

Molkree commented Aug 1, 2021

Tested with python -m pip install -U git+https://github.com/uranusjr/pip.git@locations-deb-system-prefix, no warning anymore, thanks!

Copy link

@siddhpant siddhpant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully suppresses the warnings for me too. Thanks!

Used the same commands as @Molkree to test. Here is the procedure, in case it matters:

  1. Using the old pip (which shows the warnings):
pip install -U git+https://github.com/uranusjr/pip.git@locations-deb-system-prefix
  1. Force reinstall using new pip. It will build the package again since repo is specified. No warnings are shown now.
pip install -U --force-reinstall git+https://github.com/uranusjr/pip.git@locations-deb-system-prefix

@uranusjr uranusjr force-pushed the locations-deb-system-prefix branch from 404dd1e to 0d57982 Compare August 1, 2021 18:50
@uranusjr uranusjr merged commit 07c5620 into pypa:main Aug 6, 2021
@uranusjr uranusjr deleted the locations-deb-system-prefix branch August 6, 2021 09:55
@uranusjr uranusjr mentioned this pull request Aug 6, 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
Development

Successfully merging this pull request may close these issues.

3 participants