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

Create a clean python setup for subpackages #258

Open
Daraan opened this issue Sep 17, 2024 · 0 comments
Open

Create a clean python setup for subpackages #258

Daraan opened this issue Sep 17, 2024 · 0 comments

Comments

@Daraan
Copy link

Daraan commented Sep 17, 2024

When importing the library all subpackages are added to sys.modules as top-hierarchy packages/modules which creates ambigious imports.
If I would have my own module/package named like any of the supackages the import order becomes important.

# file 1
import world  # imports my module, or the expected one from sys.path
import ad_rss
# file 2
import ad_rss
import world  # This is ad_rss.rss.world which is unexpected

sys.modules["core"], sys.modules["world"], sys.modules["unstructured"], ... these all should be appropriate subpackages of ad_rss and not their own package, e.g. sys.modules[ad_rss.rss.core]`

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

1 participant