Skip to content

Commit

Permalink
Merge branch 'main' into add_mindtpy_callback
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedongPeng authored Apr 27, 2024
2 parents 3dc4995 + 6393961 commit a74fad7
Show file tree
Hide file tree
Showing 1,817 changed files with 36,050 additions and 13,995 deletions.
4 changes: 2 additions & 2 deletions .coin-or/projDesc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ Carl D. Laird, Chair, Pyomo Management Committee, claird at andrew dot cmu dot e
Use explicit overrides to disable use of automated
version reporting.
-->
<stableVersionNumber>6.7.0</stableVersionNumber>
<releaseNumber>6.7.0</releaseNumber>
<stableVersionNumber>6.7.1</stableVersionNumber>
<releaseNumber>6.7.1</releaseNumber>

</developmentStatus>

Expand Down
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ ed13c8c65d6c3f56973887744be1c62a5d4756de
0d93f98aa608f892df404ad8015885d26e09bb55
63a3c602a00a2b747fc308c0571bbe33e55a3731
363a16a609f519b3edfdfcf40c66d6de7ac135af
d024718991455519e09149ede53a38df1c067abe
017e21ee50d98d8b2f2083e6880f030025ed5378

44 changes: 36 additions & 8 deletions .github/workflows/release_wheel_creation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,27 @@ jobs:
name: Build wheels (${{ matrix.wheel-version }}) on ${{ matrix.os }} for native and cross-compiled architecture
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-22.04, windows-latest, macos-latest]
arch: [all]
wheel-version: ['cp38*', 'cp39*', 'cp310*', 'cp311*', 'cp312*']

