Skip to content

Commit

Permalink
Fix release workflow & control uploading to pypi with a parameter (#867)
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
  • Loading branch information
mmghannam committed Jun 21, 2024
1 parent 50139ec commit c50ce12
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Build wheels

on:
workflow_dispatch:
Expand All @@ -7,7 +7,12 @@ on:
type: string
description: SCIPOptSuite deployment version
required: true
default: "0.4.0"
default: "v0.4.0"
upload_to_pypi:
type: boolean
description: Whether the artifacts should be uploaded to PyPI
required: false
default: false

jobs:
build_wheels:
Expand Down Expand Up @@ -59,6 +64,7 @@ jobs:
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event.inputs.upload_to_pypi == 'true'
steps:
- uses: actions/download-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/${SCIPOPTSUITE_VERSION}/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/${SCIPOPTSUITE_VERSION}/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/${SCIPOPTSUITE_VERSION}/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/${SCIPOPTSUITE_VERSION}/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
4 changes: 4 additions & 0 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ def test_setLogFile_none():
os.remove(log_file_name)

def test_locale():
on_release = os.getenv('SCIPOPTSUITE_VERSION') is not None
if on_release:
pytest.skip("Skip this test on release builds")

import locale

m = Model()
Expand Down

0 comments on commit c50ce12

Please sign in to comment.