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_intermediate_modules should take pkg origin into account #459

Closed
edublancas opened this issue Dec 29, 2021 · 1 comment
Closed

create_intermediate_modules should take pkg origin into account #459

edublancas opened this issue Dec 29, 2021 · 1 comment

Comments

@edublancas
Copy link
Contributor

I just realized that create_intermediate_modules creates the intermediate modules in the current directory, but this isn't always the case.

If the user modified the PYTHONPATH, or installed a package with pip install --editable ., the pkg may be in a different location.

To solve this, we can use find_spec, and pass the first element. e.g., if source_parts is a.b.c, use find_spec('a').origin to get the location of module a, and use this a prefix to create the intermediate files. If a, does not exist, then it's fine to create it in the current working directory

@edublancas
Copy link
Contributor Author

cc @fferegrino

edublancas added a commit that referenced this issue Jan 15, 2022
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