From 3b0404728246416877370a9dd38246b50e577ad0 Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Wed, 22 Sep 2021 13:38:35 +0800 Subject: [PATCH] fix windows pythonpath --- .github/workflows/ci.yml | 3 ++- dist/setup-pdm.js | 2 +- src/setup-pdm.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2191c03..06dd0a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,10 +4,11 @@ name: Test Action jobs: Testing: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: python-version: [3.6, 3.7, 3.8, 3.9, "3.10.0-beta - 3.10.0"] + os: ["ubuntu-latest", "windows-latest"] name: Test the action steps: - uses: actions/checkout@v2 diff --git a/dist/setup-pdm.js b/dist/setup-pdm.js index 4318ced..87f81da 100644 --- a/dist/setup-pdm.js +++ b/dist/setup-pdm.js @@ -6527,7 +6527,7 @@ async function run() { if (core3.getInput("python-version") !== INSTALL_VERSION) { installedPython = await findPythonVersion(core3.getInput("python-version"), arch2); } - const pythonBin = import_path.default.join(process.env.pythonLocation, IS_WINDOWS ? "Scripts/python.exe" : "bin/python"); + const pythonBin = import_path.default.join(process.env.pythonLocation, IS_WINDOWS ? "python.exe" : "bin/python"); await exec3.exec("pdm", ["use", "-f", pythonBin]); const pdmVersionOutput = (await (0, import_child_process.exec)("pdm --version")).stdout; if (process.platform === "linux") { diff --git a/src/setup-pdm.ts b/src/setup-pdm.ts index e4b58b1..392715d 100644 --- a/src/setup-pdm.ts +++ b/src/setup-pdm.ts @@ -36,7 +36,7 @@ async function run(): Promise { } const pythonBin = path.join( process.env.pythonLocation as string, - IS_WINDOWS ? "Scripts/python.exe" : "bin/python" + IS_WINDOWS ? "python.exe" : "bin/python" ) await exec.exec("pdm", ["use", "-f", pythonBin]) const pdmVersionOutput = (await execChild("pdm --version")).stdout