coin-or / python-mip

Python-MIP: collection of Python tools for the modeling and solution of Mixed-Integer Linear programs
Eclipse Public License 2.0
530 stars 92 forks source link

Added pre-commit #293

Closed Markus28 closed 2 years ago

Markus28 commented 2 years ago

I just think that it's inconvenient to have style checks in CI but not locally so I added pre-commit (exactly matches the style checks in CI but excludes mip/_version.py). Feel free to close this PR if there's a reason why you wouldn't want to have pre-commit.

sebheger commented 2 years ago

It's a good idea. Could you also please adapt the CI / style part to use the pre-commit configuration? I want to make sure that there is only a single config for black and flake8 (and in near future also mypy).

Markus28 commented 2 years ago

Good point, it should be working now (although this is the first time I'm messing with CI, so who knows lol)

Markus28 commented 2 years ago

I don't think the failing test has anything to do with what I changed...

sebheger commented 2 years ago

I guess the problem is related to #284. I have recognized, that the requirements could be python version specified. We have observed a lot of issues around python 3.7 as it isn't supported by the latest numpy version, so i downgrade the numpy version to be compatible with 3.7.

sebheger commented 2 years ago

I have disabled the failing part of the CI for the moment. You could rebase and then we are able to merge

Markus28 commented 2 years ago

Done. But not sure why that was necessary, there weren't any conflicts, were there?

Markus28 commented 2 years ago

Again, a check unrelated to precommit is failing