From 147f067160065cf4664751e773f213a747eb5731 Mon Sep 17 00:00:00 2001 From: Mohammed Ghannam Date: Sat, 22 Jun 2024 10:11:47 +0200 Subject: [PATCH] More fixes to the release workflow (#868) * Test workflow * Fix usage of env variable * Add missing v * Skip locale test in release * Reenable commented out wheels, add parameter to control uploading to pypi * Try out global env var * Try out without curly braces on linux * Check if windows works * Add env var definition back to build_wheels workflow * Fix sending env variables in release build * Reenable other OSs * Append existing env vars * Hardcode the scipoptsuite-deploy release version for now * Change runner to macos-13 * Make locale test less annoying --- .github/workflows/build_wheels.yml | 13 ++++++------- pyproject.toml | 8 ++++---- tests/test_model.py | 19 +++++++++---------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 52bcbcda8..8dc7dc1ba 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -3,11 +3,11 @@ name: Build wheels on: workflow_dispatch: inputs: - scip_version: - type: string - description: SCIPOptSuite deployment version - required: true - default: "v0.4.0" + # scip_version: + # type: string + # description: SCIPOptSuite deployment version + # required: true + # default: "v0.4.0" upload_to_pypi: type: boolean description: Whether the artifacts should be uploaded to PyPI @@ -25,7 +25,7 @@ jobs: arch: x86_64 - os: macos-14 arch: arm64 - - os: macos-latest + - os: macos-13 arch: x86_64 - os: windows-latest arch: AMD64 @@ -41,7 +41,6 @@ jobs: CIBW_ARCHS: ${{ matrix.arch }} CIBW_TEST_REQUIRES: pytest CIBW_TEST_COMMAND: "pytest {project}/tests" - SCIPOPTSUITE_VERSION: ${{ github.event.inputs.scip_version }} - uses: actions/upload-artifact@v3 with: diff --git a/pyproject.toml b/pyproject.toml index 1d8bce122..738c6f79c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ skip="pp*" # currently doesn't work with PyPy skip="pp* cp36* cp37* *musllinux*" before-all = [ "(apt-get update && apt-get install --yes wget) || yum install -y wget zlib libgfortran || brew install wget", - "wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/${SCIPOPTSUITE_VERSION}/libscip-linux.zip -O scip.zip", + "wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.4.0/libscip-linux.zip -O scip.zip", "unzip scip.zip", "mv scip_install scip" ] @@ -57,9 +57,9 @@ before-all = ''' #!/bin/bash brew install wget zlib gcc if [[ $CIBW_ARCHS == *"arm"* ]]; then - wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/${SCIPOPTSUITE_VERSION}/libscip-macos-arm.zip -O scip.zip + wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.4.0/libscip-macos-arm.zip -O scip.zip else - wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/${SCIPOPTSUITE_VERSION}/libscip-macos.zip -O scip.zip + wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.4.0/libscip-macos.zip -O scip.zip fi unzip scip.zip mv scip_install src/scip @@ -75,7 +75,7 @@ repair-wheel-command = [ skip="pp* cp36* cp37*" before-all = [ "choco install 7zip wget", - "wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/${SCIPOPTSUITE_VERSION}/libscip-windows.zip -O scip.zip", + "wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.4.0/libscip-windows.zip -O scip.zip", "\"C:\\Program Files\\7-Zip\\7z.exe\" x \"scip.zip\" -o\"scip-test\"", "mv .\\scip-test\\scip_install .\\test", "mv .\\test .\\scip" diff --git a/tests/test_model.py b/tests/test_model.py index c5eaeea12..d50437417 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -356,19 +356,18 @@ def test_locale(): try: locale.setlocale(locale.LC_NUMERIC, "pt_PT") - except Exception: - pytest.skip("pt_PT locale was not found. It might need to be installed.") - - assert locale.str(1.1) == "1,1" + assert locale.str(1.1) == "1,1" - m.writeProblem("model.cip") + m.writeProblem("model.cip") - with open("model.cip") as file: - assert "1,1" not in file.read() - - m.readProblem(os.path.join("tests", "data", "test_locale.cip")) + with open("model.cip") as file: + assert "1,1" not in file.read() + + m.readProblem(os.path.join("tests", "data", "test_locale.cip")) - locale.setlocale(locale.LC_NUMERIC,"") + locale.setlocale(locale.LC_NUMERIC,"") + except Exception: + pytest.skip("pt_PT locale was not found. It might need to be installed.") def test_version_external_codes():