Skip to content

Support wildcard and array options for python.venvPath setting #24369

Closed as not planned

Description

@artsiommiksiuk

Following the trail of this issue: #1019, I'd like to request venvPath to support array of paths and wildcards in them.

My use case touches monorepos and as part of monorepo (poly language repo), each project may have one or even many venvs created. Workaround I'm using for now is creating named venvs in the root, which isn't ideal of course, but seems to be do the trick.

Having an ability to have venvs co located with actual projects will remove this artificial limitation. Thus, expected format would be something as discussed in the ticket attached, where we just rename the venvPath to become venvPaths (plural):

"python.venvPaths": ["${workspaceFolder}/apps/*"],

Arrays might be beneficial in case of more granular separation in repo, like "public-apps", "internal-apps".

Activity

  1. karthiknadig commented on Oct 31, 2024

    @karthiknadig
    Member

    artsiommiksiuk We have this setting as "python.venvFolders": [] .

    you should be able to pass:

    "python.venvFolders": ["${workspaceFolder}/apps/"]
    

    Give that a try.

  2. artsiommiksiuk commented on Nov 4, 2024

    @artsiommiksiuk
    Author

    Karthik Nadig (@karthiknadig), thanks for the suggestion! It works only for non wildcard paths. E.g. I have several apps in ${workspaceFolder}/apps folder, therefore I need a way to describe them all once, like with wildcard, instead of ${workspaceFolder}/apps/app1, ${workspaceFolder}/apps/app2.

    I think it was also discussed in the ticket I've attached. To sum it up, from both tickets, it would be great to have:

    1. Single venv lookup option, instead of venvFolders and venvPath. Looks like venvFolders is already covering cases of venvPath.
    2. Add wildcards support for venvFolders, so we can specify more complex cases like ${workspaceFolder}/apps/*.
  3. eleanorjboyd commented on Dec 11, 2024

    @eleanorjboyd

    Thank you for submitting your feature request and everyone who considered it! Unfortunately, this issue did not receive enough votes over the allotted time, and so we are closing the issue. PRs are welcome so you can create a PR that fixes this if you are passionate about getting this feature across the finish line. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestRequest for new features or functionalitytriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions