Skip to content

distutils config files deprecation too noisy, too early, wrong audience #10712

@nopdotcom

Description

@nopdotcom

Description

When I install packages outside a virtualenv using Homebrew, I get multiple deprecation warnings per run; these warnings are not intended for me, seem unlikely to affect me for two years, and there is no way to silence them.

There is no rate-limit on this warning. There is no pip --use-deprecated option to quiet this warning. python3 -W ignore::DeprecationWarning -m pip doesn't work (and arguably shouldn't); -W ignore::Warning does work, but I assume there are other warnings I do want to see.

~ dilemma$ python3 -m pip install rich
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Collecting rich
  Using cached rich-10.15.2-py3-none-any.whl (214 kB)
Collecting pygments<3.0.0,>=2.6.0
  Using cached Pygments-2.10.0-py3-none-any.whl (1.0 MB)
Collecting commonmark<0.10.0,>=0.9.0
  Using cached commonmark-0.9.1-py2.py3-none-any.whl (51 kB)
Collecting colorama<0.5.0,>=0.4.0
  Using cached colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Installing collected packages: pygments, commonmark, colorama, rich
  DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
  DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
  DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
  DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Successfully installed colorama-0.4.4 commonmark-0.9.1 pygments-2.10.0 rich-10.15.2
~ dilemma$ 

Note that the simplest way of triggering this is just running pip install by itself:

~ dilemma$ python3 -m pip install
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
ERROR: You must give at least one requirement to install (see "pip help install")
~ dilemma$

Expected behavior

  1. I am a relatively sophisticated user. If my distro is doing something bad, maybe I want to hear about it. But I also want to hear about the timeframe it is likely to affect me. If we're talking about Python 3.12, I don't have to care for two years.

  2. Many inexperienced users will become alarmed at these deprecation warnings, especially because they are printed so often.

My expectation is that this will be printed at most once per pip version upgrade:

DEPRECATION WARNING: Your environment configures installation schemes
using distutils config files. This behavior is deprecated, and `pip`
will stop working in your environment with the release of Foobar 4.23
(expected October 2023). If you are a Homebrew or Linuxbrew Python
user, please see further details at
https://github.com/Homebrew/homebrew-core/issues/76621

pip version

pip 21.3.1

Python version

Python 3.9.9 (Homebrew 3.3.6-72-g5096d6e; https://github.com/Homebrew/homebrew-core/blob/cb104b31ef5762265f3bf253493df23d1a533171/Formula/python%403.9.rb)

OS

macOS 11.6.1

How to Reproduce

  1. Install Homebrew 3.3.6, install python
  2. python3 -m pip install
  3. Note the warning intended for Homebrew maintainers
  4. python3 -m pip install
  5. Note the warning apparently not relevant to you for at least a year
  6. python3 -m pip install
  7. Note the warning you can't do anything about
  8. python3 -m pip install
  9. Note the warning for the fourth time in a single session

Output

DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
ERROR: You must give at least one requirement to install (see "pip help install")

DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
ERROR: You must give at least one requirement to install (see "pip help install")

DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
ERROR: You must give at least one requirement to install (see "pip help install")

DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
ERROR: You must give at least one requirement to install (see "pip help install")

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions