Skip to content

Commit

Permalink
Merge branch 'main' into benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedongPeng authored Nov 28, 2023
2 parents dbe9f49 + 7c18cdd commit 655692a
Show file tree
Hide file tree
Showing 36 changed files with 6,776 additions and 222 deletions.
2 changes: 1 addition & 1 deletion .coin-or/projDesc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ Carl D. Laird, Chair, Pyomo Management Committee, claird at andrew dot cmu dot e

<platform>
<operatingSystem>Any</operatingSystem>
<compiler>Python 3.8, 3.9, 3.10, 3.11</compiler>
<compiler>Python 3.8, 3.9, 3.10, 3.11, 3.12</compiler>
</platform>

</testedPlatforms>
Expand Down
163 changes: 57 additions & 106 deletions .github/workflows/release_wheel_creation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,52 +15,67 @@ concurrency:
cancel-in-progress: true

env:
PYOMO_SETUP_ARGS: --with-distributable-extensions
PYOMO_SETUP_ARGS: "--with-cython --with-distributable-extensions"

jobs:
manylinux:
name: ${{ matrix.TARGET }}/${{ matrix.wheel-version }}_wheel_creation
native_wheels:
name: Build wheels (${{ matrix.wheel-version }}) on ${{ matrix.os }} for native and cross-compiled architecture
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
wheel-version: ['cp38-cp38', 'cp39-cp39', 'cp310-cp310', 'cp311-cp311']
os: [ubuntu-latest]
include:
- os: ubuntu-latest
TARGET: manylinux
python-version: [3.8]
os: [ubuntu-22.04, windows-latest, macos-latest]
arch: [all]
wheel-version: ['cp38*', 'cp39*', 'cp310*', 'cp311*', 'cp312*']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine wheel setuptools pybind11
# TODO: Update the manylinux builder to next tagged release
- name: Build manylinux Python wheels
uses: RalfG/python-wheels-manylinux-build@a1e012c58ed3960f81b7ed2759a037fb0ad28e2d
with:
python-versions: ${{ matrix.wheel-version }}
build-requirements: 'cython pybind11'
package-path: ''
pip-wheel-args: ''
# When locally testing, --no-deps flag is necessary (PyUtilib dependency will trigger an error otherwise)
- name: Consolidate wheels
run: |
sudo test -d dist || mkdir -v dist
sudo find . -name \*.whl | grep -v /dist/ | xargs -n1 -i mv -v "{}" dist/
- name: Delete linux wheels
run: |
sudo rm -rfv dist/*-linux_x86_64.whl
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: manylinux-wheels
path: dist
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
with:
output-dir: dist
env:
CIBW_ARCHS_LINUX: "native"
CIBW_ARCHS_MACOS: "native arm64"
CIBW_ARCHS_WINDOWS: "native ARM64"
CIBW_SKIP: "*-musllinux*"
CIBW_BUILD: ${{ matrix.wheel-version }}
CIBW_BUILD_VERBOSITY: 1
CIBW_BEFORE_BUILD: pip install cython pybind11
CIBW_CONFIG_SETTINGS: '--global-option="--with-cython --with-distributable-extensions"'
- uses: actions/upload-artifact@v3
with:
name: native_wheels
path: dist/*.whl

alternative_wheels:
name: Build wheels (${{ matrix.wheel-version }}) on ${{ matrix.os }} for aarch64
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
arch: [all]
wheel-version: ['cp38*', 'cp39*', 'cp310*', 'cp311*', 'cp312*']
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Build wheels
uses: pypa/[email protected]
with:
output-dir: dist
env:
CIBW_ARCHS_LINUX: "aarch64"
CIBW_SKIP: "*-musllinux*"
CIBW_BUILD: ${{ matrix.wheel-version }}
CIBW_BUILD_VERBOSITY: 1
CIBW_BEFORE_BUILD: pip install cython pybind11
CIBW_CONFIG_SETTINGS: '--global-option="--with-cython --with-distributable-extensions"'
- uses: actions/upload-artifact@v3
with:
name: alt_wheels
path: dist/*.whl

generictarball:
name: ${{ matrix.TARGET }}
Expand All @@ -74,9 +89,9 @@ jobs:
TARGET: generic_tarball
python-version: [3.8]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -92,67 +107,3 @@ jobs:
name: generictarball
path: dist

osx:
name: ${{ matrix.TARGET }}py${{ matrix.python-version }}/wheel_creation
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest]
include:
- os: macos-latest
TARGET: osx
python-version: [ 3.8, 3.9, '3.10', '3.11' ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine wheel setuptools cython pybind11
- name: Build OSX Python wheels
run: |
python setup.py --with-cython --with-distributable-extensions sdist --format=gztar bdist_wheel
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: osx-wheels
path: dist

windows:
name: ${{ matrix.TARGET }}py${{ matrix.python-version }}/wheel_creation
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
include:
- os: windows-latest
TARGET: win
python-version: [ 3.8, 3.9, '3.10', '3.11' ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
shell: pwsh
run: |
$env:PYTHONWARNINGS="ignore::UserWarning"
Invoke-Expression "python -m pip install --upgrade pip"
Invoke-Expression "pip install setuptools twine wheel cython pybind11"
- name: Build Windows Python wheels
shell: pwsh
run: |
$env:PYTHONWARNINGS="ignore::UserWarning"
Invoke-Expression "python setup.py --with-cython --with-distributable-extensions sdist --format=gztar bdist_wheel"
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: win-wheels
path: dist
23 changes: 15 additions & 8 deletions .github/workflows/test_branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Pyomo source
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -56,13 +56,13 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python: ['3.11']
python: ['3.12']
other: [""]
category: [""]

include:
- os: ubuntu-latest
python: '3.11'
python: '3.12'
TARGET: linux
PYENV: pip

Expand All @@ -78,15 +78,15 @@ jobs:
PACKAGES: glpk

- os: ubuntu-latest
python: 3.9
python: '3.11'
other: /conda
skip_doctest: 1
TARGET: linux
PYENV: conda
PACKAGES:

- os: ubuntu-latest
python: 3.8
python: 3.9
other: /mpi
mpi: 3
skip_doctest: 1
Expand All @@ -112,7 +112,7 @@ jobs:

steps:
- name: Checkout Pyomo source
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Configure job parameters
run: |
Expand Down Expand Up @@ -235,6 +235,7 @@ jobs:
run: |
python -c 'import sys;print(sys.executable)'
python -m pip install --cache-dir cache/pip --upgrade pip
python -m pip install --cache-dir cache/pip setuptools
PYOMO_DEPENDENCIES=`python setup.py dependencies \
--extras "$EXTRAS" | tail -1`
PACKAGES="${PYTHON_CORE_PKGS} ${PYTHON_PACKAGES} ${PYOMO_DEPENDENCIES} "
Expand All @@ -258,6 +259,12 @@ jobs:
|| echo "WARNING: Gurobi is not available"
python -m pip install --cache-dir cache/pip xpress \
|| echo "WARNING: Xpress Community Edition is not available"
if [[ ${{matrix.python}} == pypy* ]]; then
echo "skipping wntr for pypy"
else
python -m pip install wntr \
|| echo "WARNING: WNTR is not available"
fi
fi
python -c 'import sys; print("PYTHON_EXE=%s" \
% (sys.executable,))' >> $GITHUB_ENV
Expand Down Expand Up @@ -660,7 +667,7 @@ jobs:
timeout-minutes: 10
steps:
- name: Checkout Pyomo source
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v4
Expand Down Expand Up @@ -715,7 +722,7 @@ jobs:

steps:
- name: Checkout Pyomo source
uses: actions/checkout@v3
uses: actions/checkout@v4
# We need the source for .codecov.yml and running "coverage xml"

#- name: Pip package cache
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/test_pr_and_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Pyomo source
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -60,7 +60,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: [ 3.8, 3.9, '3.10', '3.11' ]
python: [ 3.8, 3.9, '3.10', '3.11', '3.12' ]
other: [""]
category: [""]

Expand All @@ -79,7 +79,7 @@ jobs:
PACKAGES: glpk

- os: ubuntu-latest
python: 3.9
python: '3.11'
other: /conda
skip_doctest: 1
TARGET: linux
Expand All @@ -96,7 +96,7 @@ jobs:
PACKAGES: mpi4py

- os: ubuntu-latest
python: 3.11
python: '3.11'
other: /singletest
category: "-m 'neos or importtest'"
skip_doctest: 1
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:

steps:
- name: Checkout Pyomo source
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Configure job parameters
run: |
Expand Down Expand Up @@ -265,6 +265,7 @@ jobs:
run: |
python -c 'import sys;print(sys.executable)'
python -m pip install --cache-dir cache/pip --upgrade pip
python -m pip install --cache-dir cache/pip setuptools
PYOMO_DEPENDENCIES=`python setup.py dependencies \
--extras "$EXTRAS" | tail -1`
PACKAGES="${PYTHON_CORE_PKGS} ${PYTHON_PACKAGES} ${PYOMO_DEPENDENCIES} "
Expand All @@ -288,6 +289,12 @@ jobs:
|| echo "WARNING: Gurobi is not available"
python -m pip install --cache-dir cache/pip xpress \
|| echo "WARNING: Xpress Community Edition is not available"
if [[ ${{matrix.python}} == pypy* ]]; then
echo "skipping wntr for pypy"
else
python -m pip install wntr \
|| echo "WARNING: WNTR is not available"
fi
fi
python -c 'import sys; print("PYTHON_EXE=%s" \
% (sys.executable,))' >> $GITHUB_ENV
Expand Down Expand Up @@ -691,7 +698,7 @@ jobs:
timeout-minutes: 10
steps:
- name: Checkout Pyomo source
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v4
Expand Down Expand Up @@ -746,7 +753,7 @@ jobs:

steps:
- name: Checkout Pyomo source
uses: actions/checkout@v3
uses: actions/checkout@v4
# We need the source for .codecov.yml and running "coverage xml"

#- name: Pip package cache
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ gurobi.log

# Jupyterhub/Jupyterlab checkpoints
.ipynb_checkpoints
cplex.log
cplex.log

# Mac tracking files
*.DS_Store*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Pyomo is available under the BSD License - see the

Pyomo is currently tested with the following Python implementations:

* CPython: 3.8, 3.9, 3.10, 3.11
* CPython: 3.8, 3.9, 3.10, 3.11, 3.12
* PyPy: 3.9

_Testing and support policy_:
Expand Down
1 change: 1 addition & 0 deletions doc/OnlineDocs/contributed_packages/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Contributed packages distributed with Pyomo:
gdpopt.rst
iis.rst
incidence/index.rst
latex_printer.rst
mindtpy.rst
mpc/index.rst
multistart.rst
Expand Down
Loading

0 comments on commit 655692a

Please sign in to comment.