DLR-RM / rl-baselines3-zoo

A training framework for Stable Baselines3 reinforcement learning agents, with hyperparameter optimization and pre-trained agents included.
https://rl-baselines3-zoo.readthedocs.io
MIT License
2k stars 510 forks source link

[Bug]: TODO: add test dependencies in the `setup.py` #435

Closed power-edge closed 7 months ago

power-edge commented 7 months ago

🐛 Bug

There is a note in the setup.py

TODO: add test dependencies

And some tests will fail based on missing dependencies after install.

To Reproduce

./scripts/run_tests.sh

and to reproduce failed tests

test_benchmark

export N_STEPS=100
export BENCHMARK_DIR=/tmp/benchmark-$(date +%s)
mkdir $BENCHMARK_DIR
python -m rl_zoo3.benchmark -n "${N_STEPS}" --benchmark-dir "${BENCHMARK_DIR}" --test-mode --no-hub

Relevant log output / Error message

04:29:21 (venv) nik@nik-ThinkPad-P1-Gen-2 rl-baselines3-zoo ±|dev ✗|→ python -m pytest --cov-config .coveragerc --cov-report html --cov-report term --cov=. -v -m "not slow" --color=yes
=============================================================================================================================================================================================================================== test session starts ================================================================================================================================================================================================================================
platform linux -- Python 3.10.12, pytest-8.0.1, pluggy-1.4.0 -- /home/nik/code/power-edge/rl-baselines3-zoo/venv/bin/python
cachedir: .pytest_cache
rootdir: /home/nik/code/power-edge/rl-baselines3-zoo
configfile: pyproject.toml
plugins: xdist-3.5.0, env-1.1.3, cov-4.1.0
collected 262 items / 192 deselected / 70 selected                                                                                                                                                                                                                                                                                                                                                                                                                                 

tests/test_callbacks.py::test_raw_stat_callback PASSED                                                                                                                                                                                                                                                                                                                                                                                                                       [  1%]
tests/test_enjoy.py::test_benchmark FAILED
...

# for `test_benchmark` the output is 

ModuleNotFoundError: No module named 'pytablewriter'

System Info

No response

Checklist

araffin commented 7 months ago

ModuleNotFoundError: No module named 'pytablewriter'

That's weird, pytablewriter is listed as dependency

https://github.com/DLR-RM/rl-baselines3-zoo/blob/8cecab429726d7e6aaebd261d26ed8fc23b7d948/setup.py#L37

btw, for the full tests, -r requirements.txt is needed.