diff --git a/dist/index.js b/dist/index.js index 6d31fde..89e776f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -11497,8 +11497,16 @@ function getRustTarget(args) { return ((_c = TARGET_ALIASES[process.platform]) === null || _c === void 0 ? void 0 : _c[target]) || target; } function getManifestDir(args) { + const workspace = process.env.GITHUB_WORKSPACE; + let workdir = core.getInput('working-directory'); + if (workdir.length > 0) { + workdir = path.join(workspace, workdir); + } + else { + workdir = workspace; + } const manifestPath = getCliValue(args, '--manifest-path') || getCliValue(args, '-m'); - return manifestPath ? path.dirname(manifestPath) : process.cwd(); + return manifestPath ? path.dirname(path.join(workdir, manifestPath)) : workdir; } function parseRustToolchain(content) { const toml = (0, toml_1.parse)(content.toString()); @@ -11581,7 +11589,7 @@ async function findVersion(args) { const maturin = requires.find(req => req.startsWith('maturin')); if (maturin) { core.info(`Found maturin version requirement ${maturin} specified in pyproject.toml`); - const versionSpec = pythonVersionToSemantic(maturin.replace('maturin', '').replace(',', ' ')); + const versionSpec = pythonVersionToSemantic(maturin.replace('maturin', '').replace(',', ' ').replace('==', '=')); core.debug(`maturin version spec: ${versionSpec}`); const release = await findReleaseFromManifest(versionSpec, 'x64'); if (release) { @@ -11594,10 +11602,12 @@ async function findVersion(args) { } } else { + core.info('maturin not found in [build-system.requires] section at ${pyprojectToml}, fallback to latest'); version = 'latest'; } } else { + core.info('No pyproject.toml found at ${pyprojectToml}, fallback to latest'); version = 'latest'; } } diff --git a/src/index.ts b/src/index.ts index a1f68e1..2e3dac6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -176,9 +176,17 @@ function getRustTarget(args: string[]): string { } function getManifestDir(args: string[]): string { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const workspace = process.env.GITHUB_WORKSPACE! + let workdir = core.getInput('working-directory') + if (workdir.length > 0) { + workdir = path.join(workspace, workdir) + } else { + workdir = workspace + } const manifestPath = getCliValue(args, '--manifest-path') || getCliValue(args, '-m') - return manifestPath ? path.dirname(manifestPath) : process.cwd() + return manifestPath ? path.dirname(path.join(workdir, manifestPath)) : workdir } function parseRustToolchain(content: string): string { @@ -297,7 +305,7 @@ async function findVersion(args: string[]): Promise { `Found maturin version requirement ${maturin} specified in pyproject.toml` ) const versionSpec = pythonVersionToSemantic( - maturin.replace('maturin', '').replace(',', ' ') + maturin.replace('maturin', '').replace(',', ' ').replace('==', '=') ) core.debug(`maturin version spec: ${versionSpec}`) const release = await findReleaseFromManifest(versionSpec, 'x64') @@ -311,9 +319,15 @@ async function findVersion(args: string[]): Promise { version = 'latest' } } else { + core.info( + 'maturin not found in [build-system.requires] section at ${pyprojectToml}, fallback to latest' + ) version = 'latest' } } else { + core.info( + 'No pyproject.toml found at ${pyprojectToml}, fallback to latest' + ) version = 'latest' } } else if (version !== 'latest') {