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

Unhandled ModuleNotFoundError when installing without the [poetry] extra #91

Closed
enpaul opened this issue Jun 21, 2023 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@enpaul
Copy link
Owner

enpaul commented Jun 21, 2023

The package explicitly depends on the poetry-core package which uses some trickery to be importable under the poetry.core namespace. This means that the principle import of import poetry works without the poetry package being installed.

This impacts us because we detect weather Poetry is installed based on whether poetry is importable. However, if poetry is not installed but poetry-core is then import poetry works but import poetry.config (or any other module other than poetry.core) fails with a ModuleNotFoundError. A patch can be made to avoid this problem by adding ModuleNotFoundError to the try/except in tox_poetry_installer._poetry, however this may be worth rethinking as part of #2

@enpaul enpaul added the bug Something isn't working label Jun 21, 2023
@enpaul
Copy link
Owner Author

enpaul commented Jun 21, 2023

Nevermind, the try/except for the ImportError will catch this since ModuleNotFoundError is a subclass of ImportError

@enpaul enpaul closed this as completed Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant