Closed StefaanD closed 2 years ago
Thanks for the issue. Having a look.
Hi @StefaanD , it seems that you have not installed the dependencies in the requirements.txt
file.
You should run pip install -r requirements.txt
before running the tests.
Perhaps this instruction should be added to the README.md
to make it more clear?
I have tested in a new environment and everything seems to pass on my end.
Hope that helps!
Missed that requirements.txt file.
I'm actually trying this on a Mac (macOS Catalina 10.15.7)
After doing a pip install -r requirements.txt
I get the following output
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. daal4py 2021.3.0 requires daal==2021.2.3, which is not installed. conda-repo-cli 1.0.4 requires pathlib, which is not installed. anaconda-project 0.10.1 requires ruamel-yaml, which is not installed. numba 0.54.1 requires numpy<1.21,>=1.17, but you have numpy 1.21.2 which is incompatible.
i was able to install daal==2021.2.3, pathlib and ruamel-yaml but not sure how to downgrade numpy to 1.21 or below.
when I run py.test in the current state I get the following output
`================================================= test session starts ================================================== platform darwin -- Python 3.9.7, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 rootdir: /Users/admin/Documents/GitHub/FirstCyclingAPI plugins: anyio-2.2.0 collected 6 items
tests/test_race.py .. [ 33%] tests/test_ranking.py ... [ 83%] tests/test_rider.py . [100%]
=================================================== warnings summary =================================================== ../../../opt/anaconda3/lib/python3.9/site-packages/boto/plugin.py:40 /Users/admin/opt/anaconda3/lib/python3.9/site-packages/boto/plugin.py:40: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp
-- Docs: https://docs.pytest.org/en/stable/warnings.html ============================================= 6 passed, 1 warning in 2.28s =============================================`
Well the tests worked so something is going right!
This dependency stuff is a bit above my head. The package versions are not crucial for first_cycling_api
to work. I'm not sure how to get rid of that warning without doing some googling. It seems to be related to anaconda3
on your end.
Considering the test output above, I'm assuming we can close this issue. @StefaanD if not, feel free to re-open.
When I run py.test in the root directory I get the following result.
Python version is 3.9.7
================================================= test session starts ================================================== platform darwin -- Python 3.9.7, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 rootdir: /Users/admin/Documents/GitHub/FirstCyclingAPI plugins: anyio-2.2.0 collected 0 items / 3 errors
======================================================== ERRORS ======================================================== _ ERROR collecting tests/test_race.py __ ImportError while importing test module '/Users/admin/Documents/GitHub/FirstCyclingAPI/tests/test_race.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: ../../../opt/anaconda3/lib/python3.9/importlib/init.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_race.py:1: in
from first_cycling_api import Race, RaceEdition
first_cycling_api/init.py:8: in
from .rider import Rider
first_cycling_api/rider/init.py:23: in
from .rider import Rider
first_cycling_api/rider/rider.py:3: in
from ..api import fc
first_cycling_api/api.py:8: in
from slumber import API
E ModuleNotFoundError: No module named 'slumber'
____ ERROR collecting tests/test_ranking.py ____
ImportError while importing test module '/Users/admin/Documents/GitHub/FirstCyclingAPI/tests/test_ranking.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../opt/anaconda3/lib/python3.9/importlib/init.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_ranking.py:1: in
from first_cycling_api import Ranking
first_cycling_api/init.py:8: in
from .rider import Rider
first_cycling_api/rider/init.py:23: in
from .rider import Rider
first_cycling_api/rider/rider.py:3: in
from ..api import fc
first_cyclingapi/api.py:8: in
from slumber import API
E ModuleNotFoundError: No module named 'slumber'
____ ERROR collecting tests/testrider.py ____
ImportError while importing test module '/Users/admin/Documents/GitHub/FirstCyclingAPI/tests/test_rider.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../opt/anaconda3/lib/python3.9/importlib/init.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_rider.py:1: in
from first_cycling_api import Rider
first_cycling_api/init.py:8: in
from .rider import Rider
first_cycling_api/rider/init.py:23: in
from .rider import Rider
first_cycling_api/rider/rider.py:3: in
from ..api import fc
first_cycling_api/api.py:8: in
from slumber import API
E ModuleNotFoundError: No module named 'slumber'
=============================================== short test summary info ================================================
ERROR tests/test_race.py
ERROR tests/test_ranking.py
ERROR tests/test_rider.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================== 3 errors in 15.89s ==================================================