Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e348410
Remove Ubuntu 20.04 from workflows due to deprecation from 2025-04-15…
v-aparnajyothi-y Apr 11, 2025
6ed2c67
Fix for Candidate Not Iterable Error (#1082)
v-aparnajyothi-y Apr 17, 2025
5d95bc1
Bump semver and @types/semver (#1091)
dependabot[bot] Apr 22, 2025
30eafe9
Bump prettier from 2.8.8 to 3.5.3 (#1046)
dependabot[bot] Apr 22, 2025
a26af69
Bump ts-jest from 29.1.2 to 29.3.2 (#1081)
dependabot[bot] Apr 24, 2025
5db1cf9
Enhance reading from .python-version (#787)
krystof-k May 21, 2025
5fa0ee6
Bump @actions/tool-cache from 2.0.1 to 2.0.2 (#1095)
dependabot[bot] Jun 18, 2025
e9c40fb
Add support for `pip-version` (#1129)
v-priyagupta108 Jun 20, 2025
1264885
Enhance cache-dependency-path handling to support files outside the w…
v-aparnajyothi-y Jun 25, 2025
532b046
Add Architecture-Specific PATH Management for Python with --user Flag…
v-aparnajyothi-y Jul 3, 2025
88ffd4d
Include python version in PyPy python-version output (#1110)
cdce8p Jul 21, 2025
3c6f142
update documentation (#1156)
v-priya-kinthali Jul 23, 2025
36da51d
Add version parsing from Pipfile (#1067)
aradkdj Jul 24, 2025
03bb615
Bump idna from 2.9 to 3.7 in /__tests__/data (#843)
dependabot[bot] Jul 29, 2025
fbeb884
Bump form-data to fix critical vulnerabilities #182 & #183 (#1163)
v-aparnajyothi-y Jul 30, 2025
9322b3c
Upgrade setuptools to 78.1.1 to fix path traversal vulnerability in P…
v-aparnajyothi-y Aug 4, 2025
f62a0e2
Change missing cache directory error to warning (#1182)
v-aparnajyothi-y Aug 26, 2025
5b668cf
Bump actions/checkout from 4 to 5 (#1181)
dependabot[bot] Aug 26, 2025
65b0712
Clarify pythonLocation behavior for PyPy and GraalPy in environment v…
v-aparnajyothi-y Aug 26, 2025
3d1e2d2
Revert "Enhance cache-dependency-path handling to support files outsi…
v-aparnajyothi-y Aug 28, 2025
e797f83
Upgrade to node 24 (#1164)
salmanmkc Sep 4, 2025
4267e28
Bump urllib3 from 1.26.19 to 2.5.0 in /__tests__/data and document br…
dependabot[bot] Sep 18, 2025
2e3e4b1
Add support for pip-install input (#1201)
v-gowridurgad Sep 26, 2025
18566f8
Improve wording and "fix example" (remove 3.13) on testing against pr…
yarikoptic Oct 14, 2025
bba65e5
Bump typescript from 5.4.2 to 5.9.3 and update docs/advanced-usage.md…
dependabot[bot] Oct 20, 2025
cfd55ca
graalpy: add graalpy early-access and windows builds (#880)
timfel Oct 22, 2025
443da59
Bump actions/publish-action from 0.3.0 to 0.4.0 & Documentation updat…
dependabot[bot] Nov 12, 2025
97aeb3e
Bump requests from 2.32.2 to 2.32.4 in /__tests__/data (#1130)
dependabot[bot] Nov 13, 2025
bfc4944
Bump prettier from 3.5.3 to 3.6.2 (#1234)
dependabot[bot] Nov 18, 2025
83679a8
Bump @types/node from 24.1.0 to 24.9.1 and update macos-13 to macos-1…
dependabot[bot] Nov 24, 2025
4f41a90
Bump urllib3 from 2.5.0 to 2.6.0 in /__tests__/data (#1253)
dependabot[bot] Dec 30, 2025
bfe8cc5
Upgrade @actions dependencies to Node 24 compatible versions (#1259)
salmanmkc Jan 20, 2026
a309ff8
Bump urllib3 from 2.6.0 to 2.6.3 in /__tests__/data (#1264)
dependabot[bot] Jan 22, 2026
918d5f3
Merge tag 'v6.2.0' into sync/upstream-v6.2.0
guptaankit015 Mar 26, 2026
80339e6
chore: rebuild dist and lockfile after upstream sync
guptaankit015 Mar 26, 2026
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
graalpy: add graalpy early-access and windows builds (actions#880)
  • Loading branch information
timfel authored Oct 22, 2025
commit cfd55ca82492758d853442341ad4d8010466803a
2 changes: 1 addition & 1 deletion .github/workflows/test-graalpy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, macos-13]
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
steps:
- uses: actions/checkout@v5
- name: Setup GraalPy and check latest
Expand Down
3,020 changes: 1,470 additions & 1,550 deletions __tests__/data/graalpy.json

Large diffs are not rendered by default.

15 changes: 6 additions & 9 deletions __tests__/find-graalpy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as path from 'path';
import * as semver from 'semver';

import * as finder from '../src/find-graalpy';
import {IGraalPyManifestRelease, IS_WINDOWS} from '../src/utils';
import {IGraalPyManifestRelease} from '../src/utils';

import manifestData from './data/graalpy.json';

Expand All @@ -19,9 +19,6 @@ const architecture = 'x64';
const toolDir = path.join(__dirname, 'runner', 'tools');
const tempDir = path.join(__dirname, 'runner', 'temp');

/* GraalPy doesn't have a windows release yet */
const describeSkipOnWindows = IS_WINDOWS ? describe.skip : describe;

describe('parseGraalPyVersion', () => {
it.each([
['graalpy-23', '23'],
Expand Down Expand Up @@ -108,7 +105,7 @@ describe('findGraalPyToolCache', () => {
});
});

describeSkipOnWindows('findGraalPyVersion', () => {
describe('findGraalPyVersion', () => {
let getBooleanInputSpy: jest.SpyInstance;
let warningSpy: jest.SpyInstance;
let debugSpy: jest.SpyInstance;
Expand Down Expand Up @@ -358,21 +355,21 @@ describeSkipOnWindows('findGraalPyVersion', () => {
it('found and install successfully, pre-release fallback', async () => {
spyCacheDir = jest.spyOn(tc, 'cacheDir');
spyCacheDir.mockImplementation(() =>
path.join(toolDir, 'GraalPy', '23.1', architecture)
path.join(toolDir, 'GraalPy', '24.1', architecture)
);
spyChmodSync = jest.spyOn(fs, 'chmodSync');
spyChmodSync.mockImplementation(() => undefined);
await expect(
finder.findGraalPyVersion(
'graalpy23.1',
'graalpy24.1',
architecture,
false,
false,
false
)
).rejects.toThrow();
await expect(
finder.findGraalPyVersion('graalpy23.1', architecture, false, false, true)
).resolves.toEqual('23.1.0-a.1');
finder.findGraalPyVersion('graalpy24.1', architecture, false, false, true)
).resolves.toEqual('24.1.0-ea.9');
});
});
43 changes: 20 additions & 23 deletions __tests__/install-graalpy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,21 @@ const architecture = 'x64';
const toolDir = path.join(__dirname, 'runner', 'tools');
const tempDir = path.join(__dirname, 'runner', 'temp');

/* GraalPy doesn't have a windows release yet */
const describeSkipOnWindows = IS_WINDOWS ? describe.skip : describe;

describe('graalpyVersionToSemantic', () => {
it.each([
['23.0.0a1', '23.0.0a1'],
['23.0.0', '23.0.0'],
['23.0.x', '23.0.x'],
['23.x', '23.x']
['graalpy-24.1.0-ea.09', '24.1.0-ea.9'],
['graal-23.0.0', '23.0.0'],
['vm-23.0.x', '23.0.x'],
['graal-23.x', '23.x']
])('%s -> %s', (input, expected) => {
expect(installer.graalPyTagToVersion(input)).toEqual(expected);
});
});

describeSkipOnWindows('findRelease', () => {
describe('findRelease', () => {
const result = JSON.stringify(manifestData);
const releases = JSON.parse(result) as IGraalPyManifestRelease[];
const extension = 'tar.gz';
const extension = IS_WINDOWS ? 'zip' : 'tar.gz';
const arch = installer.toGraalPyArchitecture(architecture);
const platform = installer.toGraalPyPlatform(process.platform);
const extensionName = `${platform}-${arch}.${extension}`;
Expand All @@ -47,8 +44,8 @@ describeSkipOnWindows('findRelease', () => {
browser_download_url: `https://github.com/oracle/graalpython/releases/download/graal-23.0.0/graalpython-23.0.0-${extensionName}`
};
const filesRC1: IGraalPyManifestAsset = {
name: `graalpython-23.1.0a1-${extensionName}`,
browser_download_url: `https://github.com/oracle/graalpython/releases/download/graal-23.1.0a1/graalpython-23.1.0a1-${extensionName}`
name: `graalpy-24.1.0-ea.09-${extensionName}`,
browser_download_url: `https://github.com/graalvm/graal-languages-ea-builds/releases/download/graalpy-24.1.0-ea.09/graalpy-24.1.0-ea.09-${extensionName}`
};

let warningSpy: jest.SpyInstance;
Expand Down Expand Up @@ -84,15 +81,15 @@ describeSkipOnWindows('findRelease', () => {
});

it('Preview version of GraalPy is found', () => {
const graalpyVersion = installer.graalPyTagToVersion('vm-23.1.0a1');
const graalpyVersion = installer.graalPyTagToVersion('vm-24.1.0-ea.09');
expect(
installer.findRelease(releases, graalpyVersion, architecture, false)
).toMatchObject({
foundAsset: {
name: `graalpython-23.1.0a1-${extensionName}`,
browser_download_url: `https://github.com/oracle/graalpython/releases/download/graal-23.1.0a1/graalpython-23.1.0a1-${extensionName}`
name: `graalpy-24.1.0-ea.09-${extensionName}`,
browser_download_url: `https://github.com/graalvm/graal-languages-ea-builds/releases/download/graalpy-24.1.0-ea.09/graalpy-24.1.0-ea.09-${extensionName}`
},
resolvedGraalPyVersion: '23.1.0-a.1'
resolvedGraalPyVersion: '24.1.0-ea.9'
});
});

Expand All @@ -107,20 +104,20 @@ describeSkipOnWindows('findRelease', () => {
});

it('GraalPy version matches semver (pre-release)', () => {
const graalpyVersion = '23.1.x';
const graalpyVersion = '24.1.x';
expect(
installer.findRelease(releases, graalpyVersion, architecture, false)
).toBeNull();
expect(
installer.findRelease(releases, graalpyVersion, architecture, true)
).toMatchObject({
foundAsset: filesRC1,
resolvedGraalPyVersion: '23.1.0-a.1'
resolvedGraalPyVersion: '24.1.0-ea.9'
});
});
});

describeSkipOnWindows('installGraalPy', () => {
describe('installGraalPy', () => {
let tcFind: jest.SpyInstance;
let warningSpy: jest.SpyInstance;
let debugSpy: jest.SpyInstance;
Expand Down Expand Up @@ -232,20 +229,20 @@ describeSkipOnWindows('installGraalPy', () => {
it('found and install GraalPy, pre-release fallback', async () => {
spyCacheDir = jest.spyOn(tc, 'cacheDir');
spyCacheDir.mockImplementation(() =>
path.join(toolDir, 'GraalPy', '23.1.0', architecture)
path.join(toolDir, 'GraalPy', '24.1.0', architecture)
);

spyChmodSync = jest.spyOn(fs, 'chmodSync');
spyChmodSync.mockImplementation(() => undefined);

await expect(
installer.installGraalPy('23.1.x', architecture, false, undefined)
installer.installGraalPy('24.1.x', architecture, false, undefined)
).rejects.toThrow();
await expect(
installer.installGraalPy('23.1.x', architecture, true, undefined)
installer.installGraalPy('24.1.x', architecture, true, undefined)
).resolves.toEqual({
installDir: path.join(toolDir, 'GraalPy', '23.1.0', architecture),
resolvedGraalPyVersion: '23.1.0-a.1'
installDir: path.join(toolDir, 'GraalPy', '24.1.0', architecture),
resolvedGraalPyVersion: '24.1.0-ea.9'
});

expect(spyHttpClient).toHaveBeenCalled();
Expand Down
36 changes: 29 additions & 7 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96769,8 +96769,8 @@ async function findGraalPyVersion(versionSpec, architecture, updateEnvironment,
const pipDir = utils_1.IS_WINDOWS ? 'Scripts' : 'bin';
const _binDir = path.join(installDir, pipDir);
const binaryExtension = utils_1.IS_WINDOWS ? '.exe' : '';
const pythonPath = path.join(utils_1.IS_WINDOWS ? installDir : _binDir, `python${binaryExtension}`);
const pythonLocation = (0, utils_1.getBinaryDirectory)(installDir);
const pythonPath = path.join(_binDir, `python${binaryExtension}`);
const pythonLocation = path.join(installDir, 'bin');
if (updateEnvironment) {
core.exportVariable('pythonLocation', installDir);
// https://cmake.org/cmake/help/latest/module/FindPython.html#module:FindPython
Expand Down Expand Up @@ -97315,7 +97315,12 @@ async function installGraalPy(graalpyVersion, architecture, allowPreReleases, re
try {
const graalpyPath = await tc.downloadTool(downloadUrl, undefined, AUTH);
core.info('Extracting downloaded archive...');
downloadDir = await tc.extractTar(graalpyPath);
if (utils_1.IS_WINDOWS) {
downloadDir = await tc.extractZip(graalpyPath);
}
else {
downloadDir = await tc.extractTar(graalpyPath);
}
// root folder in archive can have unpredictable name so just take the first folder
// downloadDir is unique folder under TEMP and can't contain any other folders
const archiveName = fs_1.default.readdirSync(downloadDir)[0];
Expand All @@ -97324,7 +97329,7 @@ async function installGraalPy(graalpyVersion, architecture, allowPreReleases, re
if (!(0, utils_1.isNightlyKeyword)(resolvedGraalPyVersion)) {
installDir = await tc.cacheDir(toolDir, 'GraalPy', resolvedGraalPyVersion, architecture);
}
const binaryPath = (0, utils_1.getBinaryDirectory)(installDir);
const binaryPath = path.join(installDir, 'bin');
await createGraalPySymlink(binaryPath, resolvedGraalPyVersion);
await installPip(binaryPath);
return { installDir, resolvedGraalPyVersion };
Expand Down Expand Up @@ -97352,6 +97357,9 @@ async function getAvailableGraalPyVersions() {
if (AUTH) {
headers.authorization = AUTH;
}
/*
Get releases first.
*/
let url = 'https://api.github.com/repos/oracle/graalpython/releases';
const result = [];
do {
Expand All @@ -97362,6 +97370,19 @@ async function getAvailableGraalPyVersions() {
result.push(...response.result);
url = (0, utils_1.getNextPageUrl)(response);
} while (url);
/*
Add pre-release builds.
*/
url =
'https://api.github.com/repos/graalvm/graal-languages-ea-builds/releases';
do {
const response = await http.getJson(url, headers);
if (!response.result) {
throw new Error(`Unable to retrieve the list of available GraalPy versions from '${url}'`);
}
result.push(...response.result);
url = (0, utils_1.getNextPageUrl)(response);
} while (url);
return result;
}
async function createGraalPySymlink(graalpyBinaryPath, graalpyVersion) {
Expand All @@ -97381,7 +97402,7 @@ async function installPip(pythonLocation) {
await exec.exec(`${pythonBinary} -m ensurepip --default-pip`);
}
function graalPyTagToVersion(tag) {
const versionPattern = /.*-(\d+\.\d+\.\d+(?:\.\d+)?)((?:a|b|rc))?(\d*)?/;
const versionPattern = /.*-(\d+\.\d+\.\d+(?:\.\d+)?)(?:-((?:ea|a|b|rc))\.0*(\d+))?/;
const match = tag.match(versionPattern);
if (match && match[2]) {
return `${match[1]}-${match[2]}.${match[3]}`;
Expand Down Expand Up @@ -97431,8 +97452,9 @@ function toGraalPyArchitecture(architecture) {
function findAsset(item, architecture, platform) {
const graalpyArch = toGraalPyArchitecture(architecture);
const graalpyPlatform = toGraalPyPlatform(platform);
const graalpyExt = platform == 'win32' ? 'zip' : 'tar.gz';
const found = item.assets.filter(file => file.name.startsWith('graalpy') &&
file.name.endsWith(`-${graalpyPlatform}-${graalpyArch}.tar.gz`));
file.name.endsWith(`-${graalpyPlatform}-${graalpyArch}.${graalpyExt}`));
/*
In the future there could be more variants of GraalPy for a single release. Pick the shortest name, that one is the most likely to be the primary variant.
*/
Expand Down Expand Up @@ -98363,7 +98385,7 @@ function getVersionInputFromFile(versionFile) {
}
}
/**
* Get the directory containing interpreter binary from installation directory of PyPy or GraalPy
* Get the directory containing interpreter binary from installation directory of PyPy
* - On Linux and macOS, the Python interpreter is in 'bin'.
* - On Windows, it is in the installation root.
*/
Expand Down
14 changes: 3 additions & 11 deletions src/find-graalpy.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import * as path from 'path';
import * as graalpyInstall from './install-graalpy';
import {
IS_WINDOWS,
validateVersion,
IGraalPyManifestRelease,
getBinaryDirectory
} from './utils';
import {IS_WINDOWS, validateVersion, IGraalPyManifestRelease} from './utils';

import * as semver from 'semver';
import * as core from '@actions/core';
Expand Down Expand Up @@ -62,11 +57,8 @@ export async function findGraalPyVersion(
const pipDir = IS_WINDOWS ? 'Scripts' : 'bin';
const _binDir = path.join(installDir, pipDir);
const binaryExtension = IS_WINDOWS ? '.exe' : '';
const pythonPath = path.join(
IS_WINDOWS ? installDir : _binDir,
`python${binaryExtension}`
);
const pythonLocation = getBinaryDirectory(installDir);
const pythonPath = path.join(_binDir, `python${binaryExtension}`);
const pythonLocation = path.join(installDir, 'bin');
if (updateEnvironment) {
core.exportVariable('pythonLocation', installDir);
// https://cmake.org/cmake/help/latest/module/FindPython.html#module:FindPython
Expand Down
35 changes: 30 additions & 5 deletions src/install-graalpy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
IGraalPyManifestRelease,
createSymlinkInFolder,
isNightlyKeyword,
getBinaryDirectory,
getNextPageUrl
} from './utils';

Expand Down Expand Up @@ -64,7 +63,11 @@ export async function installGraalPy(
const graalpyPath = await tc.downloadTool(downloadUrl, undefined, AUTH);

core.info('Extracting downloaded archive...');
downloadDir = await tc.extractTar(graalpyPath);
if (IS_WINDOWS) {
downloadDir = await tc.extractZip(graalpyPath);
} else {
downloadDir = await tc.extractTar(graalpyPath);
}

// root folder in archive can have unpredictable name so just take the first folder
// downloadDir is unique folder under TEMP and can't contain any other folders
Expand All @@ -81,7 +84,7 @@ export async function installGraalPy(
);
}

const binaryPath = getBinaryDirectory(installDir);
const binaryPath = path.join(installDir, 'bin');
await createGraalPySymlink(binaryPath, resolvedGraalPyVersion);
await installPip(binaryPath);

Expand Down Expand Up @@ -115,6 +118,9 @@ export async function getAvailableGraalPyVersions() {
headers.authorization = AUTH;
}

/*
Get releases first.
*/
let url: string | null =
'https://api.github.com/repos/oracle/graalpython/releases';
const result: IGraalPyManifestRelease[] = [];
Expand All @@ -130,6 +136,23 @@ export async function getAvailableGraalPyVersions() {
url = getNextPageUrl(response);
} while (url);

/*
Add pre-release builds.
*/
url =
'https://api.github.com/repos/graalvm/graal-languages-ea-builds/releases';
do {
const response: ifm.TypedResponse<IGraalPyManifestRelease[]> =
await http.getJson(url, headers);
if (!response.result) {
throw new Error(
`Unable to retrieve the list of available GraalPy versions from '${url}'`
);
}
result.push(...response.result);
url = getNextPageUrl(response);
} while (url);

return result;
}

Expand Down Expand Up @@ -175,7 +198,8 @@ async function installPip(pythonLocation: string) {
}

export function graalPyTagToVersion(tag: string) {
const versionPattern = /.*-(\d+\.\d+\.\d+(?:\.\d+)?)((?:a|b|rc))?(\d*)?/;
const versionPattern =
/.*-(\d+\.\d+\.\d+(?:\.\d+)?)(?:-((?:ea|a|b|rc))\.0*(\d+))?/;
const match = tag.match(versionPattern);
if (match && match[2]) {
return `${match[1]}-${match[2]}.${match[3]}`;
Expand Down Expand Up @@ -251,10 +275,11 @@ export function findAsset(
) {
const graalpyArch = toGraalPyArchitecture(architecture);
const graalpyPlatform = toGraalPyPlatform(platform);
const graalpyExt = platform == 'win32' ? 'zip' : 'tar.gz';
const found = item.assets.filter(
file =>
file.name.startsWith('graalpy') &&
file.name.endsWith(`-${graalpyPlatform}-${graalpyArch}.tar.gz`)
file.name.endsWith(`-${graalpyPlatform}-${graalpyArch}.${graalpyExt}`)
);
/*
In the future there could be more variants of GraalPy for a single release. Pick the shortest name, that one is the most likely to be the primary variant.
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ export function getVersionInputFromFile(versionFile: string): string[] {
}

/**
* Get the directory containing interpreter binary from installation directory of PyPy or GraalPy
* Get the directory containing interpreter binary from installation directory of PyPy
* - On Linux and macOS, the Python interpreter is in 'bin'.
* - On Windows, it is in the installation root.
*/
Expand Down