File tree Expand file tree Collapse file tree 5 files changed +35
-2
lines changed Expand file tree Collapse file tree 5 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,11 @@ jobs:
105105 - name : Fully cleanup the toolcache directory before testing
106106 run : ./helpers/clean-toolcache.ps1 -ToolName "Python"
107107
108+ - name : Delete macOS /Library/Frameworks/Python.framework
109+ if : matrix.platform == 'darwin'
110+ shell : bash
111+ run : if [ -d /Library/Frameworks/Python.framework ]; then sudo rm -rf /Library/Frameworks/Python.framework; fi
112+
108113 - name : Download artifact
109114 uses : actions/download-artifact@v3
110115 with :
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ chmod +x ../python $PYTHON_MAJOR $PYTHON_MAJOR_DOT_MINOR $PYTHON_MAJOR_MINOR pyt
7171echo " Upgrading pip..."
7272export PIP_ROOT_USER_ACTION=ignore
7373./python -m ensurepip
74- ./python -m pip install --ignore-installed pip --disable-pip-version-check --no-warn-script-location
74+ ./python -m pip install --upgrade pip --disable-pip-version-check --no-warn-script-location
7575
7676echo " Install OpenSSL certificates"
7777sh -e " ${PYTHON_APPLICATION_PATH} /Install Certificates.command"
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ chmod +x ../python $PYTHON_MAJOR $PYTHON_MAJOR_DOT_MINOR $PYTHON_MAJORMINOR pyth
5151echo " Upgrading pip..."
5252export PIP_ROOT_USER_ACTION=ignore
5353./python -m ensurepip
54- ./python -m pip install --ignore-installed pip --disable-pip-version-check --no-warn-script-location
54+ ./python -m pip install --upgrade pip --disable-pip-version-check --no-warn-script-location
5555
5656echo " Create complete file"
5757touch $PYTHON_TOOLCACHE_VERSION_PATH /x64.complete
Original file line number Diff line number Diff line change @@ -103,4 +103,8 @@ Describe "Tests" {
103103 It " Check urlopen with HTTPS works" {
104104 " python ./sources/python-urlopen-https.py" | Should - ReturnZeroExitCode
105105 }
106+
107+ It " Check a single dist-info per distribution is present" {
108+ " python ./sources/dist-info.py" | Should - ReturnZeroExitCode
109+ }
106110}
Original file line number Diff line number Diff line change 1+ import glob
2+ import os .path
3+ import sysconfig
4+ from collections import defaultdict
5+
6+
7+ def check_dist_info ():
8+ paths = set ([sysconfig .get_path ("purelib" ), sysconfig .get_path ("platlib" )])
9+ versions = defaultdict (list )
10+ for path in paths :
11+ pattern = os .path .join (path , "*.dist-info" )
12+ for dist_info in glob .glob (pattern ):
13+ name = os .path .basename (dist_info ).split ("-" , maxsplit = 1 )[0 ]
14+ versions [name ].append (dist_info )
15+ exit_code = 0
16+ for name in versions :
17+ if len (versions [name ]) > 1 :
18+ print ("multiple dist-info found for {}: {}" .format (name , versions [name ]))
19+ exit_code = 1
20+ exit (exit_code )
21+
22+
23+ if __name__ == "__main__" :
24+ check_dist_info ()
You can’t perform that action at this time.
0 commit comments