deepgram/deepgram-python-sdk

tests directory is a module unto itself causing import errors for any project with a local tests directory

CodexVeritas opened this issue · 2 comments

What is the current behavior?

When you install deepgram-sdk in python, there are two packages created. One importable with from deepgram import ... and one with from tests import ...

deepgram and tests are two folders added under /home/vscode/.local/lib/python3.10/site-packages

In my projects whenever I do from tests.test_ai_models.test_openai.py there is a pytest import error that says that it cannot find test_ai_models under tests. This is because tests redirects to deepgram's package. Its very common for projects to have a dedicated tests directory, so this seems like unwanted behavior.

Steps to reproduce

Run pip install deepgram-sdk.

Please tell us about your environment

I'm using VSCode and a devcontainer. My main operating system is PopOs, but in the dev container its Debian. I'm using Python 3.10.14.

lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm

Other information

I'm 95% sure the problem gets solved if you just remove the init.py from the tests directory.

This was fixed in this PR:
#453

I will cut a patch release in a few minutes.

This should be available in the next few minutes:
https://github.com/deepgram/deepgram-python-sdk/releases/tag/v3.5.1