Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: trying to fix ci #68

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
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
10 changes: 6 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,16 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
miniforge-version: latest
use-mamba: true
channels: conda-forge,gurobi,defaults
channel-priority: true

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

- name: install gurobi
if: runner.os != 'Windows'
run: conda install -c gurobi gurobi=11.0.3

- name: add gurobi license
shell: bash
id: write-license
env:
LICENSE: ${{ secrets.GRB_LICENSE_FILE }}
Expand All @@ -78,6 +79,7 @@ jobs:

- name: install package
run: |
conda list
python -m pip install -U pip
python -m pip install -e .[dev]
python setup.py build_ext --inplace # required for C coverage
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
rev: v0.8.2
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.16.0
rev: v0.16.6
hooks:
- id: cython-lint
- id: double-quote-cython-strings

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
rev: v1.13.0
hooks:
- id: mypy
files: "^ilpy/"
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,23 @@ conda install -c funkelab ilpy

## Local development

ilpy links against SCIP, so you must have SCIP installed in your environment.
(You can install via conda)
Clone the repo and install in editable mode.

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

Then clone the repo and install in editable mode.
Note, `ilpy` links against SCIP, so you must have SCIP installed in your environment,
in order to build:

```bash
git clone <your-fork>
cd ilpy

conda create -n ilpy -c conda-forge -c gurobi python scip==9.1.0 gurobi==11.0.3
conda activate ilpy
pip install -e .[dev]
```

If you make local change and want to rebuild the extension quickly, you can run:

```bash
rm -rf build
python setup.py build_ext --inplace
```
2 changes: 1 addition & 1 deletion ilpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
"Scip",
"Sense",
"Solution",
"solve",
"Solver",
"Solver",
"Variable",
"VariableType",
"solve",
]


Expand Down
8 changes: 4 additions & 4 deletions ilpy/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

Expand All @@ -22,7 +22,7 @@ def recursion_limit_raised_by(N: int = 5000) -> Iterator[None]:
sys.setrecursionlimit(old_limit)


class Expression(ast.AST):
class Expression(ast.expr):
"""Base class for all expression nodes.

Expressions allow ilpy to represent mathematical expressions in an
Expand Down Expand Up @@ -147,8 +147,8 @@ class Compare(Expression, ast.Compare):
def __init__(
self,
left: Expression,
ops: Sequence[ast.cmpop],
comparators: Sequence[Expression | Number],
ops: list[ast.cmpop],
comparators: list[Expression | Number],
**kwargs: Any,
) -> None:
super().__init__(
Expand Down
Loading
Loading