Skip to content

Commit

Permalink
Merge branch 'master' into plot-pd-evolution
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao-Dionisio authored Nov 15, 2024
2 parents 15f7e1b + 1db095e commit ea9ab18
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 18 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,38 +41,49 @@ jobs:
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v2.21.1
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: "pytest {project}/tests"
CIBW_MANYLINUX_*_IMAGE: manylinux_2_28

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os}}-${{ matrix.arch }}
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build sdist
shell: bash -l {0}
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: source-distribution
path: dist/*.tar.gz

upload_pypi:
merge_artifacts:
name: Merge Artifacts
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4

upload_pypi:
needs: [build_wheels, build_sdist, merge_artifacts]
runs-on: ubuntu-latest
if: github.event.inputs.upload_to_pypi == 'true'
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
name: merged-artifacts
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
## Unreleased
### Added
- Added primal_dual_evolution recipe and a plot recipe
### Fixed
### Changed
### Removed

## 5.2.1 - 2024.10.29
### Added
- Expanded Statistics class to more problems.
- Created Statistics class
- Added parser to read .stats file
Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ git tag vX.X.X
git push origin vX.X.X
```
- [ ] Then make a github [release](https://github.com/scipopt/PySCIPOpt/releases/new) from this new tag.
- [ ] Update documentation by running the `Generate Docs` workflow in Actions->Generate Docs.
- [ ] Update the documentation: from readthedocs.io -> Builds -> Build version (latest and stable)
2 changes: 1 addition & 1 deletion docs/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To download SCIP please either use the pre-built SCIP Optimization Suite availab
* - SCIP
- PySCIPOpt
* - 9.1
- 5.1+
- 5.1, 5.2+
* - 9.0
- 5.0.x
* - 8.0
Expand Down
3 changes: 3 additions & 0 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ To install PySCIPOpt simply run the command:

TLDR: Older linux distributions may not work for newer versions of PySCIPOpt installed via pip.

.. note:: For Mac users: PySCIPOpt versions newer than 5.1.1 installed via PyPI now only support
MACOSX 13+ for users running x86_64 architecture, and MACOSX 14+ for users running newer Apple silicon.

.. note:: For versions older than 4.4.0 installed via PyPI SCIP is not automatically installed.
This means that SCIP must be installed yourself. If it is not installed globally,
then the ``SCIPOPTDIR`` environment flag must be set, see :doc:`this page </build>` for more details.
Expand Down
28 changes: 20 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ version = {attr = "pyscipopt._version.__version__"}

[tool.cibuildwheel]
skip="pp*" # currently doesn't work with PyPy
manylinux-x86_64-image = "manylinux_2_28"


[tool.cibuildwheel.linux]
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/v0.4.0/libscip-linux.zip -O scip.zip",
"wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.5.0/libscip-linux.zip -O scip.zip",
"unzip scip.zip",
"mv scip_install scip"
]
Expand All @@ -57,25 +58,36 @@ before-all = '''
#!/bin/bash
brew install wget zlib gcc
if [[ $CIBW_ARCHS == *"arm"* ]]; then
wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.4.0/libscip-macos-arm.zip -O scip.zip
wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.5.0/libscip-macos-arm.zip -O scip.zip
export MACOSX_DEPLOYMENT_TARGET=14.0
else
wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.4.0/libscip-macos.zip -O scip.zip
wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.5.0/libscip-macos.zip -O scip.zip
export MACOSX_DEPLOYMENT_TARGET=13.0
fi
unzip scip.zip
mv scip_install src/scip
'''
environment = {SCIPOPTDIR="$(pwd)/src/scip", LD_LIBRARY_PATH="$(pwd)/src/scip/lib:LD_LIBRARY_PATH", DYLD_LIBRARY_PATH="$(pwd)/src/scip/lib:$DYLD_LIBRARY_PATH", PATH="$(pwd)/src/scip/bin:$PATH", PKG_CONFIG_PATH="$(pwd)/src/scip/lib/pkgconfig:$PKG_CONFIG_PATH", RELEASE="true"}
repair-wheel-command = [
"delocate-listdeps {wheel}",
"delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}",
]
repair-wheel-command = '''
bash -c '
if [[ $CIBW_ARCHS == *"arm"* ]]; then
export MACOSX_DEPLOYMENT_TARGET=14.0
delocate-listdeps {wheel}
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}
else
export MACOSX_DEPLOYMENT_TARGET=13.0
delocate-listdeps {wheel}
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}
fi
'
'''


[tool.cibuildwheel.windows]
skip="pp* cp36* cp37*"
before-all = [
"choco install 7zip wget",
"wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.4.0/libscip-windows.zip -O scip.zip",
"wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.5.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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@

setup(
name="PySCIPOpt",
version="5.1.0",
version="5.2.1",
description="Python interface and modeling environment for SCIP",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
2 changes: 1 addition & 1 deletion src/pyscipopt/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '5.1.1'
__version__ = '5.2.1'
1 change: 1 addition & 0 deletions tests/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def test_sudoku_reader():

deleteFile("model.sod")

@pytest.mark.skip(reason="Test fails on Windows when using cibuildwheel. Cannot find tests/data")
def test_readStatistics():
m = Model(problemName="readStats")
x = m.addVar(vtype="I")
Expand Down

0 comments on commit ea9ab18

Please sign in to comment.