MiniZinc / mzn-bench

A framework to performing benchmark testing on MiniZinc models, solvers, and/or the compiler itself.
https://www.minizinc.org
5 stars 5 forks source link

How to install [scripts] extra #28

Closed ptal closed 1 year ago

ptal commented 1 year ago

Hello,

I'm trying to use mzn-bench, and more precisely the latest pull request #27 but I can't figure out how to install this package locally with the [scripts] extra installed.

I run pip install -e . in the repository. But then when trying to use check-solutions I obtain:

mzn-bench check-solutions -c 0 ./results
This feature is not supported in minimal minizinc-slurm environments.

Please install using `pip install mzn-bench[scripts]`

I read a bit about Poetry and it seems scripts is not declared as an extra anymore but as a group dependency, and that normally it should be installed by default ?

Would be grateful if you can let me know which command you are using to install and run this project locally. Thanks!

Dekker1 commented 1 year ago

It seems that I made a mistake when making the poetry file. These additional dependencies should indeed be defined as an extra, not a group.

In the meantime, installing tabulate and pandas manually should enable the same functionality

ptal commented 1 year ago

Thanks! Not sure if it's relevant to the pull request #27 but FYI I had to correct a small bug, in check_solutions.py, line 143, instead of path=Path(path), it should be (?) fspath=path.

(Same in check_statuses.py line 61)

For reference, the error I got was (on Linux, Ubuntu):

$ mzn-bench check-solutions -c 0 results
=========================================================================================== test session starts ===========================================================================================
platform linux -- Python 3.10.6, pytest-6.2.5, py-1.11.0, pluggy-1.2.0
rootdir: /home/ptalbot/repositories/lattice-land/turbo/benchmarks
collected 0 items / 1 error                                                                                                                                                                               

================================================================================================= ERRORS ==================================================================================================
______________________________________________________________________________________ ERROR collecting test session ______________________________________________________________________________________
../../../../.local/lib/python3.10/site-packages/pluggy/_hooks.py:433: in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
../../../../.local/lib/python3.10/site-packages/pluggy/_manager.py:112: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../../../mzn-bench/src/mzn_bench/pytest/check_solutions.py:141: in pytest_collect_file
    return SolFile.from_parent(
E   TypeError: FSCollector.from_parent() missing 1 required keyword-only argument: 'fspath'
========================================================================================= short test summary info =========================================================================================
ERROR  - TypeError: FSCollector.from_parent() missing 1 required keyword-only argument: 'fspath'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================================ 1 error in 0.08s =============================================================================================
hbierlee commented 1 year ago

Hi @ptal,

I changed this to be path=Path(..) as fspath gives a deprecation warning in pytest 7.4.0, but apparently path is unsupported in pytest 6. @Dekker1 is adding pytest 7 to the dependencies which should fix it!

Cheers,

Henk