Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
CodexVeritas opened this issue Aug 24, 2024 · 2 comments

Comments

@CodexVeritas
Copy link

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
Copy link
Contributor

This was fixed in this PR:
#453

I will cut a patch release in a few minutes.

@davidvonthenen
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants