deepgram / deepgram-python-sdk

Official Python SDK for Deepgram's automated speech recognition APIs.
https://developers.deepgram.com
MIT License
239 stars 63 forks source link

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

Closed CodexVeritas closed 2 months ago

CodexVeritas commented 2 months ago

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.

davidvonthenen commented 2 months ago

This was fixed in this PR: https://github.com/deepgram/deepgram-python-sdk/pull/453

I will cut a patch release in a few minutes.

davidvonthenen commented 2 months ago

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