Skip to content

Commit 6044fc8

Browse files
authored
Add support for python 3.11 (#328)
* Add support for python 3.11 * Use gurobi 10.0.0 in CI * Move all dependencies into pyproject.toml
1 parent d8a3197 commit 6044fc8

File tree

3 files changed

+11
-18
lines changed

3 files changed

+11
-18
lines changed

Diff for: .github/workflows/github-ci.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,14 @@ jobs:
3333
run: pre-commit run --all-files
3434

3535

36-
3736
test:
3837

3938
runs-on: ${{ matrix.os }}
4039
strategy:
4140
fail-fast: false
4241
matrix:
4342
# temporarily downgraded to 3.7.9 and 3.8.10 due to a bug https://github.com/actions/setup-python/issues/402
44-
python-version: ["3.7.9", "3.8.10", "3.9.13", "3.10.9", "pypy3.9-v7.3.9"]
43+
python-version: ["3.7.9", "3.8.10", "3.9.13", "3.10.9", "3.11.1", "pypy3.9-v7.3.9"]
4544
os: [macos-11, macos-12, ubuntu-20.04, ubuntu-22.04, windows-2019, windows-2022]
4645
exclude:
4746
# temporarily exclude pypy3 on mac-os as there failing tests caused by bug on cbc side
@@ -82,13 +81,14 @@ jobs:
8281
path: ${{ steps.pip-cache.outputs.dir }}
8382
key: ${{ runner.os }}-${{ matrix.python-version }}-pythonpip
8483

85-
- name: Install additional requirements (CPython)
86-
if: ${{ matrix.python-version != 'pypy3.9-v7.3.9' }}
87-
run: python -m pip install "matplotlib==3.5.2" "gurobipy==9.5.1"
88-
89-
- name: Install mip
84+
- name: Install mip for testing (PyPy)
85+
if: ${{ matrix.python-version == 'pypy3.9-v7.3.9' }}
9086
run: python -m pip install .[test,numpy]
9187

88+
- name: Install mip for testing (CPython)
89+
if: ${{ matrix.python-version != 'pypy3.9-v7.3.9' }}
90+
run: python -m pip install .[test,numpy,gurobi]
91+
9292
- name: list installed packages
9393
run: python -m pip list
9494

Diff for: examples/plant_location.py

-7
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@
1111

1212
import sys
1313

14-
# If running as a unit test, then skip if under pypy
15-
if hasattr(sys, '_called_from_test') and sys._called_from_test is True:
16-
import platform
17-
if 'pypy' in platform.python_implementation().lower():
18-
import pytest
19-
pytest.skip("Matplotlib installation not working under pypy")
20-
2114
# Workaround for issues with python not being installed as a framework on mac
2215
# by using a different backend.
2316
if sys.platform == "darwin": # OS X

Diff for: pyproject.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66
name = "mip"
77
description = "Python tools for Modeling and Solving Mixed-Integer Linear Programs (MIPs)"
88
readme = "README.md"
9-
requires-python = ">=3.7,<3.11"
9+
requires-python = ">=3.7,<3.12"
1010
license = {file = "LICENSE"}
1111
authors = [
1212
{name="T.A.M. Toffolo", email="[email protected]"},
@@ -32,12 +32,12 @@ classifiers = [
3232
]
3333
dynamic = ["version"]
3434

35-
dependencies = ["cffi==1.15.0"]
35+
dependencies = ["cffi==1.15.*"]
3636

3737
[project.optional-dependencies]
38-
numpy = ["numpy==1.24.1; python_version >= '3.8'", "numpy==1.21.6; python_version == '3.7'"]
38+
numpy = ["numpy==1.24.*; python_version >= '3.8'", "numpy==1.21.6; python_version == '3.7'"]
3939
gurobi = ["gurobipy>=8"]
40-
test = ["pytest==7.2.0", "networkx==2.6.3"]
40+
test = ["pytest==7.2.0", "networkx==2.8.8; python_version >= '3.8'", "networkx==2.6.3; python_version == '3.7'", "matplotlib==3.6.2; python_version >= '3.8'", "matplotlib==3.5.3; python_version == '3.7'"]
4141

4242
[project.urls]
4343
"Homepage" = "https://www.python-mip.com"

0 commit comments

Comments
 (0)