Skip to content

Post a deprecation warning for distutils configs #10218

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 2 commits into from
Jul 30, 2021

Conversation

uranusjr
Copy link
Member

This accounts to the Homebrew/Linuxbrew part of #10208.

Since we can't do anything about them in the transition (CPython is dropping support for those entirely), there's nothing we can do but to tell users to not use them.

This also accounts for Homebrew and Linuxbrew for now. Hopefully they will come up with better solutions that don't trigger the location mismatch warning.

Since we can't do anything about them in the transition (CPython is
dropping support for those entirely), there's nothing we can do but to
tell users to not use them.

This also accounts for Homebrew and Linuxbrew for now. Hopefully they
will come up with better solutions that don't trigger the location
mismatch warning.
@uranusjr uranusjr force-pushed the locations-distutils-cfg-warning branch from 16eb9dd to dac6068 Compare July 27, 2021 04:44
@uranusjr
Copy link
Member Author

uranusjr commented Jul 27, 2021

Pinging people reported this in #10151 for testing. Use this to install pip from this PR:

pip install https://github.com/uranusjr/pip/archive/refs/heads/locations-distutils-cfg-warning.zip

@ayusha98 @getcake @jakobbg @janesmae @joelfrederico @luckman212 @ondohotola @q2r5 @tg @thehiddenone @timecode @weaselskinghenry @webdeck @yermulnik @zhovner

@uranusjr
Copy link
Member Author

Note: You will still see a warning, but it should say DEPRECATION instead of WARNING and tell you to visit a Homebrew issue.

@jakobbg
Copy link

jakobbg commented Jul 27, 2021

Seems like error persists.

 2021-07-27T07:21:15.892Z DEBUG topgrade::executor   > Running "/Users/jakobbg/Library/Python/3.9/bin/pip3" "install" "--upgrade" "--user" "pip"
Requirement already satisfied: pip in ./Library/Python/3.9/lib/python/site-packages (21.2.1)
WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
distutils: /Users/jakobbg/Library/Python/3.9/include/python3.9/UNKNOWN
sysconfig: /Users/jakobbg/Library/Python/3.9/include/UNKNOWN
WARNING: Additional context:
user = True
home = None
root = None
prefix = None

@pfmoore
Copy link
Member

pfmoore commented Jul 27, 2021

@jakobbg You need to install a version of pip patched with this PR - the PR hasn't been merged or released yet.

@uranusjr
Copy link
Member Author

Yes, sorry for the confusion. I have updated my previous comment to include the instruction.

@yermulnik
Copy link

@uranusjr Would installing patched version of pip somehow interfere with LinuxBrew's pip installation? I mean when (or if) "patched" pip gets merged into Brew formulae will we need to apply any particular steps to get it back to be managed by Brew?
If there's none of stuff like that I'll be happy to install patched version and test in scope of this PR.

Thanks for looking into this.

@uranusjr
Copy link
Member Author

uranusjr commented Jul 27, 2021

Would installing patched version of pip somehow interfere with LinuxBrew's pip installation?

If you’re seeing the warning message presented in #10151, you are already not running Linuxbrew’s pip installation (or perhaps it means Linuxbrew doesn’t patch pip at all in the first place, I honestly have no idea), so in any case you wouldn’t break anything beyond what they are right now.

An alternative way to test this, if you really don’t want to install things into your brewed Python, is pip install --target this branch into wherever you feel comfortable with, and test by adding the directory to PYTHONPATH.

@yermulnik
Copy link

you are already not running Linuxbrew’s pip installation

The command which produced warnings for me was:

> /home/linuxbrew/.linuxbrew/bin/python3.9 -m pip --no-cache-dir install --upgrade --no-warn-script-location pip
WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
distutils: /home/linuxbrew/.linuxbrew/lib/python3.9/site-packages
sysconfig: /home/linuxbrew/.linuxbrew/Cellar/python@3.9/3.9.6/lib/python3.9/site-packages
WARNING: Value for scheme.purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
distutils: /home/linuxbrew/.linuxbrew/lib/python3.9/site-packages
sysconfig: /home/linuxbrew/.linuxbrew/Cellar/python@3.9/3.9.6/lib/python3.9/site-packages
WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
distutils: /home/linuxbrew/.linuxbrew/include/python3.9/UNKNOWN
sysconfig: /home/linuxbrew/.linuxbrew/Cellar/python@3.9/3.9.6/include/python3.9/UNKNOWN
WARNING: Value for scheme.scripts does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
distutils: /home/linuxbrew/.linuxbrew/bin
sysconfig: /home/linuxbrew/.linuxbrew/Cellar/python@3.9/3.9.6/bin
WARNING: Value for scheme.data does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
distutils: /home/linuxbrew/.linuxbrew
sysconfig: /home/linuxbrew/.linuxbrew/Cellar/python@3.9/3.9.6
WARNING: Additional context:
user = False
home = None
root = None
prefix = None
Requirement already satisfied: pip in /home/linuxbrew/.linuxbrew/lib/python3.9/site-packages (21.2.1)

And same for when I use --requirement /path/to/file instead of last arg on command line above.

