Skip to content

Offer a "add to requirements.txt" code action when package is installed #21786

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

Closed
luabud opened this issue Aug 8, 2023 · 6 comments
Closed
Labels
area-environments Features relating to handling interpreter environments feature-request Request for new features or functionality

Comments

@luabud
Copy link
Member

luabud commented Aug 8, 2023

This is another idea which would be a precursor to #21555 is to offer a code action to add a missing dependency (probably matching an allow list) to requirements.txt.

@luabud luabud added feature-request Request for new features or functionality needs community feedback Awaiting community feedback area-environments Features relating to handling interpreter environments labels Aug 8, 2023
@github-actions
Copy link

github-actions bot commented Aug 8, 2023

Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.

@luabud
Copy link
Member Author

luabud commented Aug 8, 2023

cc @karthiknadig @cwebster-99

@karthiknadig
Copy link
Member

What do you mean by Code Action in this context? It will depend on where they initiate the install, from a terminal or from python code in the editor.

In the terminal: I think we will need problem matcher for this that detects missing module first, then we could provide an action on that problem.

In code: if pylance is already initiating the install, then this could be something pylance can already handle?

@jongio
Copy link

jongio commented Aug 8, 2023

This is the context of where I'd like to add a missing dependency to requirements.txt
image

@karthiknadig
Copy link
Member

Adding an item to requirement.txt has some limitations. If the requirement.txt was built using some tool like pip-tools or has hashes then we can't add it to requirements. If it is plain requirements.txt then we could add it.

Another thing is what happens when there are dev-requirement.txt or test-requirement.txt or if there is a requirements directory with *.txt under it. There is probably some UI flow that is needed to handle these.

@brettcannon
Copy link
Member

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.

@brettcannon brettcannon closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2023
@github-actions github-actions bot removed the needs community feedback Awaiting community feedback label Oct 19, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-environments Features relating to handling interpreter environments feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants