forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Allow Environment Shims #19132
Copy link
Copy link
Closed as not planned
Labels
area-terminalcommunity askFeature request that the community expressed interest inFeature request that the community expressed interest infeature-requestRequest for new features or functionalityRequest for new features or functionalityinfo-neededIssue requires more information from posterIssue requires more information from posterneeds proposalNeed to make some design decisionsNeed to make some design decisions
Metadata
Metadata
Assignees
Labels
area-terminalcommunity askFeature request that the community expressed interest inFeature request that the community expressed interest infeature-requestRequest for new features or functionalityRequest for new features or functionalityinfo-neededIssue requires more information from posterIssue requires more information from posterneeds proposalNeed to make some design decisionsNeed to make some design decisions
Hi,
There are command line tools that have commands to prepare the shell environment before executing commands. I'm not sure if there's a name for this, but some examples are things like
pipenv run,op run, andasdf env.The main one I'm interested in is 1Password's
op runbecause I'd like to be able to remove the sensitive environment variables I have from my.envfiles in my projects.Here's how you might run a
pipenvPython project outside of VSCode at the moment usingop runHere
pipenv runloads variables found in the projects.envand shims the virtual environmentpythoninto thePATH.op run --then replaces any environment variables with theop://paths with secrets from the password manager (authenticating their access).python main.pyis then executed in this shell environment.I currently can't see a way of integrating this into my vscode workflow. I've tried:
vscode-pythonby putting{"python": "op", "pythonArgs": ["run", "--", "${command:python.interpreterPath}"}Would love to have a way to work around this, either with a different method from above, or from dimming down the sanity checks
vscode-pythondoes on the"python"argument. Or even better first class support for these kind of environment shims, something complimentary to"python.env"and"python.envFile":Could maybe accept a list of commands, if you want to stack environments:
Anyway, quite a niche feature request, I know. But would love to be able to have the ability to do this, and happy to put in the grunt work of implementation, if I can be pointed in the right direction.