Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GraalPy support #694

Merged
merged 18 commits into from
Oct 10, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up and format
  • Loading branch information
msimacek committed Aug 29, 2023
commit 3d8a1eb795da3d2a24b3e5f969e2d2d06771e1d8
24 changes: 10 additions & 14 deletions src/install-graalpy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ async function createGraalPySymlink(
}

async function installPip(pythonLocation: string) {
core.info("Installing pip (GraalPy doesn't update pip because it uses a patched version of pip)");
core.info(
"Installing pip (GraalPy doesn't update pip because it uses a patched version of pip)"
);
const pythonBinary = path.join(pythonLocation, 'python');
await exec.exec(`${pythonBinary} -m ensurepip --default-pip`);

Check warning

Code scanning / CodeQL

Shell command built from environment values

This shell command depends on an uncontrolled [file name](1).
}
Expand Down Expand Up @@ -188,18 +190,12 @@ export function findRelease(
return null;
}

const sortedReleases = filterReleases.sort((previous, current) => {
return (
semver.compare(
semver.coerce(graalPyTagToVersion(current.tag_name))!,
semver.coerce(graalPyTagToVersion(previous.tag_name))!
) ||
semver.compare(
semver.coerce(graalPyTagToVersion(current.tag_name))!,
semver.coerce(graalPyTagToVersion(previous.tag_name))!
)
);
});
const sortedReleases = filterReleases.sort((previous, current) =>
semver.compare(
semver.coerce(graalPyTagToVersion(current.tag_name))!,
semver.coerce(graalPyTagToVersion(previous.tag_name))!
)
);

const foundRelease = sortedReleases[0];
const foundAsset = findAsset(foundRelease, architecture, process.platform);
Expand Down Expand Up @@ -227,7 +223,7 @@ export function findAsset(
: platform === 'darwin'
? 'macos'
: platform;
if (item.assets.length) {
if (item.assets.length) {
return item.assets.find((file: IGraalPyManifestAsset) => {
const match_data = file.name.match(
'.*(macos|linux|windows)-(amd64|aarch64).tar.gz$'
Expand Down