fix python bin path

This commit is contained in:
Frost Ming 2021-09-22 11:55:51 +08:00
parent 0f9676c367
commit d0426e0e08
No known key found for this signature in database
GPG Key ID: 5BFA9CB4DDA943BF
2 changed files with 5 additions and 5 deletions

2
dist/setup-pdm.js vendored
View File

@ -6521,13 +6521,13 @@ async function run() {
try { try {
let installedPython = await findPythonVersion(INSTALL_VERSION, arch2); let installedPython = await findPythonVersion(INSTALL_VERSION, arch2);
await exec3.exec("python", cmdArgs); await exec3.exec("python", cmdArgs);
const pythonBin = import_path.default.join(process.env.pythonLocation, IS_WINDOWS ? "Scripts/python.exe" : "bin/python");
if (core3.getInput("enable-pep582") === "true") { if (core3.getInput("enable-pep582") === "true") {
core3.exportVariable("PYTHONPATH", getPep582Path()); core3.exportVariable("PYTHONPATH", getPep582Path());
} }
if (core3.getInput("python-version") !== INSTALL_VERSION) { if (core3.getInput("python-version") !== INSTALL_VERSION) {
installedPython = await findPythonVersion(core3.getInput("python-version"), arch2); installedPython = await findPythonVersion(core3.getInput("python-version"), arch2);
} }
const pythonBin = import_path.default.join(process.env.pythonLocation, IS_WINDOWS ? "Scripts/python.exe" : "bin/python");
await exec3.exec("pdm", ["use", "-f", pythonBin]); await exec3.exec("pdm", ["use", "-f", pythonBin]);
const pdmVersionOutput = (await (0, import_child_process.exec)("pdm --version")).stdout; const pdmVersionOutput = (await (0, import_child_process.exec)("pdm --version")).stdout;
if (process.platform === "linux") { if (process.platform === "linux") {

View File

@ -28,16 +28,16 @@ async function run(): Promise<void> {
try { try {
let installedPython = await setupPython.findPythonVersion(INSTALL_VERSION, arch) let installedPython = await setupPython.findPythonVersion(INSTALL_VERSION, arch)
await exec.exec("python", cmdArgs) await exec.exec("python", cmdArgs)
const pythonBin = path.join(
process.env.pythonLocation as string,
IS_WINDOWS ? "Scripts/python.exe" : "bin/python"
)
if (core.getInput("enable-pep582") === "true") { if (core.getInput("enable-pep582") === "true") {
core.exportVariable("PYTHONPATH", getPep582Path()) core.exportVariable("PYTHONPATH", getPep582Path())
} }
if (core.getInput("python-version") !== INSTALL_VERSION) { if (core.getInput("python-version") !== INSTALL_VERSION) {
installedPython = await setupPython.findPythonVersion(core.getInput("python-version"), arch) installedPython = await setupPython.findPythonVersion(core.getInput("python-version"), arch)
} }
const pythonBin = path.join(
process.env.pythonLocation as string,
IS_WINDOWS ? "Scripts/python.exe" : "bin/python"
)
await exec.exec("pdm", ["use", "-f", pythonBin]) await exec.exec("pdm", ["use", "-f", pythonBin])
const pdmVersionOutput = (await execChild("pdm --version")).stdout const pdmVersionOutput = (await execChild("pdm --version")).stdout
if (process.platform === "linux") { if (process.platform === "linux") {