From a6cdaa0b109da1a62058ebad2e847a40665c9003 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Mon, 15 May 2023 15:20:17 +0900 Subject: [PATCH] work around cibuildwheel not outputting pip-freeze --- .github/workflows/build-wheels.yml | 4 ++++ .github/workflows/pipfreezedammit.py | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index e23dcdf0a4..1d59f887b0 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -35,6 +35,8 @@ jobs: with: platforms: all + - run: mkdir pip-freeze + - name: Build wheels uses: pypa/cibuildwheel@v2.12.0 env: @@ -55,6 +57,8 @@ jobs: name: wheels-${{ matrix.os }} path: wheelhouse/*.whl + - run: tail -n +1 pip-freeze/* + test: name: Test wheel for ${{ matrix.os }} Python ${{ matrix.python }} needs: build_wheels diff --git a/.github/workflows/pipfreezedammit.py b/.github/workflows/pipfreezedammit.py index 3950094051..55d16e456f 100644 --- a/.github/workflows/pipfreezedammit.py +++ b/.github/workflows/pipfreezedammit.py @@ -2,6 +2,12 @@ Implemented as a Python script because we need it to work on Windows, etc. """ +import os import subprocess import sys -subprocess.call([sys.executable, '-m', 'pip', 'freeze'], stdout=sys.stderr) + +pythonversion = f'{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}' + +os.makedirs('pip-freeze', exist_ok=True) +with open(f'pip-freeze/{pythonversion}.txt', 'wt') as fout: + subprocess.call([sys.executable, '-m', 'pip', 'freeze'], stdout=fout)