Repository: pypa/pip

Issue:
Deprecation notice for distutils still being spammed for MacOS users
### Description

The issue from https://github.com/pypa/pip/issues/10712 persists, as the last comments on the Issue mentioned prior to it being locked. This was not resolved by newer Python versions.

Currently, I'm seeing it appear very frequently with Python 3.9.13 but it affects a number of my machines and Python installations. It's often repeated at least 4 times per package being installed.



### Expected behavior

Print the message at most once. Have some way to silence it.

### pip version

21.1.1, 22.1.2

### Python version

3.9.13

### OS

MacOS 11.6.7 and 12.1

### How to Reproduce

Install any package with pip

### Output

```shell
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
```
```


### Code of Conduct

- [X] I agree to follow the [PSF Code of Conduct](https://www.python.org/psf/conduct/).


Discussion:
As per the warning, the current status can be found at https://github.com/Homebrew/homebrew-core/issues/76621. From what I can tell reading that issue, the problem hasn't been fixed at the Homebrew end yet.
Yes, true. But the message is repeated so frequently and it affects so many users (personal and professional, both in my case) that not being able to suppress it using `pip`'s options is kind of a bug or at the very least really good cause for a feature request, I suppose?

To quote the other OP (in an Issue where it was believed that this was resolved):

_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._

Incidentally, I just confirmed this is still the situation in pip 22.1.2
Maybe we could simply switch to use DeprecationWarning to make supressing work?
@uranusjr That would work for me, good idea

Resolving patch:
diff --git a/src/pip/_internal/utils/deprecation.py b/src/pip/_internal/utils/deprecation.py
--- a/src/pip/_internal/utils/deprecation.py
+++ b/src/pip/_internal/utils/deprecation.py
@@ -13,7 +13,7 @@
 DEPRECATION_MSG_PREFIX = "DEPRECATION: "
 
 
-class PipDeprecationWarning(Warning):
+class PipDeprecationWarning(DeprecationWarning):
     pass
 
 


Test patch: