MCPcopy Index your code
hub / github.com/actions/setup-python / createPyPySymlink

Function createPyPySymlink

src/install-pypy.ts:141–173  ·  view source on GitHub ↗
(
  pypyBinaryPath: string,
  pythonVersion: string
)

Source from the content-addressed store, hash-verified

139}
140
141async 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
175async function installPip(pythonLocation: string) {
176 core.info('Installing and updating pip');

Callers 1

installPyPyFunction · 0.85

Calls 1

createSymlinkInFolderFunction · 0.90

Tested by

no test coverage detected