Skip to content

Commit

Permalink
Merge branch 'main' into fix-rec
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Oct 25, 2024
2 parents 4ae3c85 + 404820f commit 234f391
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,17 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]
platform: [ubuntu-latest, windows-latest]
include:
- python-version: "3.9"
platform: ubuntu-latest
- python-version: "3.8"
platform: macos-13
- python-version: "3.9"
platform: macos-13
- python-version: "3.10"
platform: macos-latest
- python-version: "3.11"
platform: macos-latest
- python-version: "3.12"
platform: ubuntu-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -69,7 +65,7 @@ jobs:
channel-priority: true

- name: install build deps
run: mamba install scip gurobi gcovr
run: mamba install scip=9.1.0 gurobi gcovr

- name: add gurobi license
shell: bash
Expand All @@ -87,7 +83,7 @@ jobs:
python setup.py build_ext --inplace # required for C coverage
env:
CYTHON_TRACE: 1 # enable coverage of cython code
CFLAGS: '-coverage' # enable coverage of C code
CFLAGS: "-coverage" # enable coverage of C code

- name: run tests
run: |
Expand All @@ -100,7 +96,7 @@ jobs:
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml,./coverage_cpp.xml

# we only deploy the sdist to PyPI, the wheel is still complicated
deploy-sdist:
if: startsWith(github.ref, 'refs/tags')
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ilpy links against SCIP, so you must have SCIP installed in your environment.
(You can install via conda)

```bash
conda install scip
conda install scip==9.1.0
```

Then clone the repo and install in editable mode.
Expand Down
5 changes: 3 additions & 2 deletions ilpy/_functional.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Callable, Iterable, Literal, Mapping, Sequence, Tuple
from collections.abc import Iterable, Mapping, Sequence
from typing import TYPE_CHECKING, Callable, Literal

from .expressions import Expression
from .wrapper import (
Expand All @@ -14,7 +15,7 @@
)

if TYPE_CHECKING:
ConstraintTuple = Tuple[list[float], Relation | str, float]
ConstraintTuple = tuple[list[float], Relation | str, float]
SenseType = Sense | Literal["minimize", "maximize"]
VariableTypeType = VariableType | Literal["continuous", "binary", "integer"]
PreferenceType = Preference | Literal["any", "cplex", "gurobi", "scip"]
Expand Down
3 changes: 2 additions & 1 deletion ilpy/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

import ast
import sys
from collections.abc import Iterator, Sequence
from contextlib import contextmanager
from typing import Any, ClassVar, Iterator, Sequence, Union
from typing import Any, ClassVar, Union

from ilpy.wrapper import Constraint, Objective, Relation, Sense

Expand Down
3 changes: 2 additions & 1 deletion ilpy/wrapper.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections.abc import Iterable, Mapping, Sequence
from enum import IntEnum, auto
from typing import TYPE_CHECKING, Callable, Iterable, Mapping, Sequence
from typing import TYPE_CHECKING, Callable

if TYPE_CHECKING:
LinearCoeffs = Sequence[float] | Mapping[int, float]
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# https://peps.python.org/pep-0517
[build-system]
requires = ["setuptools", "Cython"]
requires = ["setuptools==71.1.0", "Cython"]
build-backend = "setuptools.build_meta"

# https://peps.python.org/pep-0621/
[project]
name = "ilpy"
description = "Python wrappers for popular MIP solvers."
requires-python = ">=3.8"
requires-python = ">=3.9"
license = { text = "MIT" }
authors = [
{ email = "[email protected]", name = "Jan Funke" },
Expand All @@ -25,6 +25,7 @@ dev = [
"pytest",
"pytest-cov",
"cython",
"setuptools==71.1.0",
"numpy",
"gurobipy", # used on CI to confirm equality of results
]
Expand All @@ -48,7 +49,7 @@ readme = { file = ["README.md"] }

# https://beta.ruff.rs/docs
[tool.ruff]
target-version = "py38"
target-version = "py39"
src = ["ilpy"]

[tool.ruff.lint]
Expand Down
3 changes: 2 additions & 1 deletion tests/test_solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import operator
import os
from typing import Iterable, NamedTuple, Sequence
from collections.abc import Iterable, Sequence
from typing import NamedTuple
from unittest.mock import Mock

import ilpy
Expand Down

0 comments on commit 234f391

Please sign in to comment.