fix: use --upgrade rather than --ignore-installed to upgrade pip (#268)

* fix: use `--upgrade` rather than `--ignore-installed` to upgrade pip

This removes left over files when upgrading pip.

* remove all installed python on macOS
This commit is contained in:
Matthieu Darbois
2024-05-08 15:32:38 +02:00
committed by GitHub
parent c03f98f186
commit 7c3d29faf2
5 changed files with 35 additions and 2 deletions

View File

@ -0,0 +1,24 @@
import glob
import os.path
import sysconfig
from collections import defaultdict
def check_dist_info():
paths = set([sysconfig.get_path("purelib"), sysconfig.get_path("platlib")])
versions = defaultdict(list)
for path in paths:
pattern = os.path.join(path, "*.dist-info")
for dist_info in glob.glob(pattern):
name = os.path.basename(dist_info).split("-", maxsplit=1)[0]
versions[name].append(dist_info)
exit_code = 0
for name in versions:
if len(versions[name]) > 1:
print("multiple dist-info found for {}: {}".format(name, versions[name]))
exit_code = 1
exit(exit_code)
if __name__ == "__main__":
check_dist_info()