-
Notifications
You must be signed in to change notification settings - Fork 764
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
Globs in extra paths #5364
Comments
we just converted this back to an issue to add it to our roadmap |
Any ETA on this? |
As has been explained in other threads, I don't think it will work to add globs for extraPaths. The problem is that extraPaths is order dependent. The order affects import resolution behavior. Globs is an order-independent mechanism. If you want to add extra paths to your project, you should specify them one at a time in the order you intend for imports to be resolved. |
We could make it deterministic by saying globs resolve alphabetically. |
We have given up on using Bazel and I work on very different things since I requested it 3 years ago, I'm not even using Pylance anymore. Maybe someone currently experiencing this issue could provide more detail. I can only repeat what I already said in the other thread: #2712 (comment) |
Bazel puts each Python dependency in its own directory for sandboxing reasons. Our extraPaths is 601 lines long, and we have to manually update it when our Python dependency tree changes. Here's a small snippet so you can see what it looks like:
It's that for 600 packages. Instead if we could do something like Thanks! |
@adzenith a few questions.
I am not sure we want to support |
I don't need a glob specifically; I just assumed that would be the easiest to implement. If Bazel's output tree if directly supported that would also suit my needs just fine. |
Hi all. I just want to share this discussion from 2022 that also touched on this topic of glob support for bazel / repos with multiple subpackages, see #2923 (comment) |
Discussed in #2712
Originally posted by itsdani February 21, 2021
I'm trying to setup a python monorepo build with bazel, and I'm struggling to make pylance recognize the library imports. I have managed to make it work by adding e.g.
<bazel-myproject>/external/<my-pip-dependencies>/pypi__numpy
topython.analysis.extraPaths
, but adding a line for each dependency on every computer we use doesn't seem to be right.My idea/request is that if we could add something like
dependencies/*/
ordependencies/pypi__*/
to the extra paths, it would solve this problem entirely. The expected behavior would be to add every (matching) directory underdependencies/
to the extra paths.The text was updated successfully, but these errors were encountered: