coin-or / pulp

A python Linear Programming API
http://coin-or.github.io/pulp/
Other
2.01k stars 376 forks source link

Highspy and Xpress are not installed by `pythonpackage` github action workflow when they are supposed to be #731

Closed simon-b closed 4 months ago

simon-b commented 5 months ago

Highspy is supposed to be installed for several matrix tests: https://github.com/coin-or/pulp/blob/master/.github/workflows/pythonpackage.yml#L36 if: (matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest') && matrix.python-version < '3.12'

However, this step is not actually run in all cases where it is expected. E.g here, install highspy step is skipped across many matrix jobs, for example with python 3.7 and os "ubuntu-latest": https://github.com/coin-or/pulp/actions/runs/7694250028

The step install xpress is also skipped in that same example, even though the condition for install xpress should be hit: if: (matrix.os != 'macOS-latest' || matrix.python-version < '3.11') && matrix.python-version < '3.12'

I believe this is because the checks on matrix.python-version are not valid -- these are e.g. a float check or string comparison and not a proper version comparison.

simon-b commented 5 months ago

I observe that install highs runs with ubuntu-latest and python 3.10 and 3.11 and with no other python versions: https://github.com/coin-or/pulp/actions/runs/7694250028/job/20964667848 https://github.com/coin-or/pulp/actions/runs/7694250028/job/20964668719

Therefore I believe that matrix.python-version < '3.12' is treated as a float comparison

pchtsp commented 5 months ago

thanks and it makes sense. Do you know how to solve it? Would you mind doing a PR? This is the only thing I found: https://stackoverflow.com/questions/73598359/github-actions-run-only-if-above-certain-python-version

simon-b commented 5 months ago

Hmm yeah that's the only clear solution I can see on google. I can test this change when I have some time. For current matrix it should work out for now with only 3.x; not any 2.x or 3.x.y.

Only other ideas I have would be to:

The solution proposed on SO is probably the simplest/quickest fix at least in short term.

pchtsp commented 4 months ago

sure, if you do the PR I'll take a look, thanks!

pchtsp commented 4 months ago

I actually fixed this in an uglier but simpler way: https://github.com/coin-or/pulp/pull/734/files I took out mac-OS from the xpress tests because it appears to fail all the time. Now highspy is tested for all three distros. I'm closing for now.