include:
- wheel-version: 'cp38*'
TARGET: 'py38'
- wheel-version: 'cp39*'
TARGET: 'py39'
- wheel-version: 'cp310*'
TARGET: 'py310'
- wheel-version: 'cp311*'
TARGET: 'py311'
- wheel-version: 'cp312*'
TARGET: 'py312'
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected].2
uses: pypa/[email protected].5
with:
output-dir: dist
env:
Expand All @@ -41,10 +54,11 @@ jobs:
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
- uses: actions/upload-artifact@v4
with:
name: native_wheels
name: native_wheels-${{ matrix.os }}-${{ matrix.TARGET }}
path: dist/*.whl
overwrite: true

alternative_wheels:
name: Build wheels (${{ matrix.wheel-version }}) on ${{ matrix.os }} for aarch64
Expand All @@ -54,6 +68,18 @@ jobs:
os: [ubuntu-22.04]
arch: [all]
wheel-version: ['cp38*', 'cp39*', 'cp310*', 'cp311*', 'cp312*']

include:
- wheel-version: 'cp38*'
TARGET: 'py38'
- wheel-version: 'cp39*'
TARGET: 'py39'
- wheel-version: 'cp310*'
TARGET: 'py310'
- wheel-version: 'cp311*'
TARGET: 'py311'
- wheel-version: 'cp312*'
TARGET: 'py312'
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
Expand All @@ -62,7 +88,7 @@ jobs:
with:
platforms: all
- name: Build wheels
uses: pypa/[email protected].2
uses: pypa/[email protected].5
with:
output-dir: dist
env:
Expand All @@ -72,10 +98,11 @@ jobs:
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
- uses: actions/upload-artifact@v4
with:
name: alt_wheels
name: alt_wheels-${{ matrix.os }}-${{ matrix.TARGET }}
path: dist/*.whl
overwrite: true

generictarball:
name: ${{ matrix.TARGET }}
Expand All @@ -91,7 +118,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -102,8 +129,9 @@ jobs:
run: |
python setup.py --without-cython sdist --format=gztar
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: generictarball
path: dist
overwrite: true

78 changes: 39 additions & 39 deletions .github/workflows/test_branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ jobs:
- name: Checkout Pyomo source
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Black Formatting Check
run: |
pip install black
# Note v24.4.1 fails due to a bug in the parser
pip install 'black!=24.4.1'
black . -S -C --check --diff --exclude examples/pyomobook/python-ch/BadIndent.py
- name: Spell Check
uses: crate-ci/typos@master
Expand All @@ -66,7 +67,7 @@ jobs:
TARGET: linux
PYENV: pip

- os: macos-latest
- os: macos-13
python: '3.10'
TARGET: osx
PYENV: pip
Expand All @@ -75,24 +76,24 @@ jobs:
python: 3.9
TARGET: win
PYENV: conda
PACKAGES: glpk
PACKAGES: glpk pytest-qt filelock

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

- os: ubuntu-latest
python: 3.9
python: '3.10'
other: /mpi
mpi: 3
skip_doctest: 1
TARGET: linux
PYENV: conda
PACKAGES: mpi4py
PACKAGES: openmpi mpi4py

- os: ubuntu-latest
python: '3.10'
Expand Down Expand Up @@ -134,23 +135,23 @@ jobs:
| tr '\n' ' ' | sed 's/ \+/ /g' >> $GITHUB_ENV
#- name: Pip package cache
# uses: actions/cache@v3
# uses: actions/cache@v4
# if: matrix.PYENV == 'pip'
# id: pip-cache
# with:
# path: cache/pip
# key: pip-${{env.CACHE_VER}}.0-${{runner.os}}-${{matrix.python}}

#- name: OS package cache
# uses: actions/cache@v3
# uses: actions/cache@v4
# if: matrix.TARGET != 'osx'
# id: os-cache
# with:
# path: cache/os
# key: pkg-${{env.CACHE_VER}}.0-${{runner.os}}

- name: TPL package download cache
uses: actions/cache@v3
uses: actions/cache@v4
if: ${{ ! matrix.slim }}
id: download-cache
with:
Expand Down Expand Up @@ -202,17 +203,26 @@ jobs:
- name: Set up Python ${{ matrix.python }}
if: matrix.PYENV == 'pip'
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Set up Miniconda Python ${{ matrix.python }}
if: matrix.PYENV == 'conda'
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: false
python-version: ${{ matrix.python }}

# This is necessary for qt (UI) tests; the package utilized here does not
# have support for OSX.
- name: Set up UI testing infrastructure
if: ${{ matrix.TARGET != 'osx' }}
uses: pyvista/setup-headless-display-action@v2
with:
qt: true
pyvista: false

# GitHub actions is very fragile when it comes to setting up various
# Python interpreters, expecially the setup-miniconda interface.
# Per the setup-miniconda documentation, it is important to always
Expand Down Expand Up @@ -309,7 +319,7 @@ jobs:
fi
# HACK: Remove problem packages on conda+Linux
if test "${{matrix.TARGET}}" == linux; then
EXCLUDE="casadi numdifftools pint $EXCLUDE"
EXCLUDE="casadi numdifftools $EXCLUDE"
fi
EXCLUDE=`echo "$EXCLUDE" | xargs`
if test -n "$EXCLUDE"; then
Expand All @@ -324,10 +334,11 @@ jobs:
CONDA_DEPENDENCIES="$CONDA_DEPENDENCIES $PKG"
fi
done
echo ""
echo "*** Install Pyomo dependencies ***"
# Note: this will fail the build if any installation fails (or
# possibly if it outputs messages to stderr)
conda install --update-deps -q -y $CONDA_DEPENDENCIES
conda install --update-deps -y $CONDA_DEPENDENCIES
if test -z "${{matrix.slim}}"; then
PYVER=$(echo "py${{matrix.python}}" | sed 's/\.//g')
echo "Installing for $PYVER"
Expand All @@ -346,10 +357,11 @@ jobs:
| sed -r 's/\s+/ /g' | cut -d\ -f3) || echo ""
if test -n "$_BUILDS"; then
_ISPY=$(echo "$_BUILDS" | grep "^py") \
|| echo "No python build detected"
_PYOK=$(echo "$_BUILDS" | grep "^$PYVER") \
|| echo "No python build matching $PYVER detected"
|| echo "INFO: No python build detected."
_PYOK=$(echo "$_BUILDS" | grep -E "^($PYVER|pyh)") \
|| echo "INFO: No python build matching $PYVER detected."
if test -z "$_ISPY" -o -n "$_PYOK"; then
echo ""
echo "... INSTALLING $PKG"
conda install -y "$PKG" || _BUILDS=""
fi
Expand All @@ -358,18 +370,6 @@ jobs:
echo "WARNING: $PKG is not available"
fi
done
# TODO: This is a hack to stop test_qt.py from running until we
# can better troubleshoot why it fails on GHA
for QTPACKAGE in qt pyqt; do
# Because conda is insane, removing packages can cause
# unrelated packages to be updated (breaking version
# specifications specified previously, e.g., in
# setup.py). There doesn't appear to be a good
# workaround, so we will just force-remove (recognizing
# that it may break other conda cruft).
conda remove --force-remove $QTPACKAGE \
|| echo "$QTPACKAGE not in this environment"
done
fi
# Re-try Pyomo (optional) dependencies with pip
if test -n "$PYPI_DEPENDENCIES"; then
Expand Down Expand Up @@ -633,7 +633,7 @@ jobs:
$PYTHON_EXE -c "from pyomo.dataportal.parse_datacmds import \
parse_data_commands; parse_data_commands(data='')"
# Note: if we are testing with openmpi, add '--oversubscribe'
mpirun -np ${{matrix.mpi}} pytest -v \
mpirun -np ${{matrix.mpi}} -oversubscribe pytest -v \
--junit-xml=TEST-pyomo-mpi.xml \
-m "mpi" -W ignore::Warning \
pyomo `pwd`/pyomo-model-libraries
Expand All @@ -650,7 +650,7 @@ jobs:
coverage xml -i
- name: Record build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}_${{env.GHA_JOBGROUP}}-${{env.GHA_JOBNAME}}
path: |
Expand All @@ -670,7 +670,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand Down Expand Up @@ -710,12 +710,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-13, windows-latest]

include:
- os: ubuntu-latest
TARGET: linux
- os: macos-latest
- os: macos-13
TARGET: osx
- os: windows-latest
TARGET: win
Expand All @@ -726,19 +726,19 @@ jobs:
# We need the source for .codecov.yml and running "coverage xml"

#- name: Pip package cache
# uses: actions/cache@v3
# uses: actions/cache@v4
# id: pip-cache
# with:
# path: cache/pip
# key: pip-${{env.CACHE_VER}}.0-${{runner.os}}-3.8

- name: Download build artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Set up Python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand Down Expand Up @@ -833,7 +833,7 @@ jobs:
- name: Upload codecov reports
if: github.repository_owner == 'Pyomo' || github.ref != 'refs/heads/main'
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
files: coverage.xml
token: ${{ secrets.PYOMO_CODECOV_TOKEN }}
Expand All @@ -845,7 +845,7 @@ jobs:
if: |
hashFiles('coverage-other.xml') != '' &&
(github.repository_owner == 'Pyomo' || github.ref != 'refs/heads/main')
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
files: coverage-other.xml
token: ${{ secrets.PYOMO_CODECOV_TOKEN }}
Expand Down
Loading

0 comments on commit a74fad7

Please sign in to comment.