So I used /home/linuxbrew/.linuxbrew/bin/python3.9 -m pip --no-cache-dir install --upgrade --no-warn-script-location https://github.com/uranusjr/pip/archive/refs/heads/locations-distutils-cfg-warning.zip to install patched pip and the WARNINGs got replaced with DEPRECATIONs (which can be suppressed with PYTHONWARNINGS="ignore:DEPRECATION" env var in case of my env).

Looks good, right?

@uranusjr
Copy link
Member Author

@yermulnik Yup, lgtm. Thanks for trying this out!

@uranusjr
Copy link
Member Author

Pinging people reported this in #10151 for testing. Use this to install pip from this PR:

pip install https://github.com/uranusjr/pip/archive/refs/heads/locations-distutils-cfg-warning.zip

2021-07-28 08:56:00+0800: @noplanman @akhst7 @dchassin @EGOBrainiac

2021-07-30 09:17:00+0800: @retorquere @PompeiaPaetenari @lgeiger @drossqfd @Kevinoh47 @nskobelevs @intelliot

You will still see a warning, but it should say DEPRECATION instead of WARNING and tell you to visit a Homebrew issue. This is because Homebrew is doing something that will soon be deprecated, and pip needs it to fix things on their side.

@jakobbg
Copy link

jakobbg commented Jul 30, 2021

You will still see a warning, but it should say DEPRECATION instead of WARNING and tell you to visit a Homebrew issue. This is because Homebrew is doing something that will soon be deprecated, and pip needs it to fix things on their side.

I still get a warning on M1 Apple Silicon Macbook Air:

WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
distutils: /Users/jakobbg/Library/Python/3.9/include/python3.9/UNKNOWN
sysconfig: /Users/jakobbg/Library/Python/3.9/include/UNKNOWN
WARNING: Additional context:
user = True
home = None
root = None
prefix = None```

@uranusjr
Copy link
Member Author

@jakobbg Can you try if #10215 makes that one go away?

@gtrabanco
Copy link

gtrabanco commented Jul 30, 2021

Installed using:

python3 -m pip install --upgrade --user https://github.com/uranusjr/pip/archive/refs/heads/locations-distutils-cfg-warning.zip
Collecting https://github.com/uranusjr/pip/archive/refs/heads/locations-distutils-cfg-warning.zip
  Downloading https://github.com/uranusjr/pip/archive/refs/heads/locations-distutils-cfg-warning.zip
     | 9.2 MB 885 kB/s
  WARNING: Value for prefixed-purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /private/var/folders/65/vgssmjps1wj8j28cpfxsr2zw0000gn/T/pip-build-env-g8yyf_04/normal/lib/python3.8/site-packages
  sysconfig: /Library/Python/3.8/site-packages
  WARNING: Value for prefixed-platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /private/var/folders/65/vgssmjps1wj8j28cpfxsr2zw0000gn/T/pip-build-env-g8yyf_04/normal/lib/python3.8/site-packages
  sysconfig: /Library/Python/3.8/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = '/private/var/folders/65/vgssmjps1wj8j28cpfxsr2zw0000gn/T/pip-build-env-g8yyf_04/normal'
  WARNING: Value for prefixed-purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /private/var/folders/65/vgssmjps1wj8j28cpfxsr2zw0000gn/T/pip-build-env-g8yyf_04/overlay/lib/python3.8/site-packages
  sysconfig: /Library/Python/3.8/site-packages
  WARNING: Value for prefixed-platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /private/var/folders/65/vgssmjps1wj8j28cpfxsr2zw0000gn/T/pip-build-env-g8yyf_04/overlay/lib/python3.8/site-packages
  sysconfig: /Library/Python/3.8/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = '/private/var/folders/65/vgssmjps1wj8j28cpfxsr2zw0000gn/T/pip-build-env-g8yyf_04/overlay'
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: pip
  Building wheel for pip (PEP 517) ... done
  Created wheel for pip: filename=pip-21.3.dev0-py3-none-any.whl size=1552819 sha256=6914313b9c2822fd70dac23ce63e3a5a56bf093740c3ad1a350af682f39c28ba
  Stored in directory: /Users/gtrabanco/Library/Caches/pip/wheels/ae/9b/f4/420a66e1382bc125fa909f9fb1a9db0a1212dabf3616840bcd
Successfully built pip
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.2.1
    Uninstalling pip-21.2.1:
      Successfully uninstalled pip-21.2.1
  WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /Users/gtrabanco/Library/Python/3.8/include/python3.8/pip
  sysconfig: /Users/gtrabanco/Library/Python/3.8/include/pip
  WARNING: Additional context:
  user = True
  home = None
  root = None
  prefix = None
WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
distutils: /Users/gtrabanco/Library/Python/3.8/include/python3.8/UNKNOWN
sysconfig: /Users/gtrabanco/Library/Python/3.8/include/UNKNOWN
Successfully installed pip-21.3.dev0

Now when executing:

python3 -m pip install --upgrade --user pip

System: MacOS Big Sur 11.4 using zsh shell (5.8)

Show no errors... So seems that this worked fine.

Thanks @uranusjr for the patch!

@uranusjr uranusjr merged commit f4910d2 into pypa:main Jul 30, 2021
@uranusjr uranusjr deleted the locations-distutils-cfg-warning branch July 30, 2021 15:35
@uranusjr uranusjr mentioned this pull request Jul 31, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 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.

6 participants