From 452849b3325ef00a6b7fa91334d73ef0aa914467 Mon Sep 17 00:00:00 2001 From: Joao-Dionisio Date: Fri, 25 Jul 2025 08:18:44 +0100 Subject: [PATCH 1/4] Verbose pipeline --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 8ead035d5..2237ae310 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -41,7 +41,7 @@ jobs: - name: Install PySCIPOpt run: | export CFLAGS="-O0 -ggdb" # disable compiler optimizations for faster builds - python -m pip install . + python -m pip install . -v - name: Run pyscipopt tests run: | From 0908e00f80a1ff0144e4aa806e583539bad2403c Mon Sep 17 00:00:00 2001 From: Joao-Dionisio Date: Fri, 25 Jul 2025 08:43:25 +0100 Subject: [PATCH 2/4] More warnings, warnings as errors --- .github/workflows/coverage.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 2237ae310..dbcf22239 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -40,8 +40,9 @@ jobs: - name: Install PySCIPOpt run: | - export CFLAGS="-O0 -ggdb" # disable compiler optimizations for faster builds - python -m pip install . -v + export CFLAGS="-O0 -ggdb -Wall -Wextra -Werror" # Optimization mode. More warnings. Warnings as errors. + python -m pip install . -v 2>&1 | tee build.log + grep -i "warning" build.log || true - name: Run pyscipopt tests run: | From cb5863c00c68738c0d75831a853214cba21d7f27 Mon Sep 17 00:00:00 2001 From: Joao-Dionisio Date: Sat, 26 Jul 2025 10:24:18 +0100 Subject: [PATCH 3/4] fixed some warnings --- CHANGELOG.md | 1 + src/pyscipopt/event.pxi | 2 +- src/pyscipopt/expr.pxi | 2 +- src/pyscipopt/scip.pxd | 13 ------------- src/pyscipopt/scip.pxi | 1 - 5 files changed, 3 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c35102ae4..871bebf81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - Generalized getLhs() and getRhs() to additionally support any linear type constraint ### Fixed - Raised an error when an expression is used when a variable is required +- Fixed some compile warnings ### Changed - MatrixExpr.sum() now supports axis arguments and can return either a scalar or MatrixExpr depending on the result dimensions ### Removed diff --git a/src/pyscipopt/event.pxi b/src/pyscipopt/event.pxi index 914e882ed..559d8c44a 100644 --- a/src/pyscipopt/event.pxi +++ b/src/pyscipopt/event.pxi @@ -39,7 +39,7 @@ cdef class Eventhdlr: # local helper functions for the interface -cdef Eventhdlr getPyEventhdlr(SCIP_EVENTHDLR* eventhdlr) noexcept with gil: +cdef Eventhdlr getPyEventhdlr(SCIP_EVENTHDLR* eventhdlr): cdef SCIP_EVENTHDLRDATA* eventhdlrdata eventhdlrdata = SCIPeventhdlrGetData(eventhdlr) return eventhdlrdata diff --git a/src/pyscipopt/expr.pxi b/src/pyscipopt/expr.pxi index 563c73d4a..2fc56f5cb 100644 --- a/src/pyscipopt/expr.pxi +++ b/src/pyscipopt/expr.pxi @@ -358,7 +358,7 @@ cdef class ExprCons: def __repr__(self): return 'ExprCons(%s, %s, %s)' % (self.expr, self._lhs, self._rhs) - def __nonzero__(self): + def __bool__(self): '''Make sure that equality of expressions is not asserted with ==''' msg = """Can't evaluate constraints as booleans. diff --git a/src/pyscipopt/scip.pxd b/src/pyscipopt/scip.pxd index 36ab1c53b..f8190873a 100644 --- a/src/pyscipopt/scip.pxd +++ b/src/pyscipopt/scip.pxd @@ -408,12 +408,6 @@ cdef extern from "scip/scip.h": ctypedef struct SCIP_PROPDATA: pass - ctypedef struct SCIP_PROPTIMING: - pass - - ctypedef struct SCIP_PRESOLTIMING: - pass - ctypedef struct SCIP_PRESOL: pass @@ -456,9 +450,6 @@ cdef extern from "scip/scip.h": ctypedef struct SCIP_PRESOL: pass - ctypedef struct SCIP_HEURTIMING: - pass - ctypedef struct SCIP_SEPA: pass @@ -510,9 +501,6 @@ cdef extern from "scip/scip.h": ctypedef struct BMS_BLKMEM: pass - ctypedef struct SCIP_EXPR: - pass - ctypedef struct SCIP_EXPRHDLR: pass @@ -707,7 +695,6 @@ cdef extern from "scip/scip.h": SCIP_Real SCIPgetLocalTransEstimate(SCIP* scip) # Solve Methods - SCIP_RETCODE SCIPsolve(SCIP* scip) SCIP_RETCODE SCIPsolve(SCIP* scip) noexcept nogil SCIP_RETCODE SCIPsolveConcurrent(SCIP* scip) SCIP_RETCODE SCIPfreeTransform(SCIP* scip) diff --git a/src/pyscipopt/scip.pxi b/src/pyscipopt/scip.pxi index ad9af85b8..1064f29cb 100644 --- a/src/pyscipopt/scip.pxi +++ b/src/pyscipopt/scip.pxi @@ -7974,7 +7974,6 @@ cdef class Model: """ raise Warning("model.getDualMultiplier(cons) is deprecated: please use model.getDualsolLinear(cons)") - return self.getDualsolLinear(cons) def getDualfarkasLinear(self, Constraint cons): """ From c5e43cea8de6e8d1f82f54d7edd9ae177561e08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dion=C3=ADsio?= <57299939+Joao-Dionisio@users.noreply.github.com> Date: Sat, 26 Jul 2025 10:29:13 +0100 Subject: [PATCH 4/4] Update .github/workflows/coverage.yml Co-authored-by: DominikKamp <130753997+DominikKamp@users.noreply.github.com> --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index dbcf22239..6ffd89978 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -40,7 +40,7 @@ jobs: - name: Install PySCIPOpt run: | - export CFLAGS="-O0 -ggdb -Wall -Wextra -Werror" # Optimization mode. More warnings. Warnings as errors. + export CFLAGS="-O0 -ggdb -Wall -Wextra -Werror" # Debug mode. More warnings. Warnings as errors. python -m pip install . -v 2>&1 | tee build.log grep -i "warning" build.log || true