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

Running export for specific Python tools (or lockfiles) only #17398

Closed
achimnol opened this issue Oct 29, 2022 · 2 comments · Fixed by #17416
Closed

Running export for specific Python tools (or lockfiles) only #17398

achimnol opened this issue Oct 29, 2022 · 2 comments · Fixed by #17416

Comments

@achimnol
Copy link

achimnol commented Oct 29, 2022

Is your feature request related to a problem? Please describe.
Sometimes I modify requirements for a specific Python tool, but I need to re-export all of the virtualenvs including other Python tools and the default one (python-default).
It takes quite some time.

Describe the solution you'd like
I'd like to re-run ./pants export for a specific lockfile only.
(e.g., ./pants export --resolve=flake8,mypy)

@benjyw
Copy link
Contributor

benjyw commented Oct 30, 2022

Funny, I am working on exactly this right now!

@benjyw
Copy link
Contributor

benjyw commented Nov 1, 2022

#17416

benjyw added a commit that referenced this issue Nov 3, 2022
Currently, export takes cmd-line specs, so the python export implementation, which
exports virtualenvs, exports the requirements of those targets. 

This has a couple of issues:

A) User intent is almost certainly that export should emit the entire lockfile, whereas we will omit anything
  that isn't actively depended on by some target in the specs (which could be the case even with `::`).
B) Tools don't relate to specs, so we export every tool every time, no matter the specs, which is obviously clunky.

This change re-envisions how export should work. Instead of passing specs, you pass the `--resolve` flag one or more times, and we export a venv for each resolve, whether it's a user resolve or a tool resolve. 

The old codepath still works, but we can consider deprecating it in a followup.

Closes #17398
benjyw added a commit to benjyw/pants that referenced this issue Nov 3, 2022
Currently, export takes cmd-line specs, so the python export implementation, which
exports virtualenvs, exports the requirements of those targets. 

This has a couple of issues:

A) User intent is almost certainly that export should emit the entire lockfile, whereas we will omit anything
  that isn't actively depended on by some target in the specs (which could be the case even with `::`).
B) Tools don't relate to specs, so we export every tool every time, no matter the specs, which is obviously clunky.

This change re-envisions how export should work. Instead of passing specs, you pass the `--resolve` flag one or more times, and we export a venv for each resolve, whether it's a user resolve or a tool resolve. 

The old codepath still works, but we can consider deprecating it in a followup.

Closes pantsbuild#17398
benjyw added a commit that referenced this issue Nov 4, 2022
…17416) (#17461)

Currently, export takes cmd-line specs, so the python export implementation, which
exports virtualenvs, exports the requirements of those targets. 

This has a couple of issues:

A) User intent is almost certainly that export should emit the entire lockfile, whereas we will omit anything
  that isn't actively depended on by some target in the specs (which could be the case even with `::`).
B) Tools don't relate to specs, so we export every tool every time, no matter the specs, which is obviously clunky.

This change re-envisions how export should work. Instead of passing specs, you pass the `--resolve` flag one or more times, and we export a venv for each resolve, whether it's a user resolve or a tool resolve. 

The old codepath still works, but we can consider deprecating it in a followup.

Closes #17398
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants