Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/test_branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ env:
PYTHON_CORE_PKGS: wheel
PYPI_ONLY: z3-solver linear-tree
PYPY_EXCLUDE: scipy numdifftools seaborn statsmodels linear-tree
CACHE_VER: v260512.3
CACHE_VER: v260804.0
NEOS_EMAIL: tests@pyomo.org
SRC_REF: ${{ github.head_ref || github.ref }}
PYOMO_WORKFLOW: branch
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_pr_and_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ env:
PYTHON_CORE_PKGS: wheel
PYPI_ONLY: z3-solver linear-tree
PYPY_EXCLUDE: scipy numdifftools seaborn statsmodels linear-tree
CACHE_VER: v260512.3
CACHE_VER: v260804.0
NEOS_EMAIL: tests@pyomo.org
SRC_REF: ${{ github.head_ref || github.ref }}
PYOMO_WORKFLOW: |
Expand Down Expand Up @@ -196,7 +196,7 @@ jobs:
PACKAGES: pyutilib

- os: ubuntu-latest
python: 'pypy-3.11-v7.3.20' #FIXME: Temporary version pin to avoid PyPy 7.3.21
python: 'pypy-3.11'
TARGET: linux
PYENV: pip

Expand Down
4 changes: 4 additions & 0 deletions pyomo/contrib/satsolver/tests/test_satsolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@
from pyomo.gdp import Disjunct, Disjunction

exdir = join(PYOMO_ROOT_DIR, 'examples', 'gdp')
from pyomo.common.envvar import is_pypy


@unittest.skipUnless(z3_available, "Z3 SAT solver is not available.")
@unittest.skipIf(
is_pypy, "satsolver tests stall on pypy; these will no longer be tested."
)
class SatSolverTests(unittest.TestCase):
def test_simple_sat_model(self):
m = ConcreteModel()
Expand Down
6 changes: 3 additions & 3 deletions pyomo/core/tests/unit/test_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
NonNegativeReals,
sum_product,
)

is_pypy = platform.python_implementation().lower().startswith("pypy")
from pyomo.common.dependencies import dill_available
from pyomo.common.envvar import is_pypy


def obj_rule(model):
Expand Down Expand Up @@ -319,7 +319,7 @@ def rule2(model, i):
model.con = Constraint(rule=rule1)
model.con2 = Constraint(model.a, rule=rule2)
instance = model.create_instance()
if is_pypy:
if is_pypy and dill_available:
str_ = pickle.dumps(instance)
tmp_ = pickle.loads(str_)
else:
Expand Down
5 changes: 5 additions & 0 deletions pyomo/gdp/tests/test_mbigm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from pyomo.common.fileutils import import_file, PYOMO_ROOT_DIR
from pyomo.common.log import LoggingIntercept
import pyomo.common.unittest as unittest
from pyomo.common.envvar import is_pypy
from pyomo.core.expr.compare import (
assertExpressionsEqual,
assertExpressionsStructurallyEqual,
Expand Down Expand Up @@ -1136,6 +1137,10 @@ def test_calculate_Ms_infeasible_Disjunct(self):
@unittest.skipUnless(
SolverFactory('ipopt').available(exception_flag=False), "Ipopt is not available"
)
@unittest.skipIf(
is_pypy,
"tests using multiprocessing stall on pypy; this will no longer be tested.",
)
def test_calculate_Ms_infeasible_Disjunct_local_solver(self):
m = self.make_infeasible_disjunct_model()
# When multiple exceptions are raised during a
Expand Down
6 changes: 5 additions & 1 deletion pyomo/solvers/plugins/solvers/cuopt_direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ def _get_cuopt_version(cuopt, avail):
CUOPTDirect._name = "cuOpt %s.%s%s" % CUOPTDirect._version


cuopt, cuopt_available = attempt_import("cuopt", callback=_get_cuopt_version)
# Note: catch RuntimeError as the base for CUDARuntimeError, which can
# be raised, e.g., for CUDA driver version mismatches
cuopt, cuopt_available = attempt_import(
"cuopt", callback=_get_cuopt_version, catch_exceptions=(ImportError, RuntimeError)
)


@SolverFactory.register("cuopt", doc="Direct python interface to CUOPT")
Expand Down
1 change: 0 additions & 1 deletion pyomo/solvers/tests/checks/test_cuopt_direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
Binary,
)
import pytest
from pyomo.common.dependencies import attempt_import
from pyomo.opt import check_available_solvers
from pyomo.common.tee import capture_output
from pyomo.common.tempfiles import TempfileManager
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ def __ne__(self, other):
'scipy', # Needed by autodoc for pynumero
],
'optional': [
'dill', # No direct use, but improves lambda pickle
'ipython', # contrib.viewer
'linear-tree; python_version<"3.14"', # contrib.piecewise
# FIXME: This is a temporary pin that should be removed
Expand Down Expand Up @@ -253,6 +252,7 @@ def __ne__(self, other):
# install on PyPy (binary wheels are not available), so we
# will only "require" them on other (CPython) platforms:
'casadi; implementation_name!="pypy"', # dae
'dill; implementation_name!="pypy"', # No direct use, but improves lambda pickle
'numdifftools; implementation_name!="pypy"', # pynumero
'pandas; implementation_name!="pypy"',
'seaborn; implementation_name!="pypy"', # parmest.graphics
Expand Down
Loading