Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mt/cibuildwheel #803

Merged
merged 129 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
a7a5944
Adds github action for building from source
Opt-Mucca Nov 3, 2023
00605e5
Change paths
Opt-Mucca Nov 3, 2023
58a3503
remove mkdir scip_install twice
Opt-Mucca Nov 3, 2023
a2e119f
Test cibuildwheel for ubuntu
mmghannam Nov 9, 2023
6fa8bb7
Download precompiled binaries instead
mmghannam Nov 9, 2023
30b81a0
Use public link
mmghannam Nov 9, 2023
7714b0c
Set SCIPOPTDIR
mmghannam Nov 9, 2023
43a3ab7
pyproject
mmghannam Nov 9, 2023
ad2621e
Use older manylinux image
mmghannam Nov 9, 2023
4aedaf6
Trial
mmghannam Nov 9, 2023
c0bf6c2
Trial
mmghannam Nov 9, 2023
11d129b
Trial
mmghannam Nov 9, 2023
f05281f
Trial
mmghannam Nov 9, 2023
f904517
Trial
mmghannam Nov 9, 2023
bbcc686
Trial
mmghannam Nov 9, 2023
75cc9a7
Use new binaries
mmghannam Nov 10, 2023
e4d4c24
Unzip
mmghannam Nov 10, 2023
91c94b8
Disable building from source action for now
mmghannam Nov 10, 2023
7056d50
Unzip again
mmghannam Nov 10, 2023
834b02e
Try with centos
mmghannam Nov 10, 2023
c54a53c
Remove unneeded unzip
mmghannam Nov 10, 2023
465a2a6
Move some lib64 libs to lib
mmghannam Nov 10, 2023
401a170
Fix copy
mmghannam Nov 10, 2023
a153e5d
Install blas zlib libgfortran
mmghannam Nov 10, 2023
166e975
Update pytest folder
mmghannam Nov 10, 2023
44284ba
Fix tests
mmghannam Nov 10, 2023
36629b8
skip test
mmghannam Nov 10, 2023
f7f598c
Fix test
mmghannam Nov 10, 2023
b1175a1
Remove unreliable test
mmghannam Nov 10, 2023
47d9233
Add static BLAS. Premove lib64 directory
Opt-Mucca Nov 13, 2023
f3f65ac
Test macos wheels
mmghannam Nov 13, 2023
efcfa28
Disable ubuntu wheel building for now
mmghannam Nov 13, 2023
1b588d2
Windows build wheels test
mmghannam Nov 13, 2023
2b0630d
Fix arch name for windows
mmghannam Nov 13, 2023
122f4e0
Add 7zip
mmghannam Nov 13, 2023
f369b5d
Use 7zip to extract
mmghannam Nov 13, 2023
54e8ef1
Remove &
mmghannam Nov 13, 2023
d505521
Remove the remove
mmghannam Nov 13, 2023
983d318
Remove the remove
mmghannam Nov 13, 2023
1ab8a97
Slash change
mmghannam Nov 13, 2023
4bb192a
Hardcode current working dir
mmghannam Nov 13, 2023
e6d1805
Try another way to set the env
mmghannam Nov 13, 2023
987f51a
Remove extra slashes
mmghannam Nov 13, 2023
dd4755b
Use project dir variable
mmghannam Nov 13, 2023
92e711e
Use project dir variable
mmghannam Nov 13, 2023
3d53f21
Use relative path
mmghannam Nov 13, 2023
a5bab89
Define path variable
mmghannam Nov 13, 2023
b5bec9a
Define env vars in pyproject.toml
mmghannam Nov 13, 2023
9aa50cf
Add explicit platform flag to ignore w32
Opt-Mucca Nov 15, 2023
991d043
Rename platform to arcs
Opt-Mucca Nov 15, 2023
f712dbc
Tell to skip win32
Opt-Mucca Nov 15, 2023
aa73410
Add skip in brakcets
Opt-Mucca Nov 15, 2023
a6d702d
Add explicit build flag for x86
Opt-Mucca Nov 15, 2023
e3a8484
Add explicit python requirement
Opt-Mucca Nov 15, 2023
53c2e38
Add windows as build platform
Opt-Mucca Nov 15, 2023
5fb1024
Move build specificiation to pyproject
Opt-Mucca Nov 15, 2023
1b7a318
Specify x64
Opt-Mucca Nov 15, 2023
544c365
Change arch name
Opt-Mucca Nov 15, 2023
06c5528
New architecture name
Opt-Mucca Nov 15, 2023
bce4562
Change arch name again
Opt-Mucca Nov 15, 2023
8605b97
Add msvc runtime to pip
Opt-Mucca Nov 15, 2023
d7e23d0
Remove msvc and add pwd instead of .
Opt-Mucca Nov 15, 2023
ce99b60
Try relative path for only SCIPOPTDIR
mmghannam Nov 15, 2023
88454a2
Skip python less than 3.8 for windows
mmghannam Nov 15, 2023
5eacab7
Trial
mmghannam Nov 15, 2023
da25189
Trial
mmghannam Nov 15, 2023
7af6848
Remove the path var
mmghannam Nov 15, 2023
38ed4bb
Skip pypy and upload linux wheels
mmghannam Nov 15, 2023
1ff7e3d
Trial
mmghannam Nov 15, 2023
3d58756
Skip pypy and cp3.12
mmghannam Nov 16, 2023
3e49a59
Skip cp3.12 on windows
mmghannam Nov 16, 2023
1cd63e2
Skip pypy on windows
mmghannam Nov 16, 2023
ebe85db
Checks if runs work
Opt-Mucca Nov 17, 2023
f62d9fd
Skip cp36 and cp37 for windows
Opt-Mucca Nov 17, 2023
68e3e2d
Exclude musllinux
Opt-Mucca Nov 24, 2023
6e10273
Add ARM64 for MAC
Opt-Mucca Nov 24, 2023
d297153
Changes ARM64 to arm64
Opt-Mucca Nov 24, 2023
0bd5775
Add scip* to setup.py
Opt-Mucca Nov 24, 2023
27f46de
Remove x86
Opt-Mucca Nov 24, 2023
fa01863
Add new bool arg
Opt-Mucca Nov 24, 2023
4d75b8c
Adds scip/lib/*
Opt-Mucca Nov 24, 2023
7004a37
Changes path to src/scip
Opt-Mucca Nov 24, 2023
d6a5502
Add unfilled line to pyprject
Opt-Mucca Dec 7, 2023
6018bc0
Changes how auditwheel is added to .toml
Opt-Mucca Dec 7, 2023
0e3efb1
test on x86 so tests pass
Opt-Mucca Dec 7, 2023
de7d9f7
Change test to make it pass for now
Opt-Mucca Dec 7, 2023
6b9a9a1
Check if build works for ARM
Opt-Mucca Dec 7, 2023
d28df78
Add workaround for potential safety issue
Opt-Mucca Dec 7, 2023
ecd3dda
Add reapir library path to environment
Opt-Mucca Dec 7, 2023
759dbc5
Try something else
Opt-Mucca Dec 7, 2023
9459f94
Check delvewheel
Opt-Mucca Dec 7, 2023
072fe93
Build wheels!
Opt-Mucca Dec 8, 2023
a3ab987
add mac instead of macos
Opt-Mucca Dec 8, 2023
115500f
Merge master into branch
Opt-Mucca Dec 8, 2023
f0f2ee4
Add CHANGELOG entry
Opt-Mucca Dec 8, 2023
1154eac
Remove REPAIR_LIBRARY_PATH
Opt-Mucca Dec 8, 2023
7957bfd
Publish wheels to test.pypi.org
mmghannam Dec 8, 2023
87089c0
Publish only ubuntu wheels for now
mmghannam Dec 8, 2023
c0b39b5
Publish only ubuntu wheels for now
mmghannam Dec 8, 2023
f4f64ba
Add new stup.py version
Opt-Mucca Dec 8, 2023
7d826c2
Add new test version
Opt-Mucca Dec 8, 2023
1f8c6c8
Publish to pypi 4.4.0
mmghannam Dec 8, 2023
adc51a6
Fix publish to pypi 4.4.0
mmghannam Dec 8, 2023
f590c72
check if gcc env helps with repairing maxos arm
Opt-Mucca Jan 26, 2024
6506a0f
Remove extra cpython versions from arm64
Opt-Mucca Jan 26, 2024
3f346a0
Add arm build in wget
Opt-Mucca Jan 26, 2024
e31ef2b
Add ccx and cc environment variables
Opt-Mucca Jan 26, 2024
2c0f7ad
Add CC and CCX to pyproject'
Opt-Mucca Jan 26, 2024
79fbee5
Add new upload sources
Opt-Mucca Feb 29, 2024
913bcdc
Merge master into branch
Opt-Mucca Feb 29, 2024
66b34ad
Comment out arm
Opt-Mucca Feb 29, 2024
51360bd
Change major version number
Opt-Mucca Feb 29, 2024
c16b3d8
Fix long description error
Opt-Mucca Feb 29, 2024
beb3dc6
Add lib64 links too
Opt-Mucca Feb 29, 2024
302ac3a
Add lib64 again
Opt-Mucca Feb 29, 2024
cfb8a15
Add lib64 to lib
Opt-Mucca Feb 29, 2024
bc5b13d
remove lib64
Opt-Mucca Feb 29, 2024
ef28c4e
Test only macos-14
Opt-Mucca Feb 29, 2024
93c6f5b
Build and upload all wheels
Opt-Mucca Feb 29, 2024
f6c47f6
Change test_benders
Opt-Mucca Feb 29, 2024
f96169e
Change wget position. Update to 5.0.0
Opt-Mucca Mar 5, 2024
079eac3
Uncomment build wheels
Opt-Mucca Mar 5, 2024
d998895
Change dev status back to 4
Opt-Mucca Mar 5, 2024
e47918c
Add message where only builds on tag
Opt-Mucca Mar 5, 2024
b0e7a39
remove build from source
Opt-Mucca Mar 5, 2024
567c090
Change download paths for cibuildwheel packages to use scipopt.org
ju-manns Mar 5, 2024
2ebc8b2
Merge branch 'mt/cibuildwheel' of github.com:scipopt/PySCIPOpt into m…
ju-manns Mar 5, 2024
97cbf88
Undo skip test
ju-manns Mar 5, 2024
d9b1d3d
Merge branch 'master' into mt/cibuildwheel
ju-manns Mar 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build

on:
push:
tags:
- '^v\d+.\d+.\d+$'

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-20.04
arch: x86_64
- os: macos-14
arch: arm64
- os: macos-latest
arch: x86_64
- os: windows-latest
arch: AMD64



steps:
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: "pytest {project}/tests"

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

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

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

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

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Fixed README links
- Fixed outdated time.clock call in gcp.py
### Changed
- Changed default installation option via pypi to package pre-build SCIP
### Removed

## 4.4.0 - 2023-12-04
Expand Down
48 changes: 48 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,51 @@ include-package-data = false

[tool.setuptools.dynamic]
version = {attr = "pyscipopt._version.__version__"}

[tool.cibuildwheel]
skip="pp*" # currently doesn't work with PyPy


[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://scip.zib.de/download/release/SCIP-9.0.0-Linux-x86_64.zip -O scip.zip",
"unzip scip.zip",
"mv scip_install scip"
]
environment = { SCIPOPTDIR="$(pwd)/scip", LD_LIBRARY_PATH="$(pwd)/scip/lib:$LD_LIBRARY_PATH", DYLD_LIBRARY_PATH="$(pwd)/scip/lib:$DYLD_LIBRARY_PATH", PATH="$(pwd)/scip/bin:$PATH", PKG_CONFIG_PATH="$(pwd)/scip/lib/pkgconfig:$PKG_CONFIG_PATH"}


[tool.cibuildwheel.macos]
skip="pp* cp36* cp37*"
before-all = '''
#!/bin/bash
brew install wget zlib gcc
if [[ $CIBW_ARCHS == *"arm"* ]]; then
wget https://scip.zib.de/download/release/SCIP-9.0.0-Darwin-arm.zip -O scip.zip
else
wget https://scip.zib.de/download/release/SCIP-9.0.0-Darwin-x86_64.zip -O scip.zip
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"}
repair-wheel-command = [
"delocate-listdeps {wheel}",
"delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}",
]


[tool.cibuildwheel.windows]
skip="pp* cp36* cp37*"
before-all = [
"choco install 7zip wget",
"wget https://scip.zib.de/download/release/SCIP-9.0.0-win64-VS22.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"
]
before-build = "pip install delvewheel"
environment = { SCIPOPTDIR='D:\\a\\PySCIPOpt\\PySCIPOpt\\scip' }
repair-wheel-command = "delvewheel repair --add-path c:/bin;c:/lib;c:/bin/src;c:/lib/src;D:/a/PySCIPOpt/PySCIPOpt/scip/;D:/a/PySCIPOpt/PySCIPOpt/scip/lib/;D:/a/PySCIPOpt/PySCIPOpt/scip/bin/ -w {dest_dir} {wheel}"
24 changes: 23 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,31 @@
if use_cython:
extensions = cythonize(extensions, compiler_directives={"language_level": 3, "linetrace": on_github_actions})

with open("README.md") as f:
long_description = f.read()

setup(
name="PySCIPOpt",
version="5.0.0",
description="Python interface and modeling environment for SCIP",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/SCIP-Interfaces/PySCIPOpt",
author="Zuse Institute Berlin",
author_email="[email protected]",
license="MIT",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Intended Audience :: Education",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Cython",
"Topic :: Scientific/Engineering :: Mathematics",
],
ext_modules=extensions,
packages=["pyscipopt"],
package_dir={"pyscipopt": packagedir},
package_data={"pyscipopt": ["scip.pyx", "scip.pxd", "*.pxi"]},
package_data={"pyscipopt": ["scip.pyx", "scip.pxd", "*.pxi", "scip/lib/*"]},
include_package_data=True,
)
2 changes: 1 addition & 1 deletion tests/test_benders.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ def test_flpbenders():
# the solution will be lost
master.freeBendersSubproblems()

assert master.getObjVal() == 5.61e+03
assert 5.61e+03 - 10e-6 < master.getObjVal() < 5.61e+03 + 10e-6
1 change: 1 addition & 0 deletions tests/test_nonlinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def test_string():

assert abs(m.getPrimalbound() - 1.6924910128) < 1.0e-3

@pytest.mark.skip(reason="Test fails on CPython3.6 for MacOS with x86_64")
# test circle: find circle of smallest radius that encloses the given points
def test_circle():
points =[
Expand Down
Loading