diff --git a/.github/workflows/test_branches.yml b/.github/workflows/test_branches.yml index e5af7e5cbe5..2940edfc70c 100644 --- a/.github/workflows/test_branches.yml +++ b/.github/workflows/test_branches.yml @@ -376,9 +376,11 @@ jobs: echo "*** Install Pyomo dependencies ***" # For windows, cannot use newer setuptools because of APPSI compilation issues # There seems to be some specific problem with platformdirs 4.5.0 - # on win 3.13/3.14 as of 2025-10-23 + # on win 3.13/3.14 as of 2025-10-23 and platformdirs 4.5.1 on win/3.13 + # as of 2025-12-12, pip 25.3 now packages the problematic platformdirs + # version so excluding that also. if test "${{matrix.TARGET}}" == 'win'; then - CONDA_DEPENDENCIES="$CONDA_DEPENDENCIES setuptools<74.0.0 platformdirs!=4.5.0" + CONDA_DEPENDENCIES="$CONDA_DEPENDENCIES setuptools<74.0.0 platformdirs!=4.5.0,!=4.5.1 pip<25.0" fi # Note: this will fail the build if any installation fails (or # possibly if it outputs messages to stderr) @@ -453,6 +455,8 @@ jobs: echo "" echo "Installing packages only available on PyPI" if test -n "$PYPI_DEPENDENCIES"; then + python -c "import pip; print(pip.__version__, pip.__file__)" + python -c "import platformdirs; print(platformdirs.__version__, platformdirs.__file__)" python -m pip install --cache-dir cache/pip $PYPI_DEPENDENCIES fi # remember this python interpreter diff --git a/.github/workflows/test_pr_and_main.yml b/.github/workflows/test_pr_and_main.yml index 62814d904fa..409303ea42e 100644 --- a/.github/workflows/test_pr_and_main.yml +++ b/.github/workflows/test_pr_and_main.yml @@ -93,8 +93,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - # FIXME: pinning to 3.14.0 until 3.14.1 is removed from runner tool cache - python: [ '3.10', 3.11, 3.12, 3.13, 3.14.0 ] + python: [ '3.10', 3.11, 3.12, 3.13, 3.14 ] other: [""] category: [""] @@ -369,6 +368,7 @@ jobs: if: matrix.PYENV == 'conda' run: | # Set up environment + python -c "import ctypes; print('CTYPES', ctypes.__file__)" conda config --set always_yes yes conda config --set auto_update_conda false conda config --set channel_priority strict @@ -429,13 +429,18 @@ jobs: echo "*** Install Pyomo dependencies ***" # For windows, cannot use newer setuptools because of APPSI compilation issues # There seems to be some specific problem with platformdirs 4.5.0 - # on win 3.13/3.14 as of 2025-10-23 + # on win 3.13/3.14 as of 2025-10-23 and platformdirs 4.5.1 on win/3.13 + # as of 2025-12-12. pip 25.3 now packages the problematic platformdirs + # version so excluding that also. if test "${{matrix.TARGET}}" == 'win'; then - CONDA_DEPENDENCIES="$CONDA_DEPENDENCIES setuptools<74.0.0 platformdirs!=4.5.0" + CONDA_DEPENDENCIES="$CONDA_DEPENDENCIES setuptools<74.0.0 platformdirs!=4.5.0,!=4.5.1" fi # Note: this will fail the build if any installation fails (or # possibly if it outputs messages to stderr) - conda install --update-deps -q -y python="${{matrix.python}}" $CONDA_DEPENDENCIES + # Note: remove '--update-deps' to prevent update that breaks ctypes + # Note: removed 'python="${{matrix.python}}"'... is it not necessary? + conda install -q -y --no-update-deps $CONDA_DEPENDENCIES + python -c "import ctypes; print('CTYPES', ctypes.__file__)" if test -z "${{matrix.slim}}"; then # xpress.init() (xpress 9.5.1 from conda) hangs indefinitely # on GHA/Windows under Python 3.10 and 3.11. Exclude that @@ -505,6 +510,8 @@ jobs: # Re-try Pyomo (optional) dependencies with pip echo "" echo "Installing packages only available on PyPI" + conda install -q -y --force-reinstall pip libffi python python_abi \ + `conda list | grep -E 'zlib|^vc|^vs' | cut -d\ -f1` if test -n "$PYPI_DEPENDENCIES"; then python -m pip install --cache-dir cache/pip $PYPI_DEPENDENCIES fi diff --git a/.github/workflows/typos.toml b/.github/workflows/typos.toml index c58806ff71e..76bfe276dec 100644 --- a/.github/workflows/typos.toml +++ b/.github/workflows/typos.toml @@ -65,6 +65,8 @@ MCH = "MCH" # Ignore RO ro = "ro" RO = "RO" +# Ignore bimap +bimap = "bimap" # Ignore EOF - end of file EOF = "EOF" # Ignore lst as shorthand for list diff --git a/pyomo/contrib/piecewise/tests/test_nonlinear_to_pwl.py b/pyomo/contrib/piecewise/tests/test_nonlinear_to_pwl.py index 48c36c017fb..491ba2f4069 100644 --- a/pyomo/contrib/piecewise/tests/test_nonlinear_to_pwl.py +++ b/pyomo/contrib/piecewise/tests/test_nonlinear_to_pwl.py @@ -602,7 +602,7 @@ def test_linear_model_tree_uniform(self): # pretty close to m.x, but we're a bit off because we don't have 0 # as a breakpoint. 0.9833360108369479 * m.x + 0.16663989163052034, - places=7, + places=6, ) def test_linear_model_tree_random(self): @@ -657,7 +657,7 @@ def test_linear_model_tree_random_auto_depth_tree(self): pwlf._simplices, [(0, 1), (1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 7), (7, 8)], ) - self.assertEqual( + self.assertStructuredAlmostEqual( pwlf._points, [ (-10,), @@ -670,6 +670,7 @@ def test_linear_model_tree_random_auto_depth_tree(self): (2.15597,), (10,), ], + places=4, ) self.assertEqual(len(pwlf._linear_functions), 8) for i in range(3): @@ -680,7 +681,7 @@ def test_linear_model_tree_random_auto_depth_tree(self): # pretty close to - m.x, but we're a bit off because we don't have 0 # as a breakpoint. -0.9851979299618323 * m.x + 0.12006477080409184, - places=7, + places=6, ) for i in range(4, 8): assertExpressionsEqual(self, pwlf._linear_functions[i](m.x), m.x)