Skip to content

Commit

Permalink
More fixes to the release workflow (#868)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mmghannam authored Jun 22, 2024
1 parent c50ce12 commit 147f067
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
Expand All @@ -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
Expand All @@ -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"
Expand Down
19 changes: 9 additions & 10 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 147f067

Please sign in to comment.