Feature Request: Allow list[str] for stubPath setting #2658
Replies: 3 comments 1 reply
-
Thanks for the feature request. This is the first time we've received a request for this use case. This sounds like it might be pretty specific to your situation. This change would impact not only pyright but also pylance and its settings and documentation, so I'm going to transfer the feature request to the pylance project. We'll discuss it there and see if we get signal from other pylance and pyright users that this is something that would be more broadly desired. I'll note that the pyright configuration setting file was loosely modeled after the typescript configuration settings, and typescript does support multiple "typing roots" (the equivalent of type stubs). So there is some precedence for this. |
Beta Was this translation helpful? Give feedback.
-
Moving this issue to discussion as an enhancement request for comments and upvotes. |
Beta Was this translation helpful? Give feedback.
-
Hello, I have a use case in a mono-repo. The root of the repository allows for working with individual packages under a Each package has their own independent dependencies defined in a So in short, I can currently store type stubs for every independent package in a mono-repo's root stubPath = [
"./typings",
"./src/web",
"./src/database"
] |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently the
stubPath
setting takes a string (indicating which directory contains stubs).I'd like to pass a list of strings (indicating which directories contain stubs).
Motivation:
Some of my stubs are automatically generated by computers, and some of my stubs are coded by hand. I'd like to keep these sets of stubs in separate directories.
Describe the solution you'd like
It would be nice to be able to set
stubPath = ["generated", "stubs"]
in mypyproject.toml
file.Additional context
$PYTHONPATH
and$MYPYPATH
, which are comparable tostubPath
, allow multiple directories.Beta Was this translation helpful? Give feedback.
All reactions