From 19c7b75142c636f3ddfe0ca7b024361f1cc5c5e4 Mon Sep 17 00:00:00 2001 From: Franco Peschiera Date: Fri, 1 Nov 2024 10:21:54 +0100 Subject: [PATCH] take out python 3.7, use numpy<2 (#783) --- .github/workflows/pythonpackage.yml | 21 +++++++++------------ pulp/apis/__init__.py | 1 + 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index e0e39cbe..6d6999cc 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -8,11 +8,9 @@ jobs: strategy: max-parallel: 21 matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] os: [ubuntu-latest, macOS-latest, windows-latest] exclude: - - os: macOS-latest - python-version: '3.7' - os: macOS-latest python-version: '3.8' @@ -26,13 +24,12 @@ jobs: run: | python -m pip install --upgrade pip - name: Code Quality - if: matrix.python-version != '3.7' run: | - pip install black + python -m pip install black black pulp/ --check - name: Install dependencies run: | - pip install . + python -m pip install . - name: install glpk if: matrix.os == 'ubuntu-latest' run: | @@ -40,15 +37,15 @@ jobs: sudo apt-get install -qq glpk-utils - name: install xpress if: matrix.os != 'macOS-latest' && matrix.python-version != '3.12' - run: pip install xpress + run: python -m pip install xpress - name: Install gurobipy run: | python -m pip install gurobipy - name: Install highspy if: matrix.python-version != '3.12' - # alternatively if: contains(fromJSON("['3.7', '3.8', '3.9', '3.10', '3.11']"), matrix.python-version) + # alternatively if: contains(fromJSON("['3.8', '3.9', '3.10', '3.11']"), matrix.python-version) run: | - pip install highspy numpy + python -m pip install highspy "numpy<2" - name: Install highspy cmd if: matrix.os == 'ubuntu-latest' uses: supplypike/setup-bin@v4 @@ -59,12 +56,12 @@ jobs: version: '1.7.1' - name: Install coptpy run: | - pip install coptpy + python -m pip install coptpy - name: Install saspy run: | - pip install saspy + python -m pip install saspy - name: Install swat run: | - pip install swat + python -m pip install swat - name: Test with pulptest run: pulptest diff --git a/pulp/apis/__init__.py b/pulp/apis/__init__.py index fc10c6f3..9528dae4 100644 --- a/pulp/apis/__init__.py +++ b/pulp/apis/__init__.py @@ -125,6 +125,7 @@ def getSolverFromDict(data): :raises PulpSolverError: if the dictionary does not have the "solver" key :rtype: LpSolver """ + data = dict(data) solver = data.pop("solver", None) if solver is None: raise PulpSolverError("The json file has no solver attribute.")