octue / django-gcp

Everything required to run Django on GCP (storage, pubsub events, tasks, logging, errors)
Other
21 stars 3 forks source link

Tests failing with uninitialised module error #30

Closed thclark closed 1 month ago

thclark commented 1 year ago

Bug report

What is the current behavior?

Tests run fine locally. When running tests in GitHub Actions, I get the following error:

  Traceback (most recent call last):
    File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/runpy.py", line 188, in _run_module_as_main
      mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
    File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/runpy.py", line 147, in _get_module_details
      return _get_module_details(pkg_main_name, error)
    File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/runpy.py", line 111, in _get_module_details
      __import__(pkg_name)
    File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/virtualenv/__init__.py", line 3, in <module>
      from .run import cli_run, session_via_cli
    File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/virtualenv/run/__init__.py", line 3, in <module>
      import logging
    File "/home/runner/work/django-gcp/django-gcp/django_gcp/logging/__init__.py", line 1, in <module>
      from .error_reporting import GoogleErrorReportingHandler
    File "/home/runner/work/django-gcp/django-gcp/django_gcp/logging/error_reporting.py", line 4, in <module>
      from logging import StreamHandler
  ImportError: cannot import name 'StreamHandler' from partially initialized module 'logging' (most likely due to a circular import) (/home/runner/work/django-gcp/django-gcp/django_gcp/logging/__init__.py)

What is the expected behavior?

Tests should run in CI