-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
python_distribution plugin conflicts with pants publish --changed-since
#19509
Comments
@benjyw any thoughts on this one? 🙏 |
Hey @idan-at, this is a tricky one. Sounds like we need a proper API for generating versions, that knows which files in the closure of a given target have change. I.e., to separate "generating setup.py" from "publishing". |
Indeed sounds complex. Is there anything I can do to push this effort? |
A helpful thing would be to come up with a suggestion for what you think the API should look like - since you already have a plugin that needs to generate versions, you are in a good position to suggest a useful design. |
WDYT about adding a new option for For example, if A depends on B which depends on C, and B changes, using the new flag will run the command on A,B,C. |
Hmm, I think it's more like we need to calculate the version in a separate pass than the full publish, no? You'd need to do that regardless of what you publish. |
Yeah that will help, but from my understanding, that's a deep change to how publish currently works, making it less likely to happen 😅 |
Can you elaborate on how |
Yes. Some background about the plugin: Now, if A uses B and only A changes, but a version request is also sent to the plugin for B, then B's version will also be bumped (the plugin can't tell if B changed or not, so it can't tell if it needs to return the version from the latest git tag, or to rely on it to return the next one). If we'll provide the |
Oh I see, so you'd actually publish more than you do today, or really have to (you'd publish A and B, when really you only need to publish A) just so that the versions line up? |
Exactly (but it’s still better than publishing all the repository packages) |
I'd be leery of baking that into Pants, I feel like this requires a better solution. But as a workaround I think you can get this behavior with no modifications to Pants, using |
Oh wait, no, that gives the dependents, you want the dependencies. So you'd need a more complicated query. |
You might have to dump your build graph using |
Describe the bug
Assuming X is being published, and X depends on Y,
pants publish
will also runpackage
, for both X & Y.Pants does not provide any context to plugins, so its impossible for a plugin running for Y, in charge of calculating its version, to know which version to provide.
Pants version
2.16.0
OS
Both
Additional info
I'm managing a Python monorepo with Pants. As part of my CI flow, I'm running:
I also have a custom plugin that calculates the next version based on existing git tags (it also pushes the tag).
Assuming X changed, and X uses Y, in order to generate
setup.py
for X, pants packages Y for its version.Because the plugin assumes it is invoked for changed packages only, it returns the next version of Y, which never gets published.
Slack thread
Somewhat Related issues: #18179, #16360
The text was updated successfully, but these errors were encountered: