open-feature / python-sdk-contrib

Community contributions for hooks and reference providers in python
https://openfeature.dev
11 stars 11 forks source link

make test fails #25

Closed agardnerIT closed 1 year ago

agardnerIT commented 1 year ago
$ make test
. venv/bin/activate; pytest tests/
========================================================================================================================================= test session starts ==========================================================================================================================================
platform linux -- Python 3.10.8, pytest-7.4.2, pluggy-1.3.0
rootdir: /workspaces/python-sdk-contrib
plugins: anyio-4.0.0
collected 5 items / 1 error                                                                                                                                                                                                                                                                            

================================================================================================================================================ ERRORS ================================================================================================================================================
______________________________________________________________________________________________________________________________ ERROR collecting tests/hooks/test_otel.py _______________________________________________________________________________________________________________________________
ImportError while importing test module '/workspaces/python-sdk-contrib/tests/hooks/test_otel.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/python/3.10.8/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/hooks/test_otel.py:4: in <module>
    from openfeature.contrib.hooks.otel import TracingHook
openfeature/contrib/hooks/otel.py:5: in <module>
    from opentelemetry import trace
E   ModuleNotFoundError: No module named 'opentelemetry'
======================================================================================================================================= short test summary info ========================================================================================================================================
ERROR tests/hooks/test_otel.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=========================================================================================================================================== 1 error in 0.17s ===========================================================================================================================================
make: *** [Makefile:32: test] Error 2
beeme1mr commented 1 year ago

@federicobond, would you be able to take a look at this?

federicobond commented 1 year ago

Thanks for reporting @agardnerIT. Yes, it looks for the opentelemetry dependency in the requirements.txt which is not hooked to the makefile.

I believe we have discussed this before, but the current scheme for managing dependencies is needlessly complicated. We can get by with a single requirements.txt with pinned versions which is updated regularly via renovate. I will submit a pull request with a proposal to simplify dependency management.