Skip to content
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

Investigate a potential opinionated package management workflow #21627

Open
cwebster-99 opened this issue Jul 13, 2023 · 4 comments
Open

Investigate a potential opinionated package management workflow #21627

cwebster-99 opened this issue Jul 13, 2023 · 4 comments
Assignees
Labels
feature-request Request for new features or functionality needs proposal Need to make some design decisions

Comments

@cwebster-99
Copy link
Member

cwebster-99 commented Jul 13, 2023

The Python extension in VS Code is investigating ways to improve our package management support tailored towards beginners with the option for extensibility for your preferred package manager tools via extensions.

Goals

Propose and implement an opinionated workflow as part of the Python extension for VS Code to:

  • Support beginners who are working with Python packages and virtual environments.
  • Streamline the package management story with the environment creation story.
  • Allow third-party package management extensions to integrate into the workflow to provide their own support

Proposal:

An opinionated workflow (ie. commands) that will integrate with the Python: Create Environment command in order to streamline environment creation and package management in the Python extension.

CLI command coverage we want to match in our opinionated workflow:

  • Create/update a dependency file
  • Read, resolve, and install dependencies from a file
  • Update dependencies
  • Remove a package
  • Add a package (and update the dependency file)
  • Create environment ✅
  • Run code ✅

Where and how to document dependencies:
Default should be to write to a requirements.txt file, including the package version that was installed. Opting to write the version, by default, supports the users' need for reproducibility and ease of collaborating on work. Given the nature of the work done by the target audience and our target usage, a pyproject.toml is out of scope as the target user typically does not build their project nor is there a direct way to only install dependencies listed in a pyproject.toml file.

@cwebster-99 cwebster-99 added feature-request Request for new features or functionality needs proposal Need to make some design decisions labels Jul 13, 2023
@cwebster-99 cwebster-99 self-assigned this Jul 13, 2023
@rchiodo
Copy link

rchiodo commented Jul 17, 2023

Will there be a way for other extensions to use this facility? Maybe just through a command or something like that with looser coupling would be fine.

We'd need to :

  • Know that the current environment is supported (or opinionated I guess)
  • Send 'install this package' commands to the environment

@ksandvik
Copy link

ksandvik commented Jul 20, 2023

VSCode commands + cli tool similar to the code cli tool me thinks would be ideal.

@cwebster-99
Copy link
Member Author

cwebster-99 commented Aug 22, 2023

Will there be a way for other extensions to use this facility? Maybe just through a command or something like that with looser coupling would be fine.

If I am understanding your comment correctly, yes, we have discussed the idea that we would allow other package management extensions to plug into the opinionated workflow but use their own commands. Need more investigation to see how this could be implemented and its integration story.

@rootsmusic
Copy link

rootsmusic commented Aug 23, 2023

Courtney, I'm this issue's target user (as described in in your blog post). Usually I use conda, unless I have to use pip CLI.

My most frustrating experience is resolving package errors in an environment. Sometimes, an environment says that it has inconsistencies and conda doctor can troubleshoot which packages are inconsistent. Other times, importing a package raises an error because that package's requirements.txt (hopefully available) conflicts with my environment. When that package shares dependencies with another package in my environment, this error can occur if one package didn't update the versions of its dependencies in its requirements.txt while the other package has done so. But which dependency is causing the error (when my environment has updated multiple dependencies of that package) isn't easily identifiable from the error's traceback, like #21456.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality needs proposal Need to make some design decisions
Projects
None yet
Development

No branches or pull requests

4 participants