( pypyBinaryPath: string, pythonVersion: string )
| 139 | } |
| 140 | |
| 141 | async function createPyPySymlink( |
| 142 | pypyBinaryPath: string, |
| 143 | pythonVersion: string |
| 144 | ) { |
| 145 | const version = semver.coerce(pythonVersion)!; |
| 146 | const pythonBinaryPostfix = semver.major(version); |
| 147 | const pythonMinor = semver.minor(version); |
| 148 | const pypyBinaryPostfix = pythonBinaryPostfix === 2 ? '' : '3'; |
| 149 | const pypyMajorMinorBinaryPostfix = `${pythonBinaryPostfix}.${pythonMinor}`; |
| 150 | const binaryExtension = IS_WINDOWS ? '.exe' : ''; |
| 151 | |
| 152 | core.info('Creating symlinks...'); |
| 153 | createSymlinkInFolder( |
| 154 | pypyBinaryPath, |
| 155 | `pypy${pypyBinaryPostfix}${binaryExtension}`, |
| 156 | `python${pythonBinaryPostfix}${binaryExtension}`, |
| 157 | true |
| 158 | ); |
| 159 | |
| 160 | createSymlinkInFolder( |
| 161 | pypyBinaryPath, |
| 162 | `pypy${pypyBinaryPostfix}${binaryExtension}`, |
| 163 | `python${binaryExtension}`, |
| 164 | true |
| 165 | ); |
| 166 | |
| 167 | createSymlinkInFolder( |
| 168 | pypyBinaryPath, |
| 169 | `pypy${pypyBinaryPostfix}${binaryExtension}`, |
| 170 | `pypy${pypyMajorMinorBinaryPostfix}${binaryExtension}`, |
| 171 | true |
| 172 | ); |
| 173 | } |
| 174 | |
| 175 | async function installPip(pythonLocation: string) { |
| 176 | core.info('Installing and updating pip'); |
no test coverage detected