From 49bf7309d4a5b37281e007c8dba94908fbc93025 Mon Sep 17 00:00:00 2001 From: DeeDeeG Date: Wed, 3 Jul 2024 17:02:14 -0400 Subject: [PATCH] Fix venv usage on Windows --- .github/workflows/ci.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65429fd1..cb1ec2fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,20 +56,38 @@ jobs: with: python-version: '3.10' - - name: Install Python setuptools + - name: Install Python setuptools (Unix-likes) # This is needed for Python 3.12+, since many versions of node-gyp # are incompatible with Python 3.12+, which no-longer ships 'distutils' # out of the box. 'setuptools' package provides 'distutils'. + if: ${{ runner.os != 'Windows' }} run: | python3 -m venv CI_venv source CI_venv/bin/activate python3 -m pip install setuptools - - name: Install dependencies + - name: Install Python setuptools (Windows) + # This is needed for Python 3.12+, since many versions of node-gyp + # are incompatible with Python 3.12+, which no-longer ships 'distutils' + # out of the box. 'setuptools' package provides 'distutils'. + if: ${{ runner.os == 'Windows' }} + run: | + python3 -m venv CI_venv + CI_venv\Scripts\activate.bat + python3 -m pip install setuptools + + - name: Install dependencies (Unix-likes) + if: ${{ runner.os != 'Windows' }} run: | source CI_venv/bin/activate npm install + - name: Install dependencies (Windows) + if: ${{ runner.os == 'Windows' }} + run: | + CI_venv\Scripts\activate.bat + npm install + - name: Lint run: npm run standard