File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed
Filter options
Expand file tree Collapse file tree 3 files changed +26
-0
lines changed
Original file line number Diff line number Diff line change 44
44
45
45
- name : Run simple code
46
46
run : python -c 'import math; print(math.factorial(5))'
47
+
48
+ - name : Assert PyPy is running
49
+ run : |
50
+ import platform
51
+ assert platform.python_implementation().lower() == "pypy"
52
+ shell : python
53
+
54
+ - name : Assert expected binaries (or symlinks) are present
55
+ run : |
56
+ EXECUTABLE=${{ matrix.pypy }}
57
+ EXECUTABLE=${EXECUTABLE/-/} # remove the first '-' in "pypy-X.Y" -> "pypyX.Y" to match executable name
58
+ EXECUTABLE=${EXECUTABLE%%-*} # remove any -* suffixe
59
+ ${EXECUTABLE} --version
60
+ shell : bash
Original file line number Diff line number Diff line change @@ -10283,11 +10283,14 @@ function createPyPySymlink(pypyBinaryPath, pythonVersion) {
10283
10283
return __awaiter(this, void 0, void 0, function* () {
10284
10284
const version = semver.coerce(pythonVersion);
10285
10285
const pythonBinaryPostfix = semver.major(version);
10286
+ const pythonMinor = semver.minor(version);
10286
10287
const pypyBinaryPostfix = pythonBinaryPostfix === 2 ? '' : '3';
10288
+ const pypyMajorMinorBinaryPostfix = `${pythonBinaryPostfix}.${pythonMinor}`;
10287
10289
let binaryExtension = utils_1.IS_WINDOWS ? '.exe' : '';
10288
10290
core.info('Creating symlinks...');
10289
10291
utils_1.createSymlinkInFolder(pypyBinaryPath, `pypy${pypyBinaryPostfix}${binaryExtension}`, `python${pythonBinaryPostfix}${binaryExtension}`, true);
10290
10292
utils_1.createSymlinkInFolder(pypyBinaryPath, `pypy${pypyBinaryPostfix}${binaryExtension}`, `python${binaryExtension}`, true);
10293
+ utils_1.createSymlinkInFolder(pypyBinaryPath, `pypy${pypyBinaryPostfix}${binaryExtension}`, `pypy${pypyMajorMinorBinaryPostfix}${binaryExtension}`, true);
10291
10294
});
10292
10295
}
10293
10296
function installPip(pythonLocation) {
Original file line number Diff line number Diff line change @@ -98,7 +98,9 @@ async function createPyPySymlink(
98
98
) {
99
99
const version = semver . coerce ( pythonVersion ) ! ;
100
100
const pythonBinaryPostfix = semver . major ( version ) ;
101
+ const pythonMinor = semver . minor ( version ) ;
101
102
const pypyBinaryPostfix = pythonBinaryPostfix === 2 ? '' : '3' ;
103
+ const pypyMajorMinorBinaryPostfix = `${ pythonBinaryPostfix } .${ pythonMinor } ` ;
102
104
let binaryExtension = IS_WINDOWS ? '.exe' : '' ;
103
105
104
106
core . info ( 'Creating symlinks...' ) ;
@@ -115,6 +117,13 @@ async function createPyPySymlink(
115
117
`python${ binaryExtension } ` ,
116
118
true
117
119
) ;
120
+
121
+ createSymlinkInFolder (
122
+ pypyBinaryPath ,
123
+ `pypy${ pypyBinaryPostfix } ${ binaryExtension } ` ,
124
+ `pypy${ pypyMajorMinorBinaryPostfix } ${ binaryExtension } ` ,
125
+ true
126
+ ) ;
118
127
}
119
128
120
129
async function installPip ( pythonLocation : string ) {
You can’t perform that action at this time.
0 commit comments