Hi. Since upgrading Pants to 2.18.2 (from 2.17.1),...
# general
r
Hi. Since upgrading Pants to 2.18.2 (from 2.17.1), I can no longer export tools like
black
using their default
lockfiles
.
No resolve named black found in [python].resolves.
Do you have any ideas?
c
Exporting tools now requires declaring a resolve. You can follow the steps here for how to do that.
r
Thank you Daniel for the response, but I’m obviously missing something. Pants isn’t shipped with built-in lockfiles for every Python tool it uses? From Pants documentation (black section): > install_from_resolve > If unspecified, and the lockfile option is unset, the tool will be installed using the default lockfile shipped with Pants.
c
Pants does, and running black will use the builtin one. But the
export
goal won't export from it ref. I think there might be a way to access/reference it, but that's a bit hazy.
r
Well, it’s kind of a breaking change, since it worked on 2.17 🙁
But anyway, thanks for the clarification! I guess I’ll just have to create custom resolves for the tools I want to export.
c
I know the frustration of things stopping to work suddenly and with no explanation. We included information on this change in the release notes and in the release blog post, although it's easy for that to get buried in the long list. Is there a better way we could surface those changes? We don't have a comprehensive upgrade guide, would that have helped? What if we could surface this in the
update-build-files
goal?
We also go through several release-candidate versions. Feedback we get from these is valuable, including the upgrade experience. We really appreciate when folks take the RCs out for a spin.
r
Hi @careful-address-89803. We spent an hour or two trying to figure out what was going on when upgrading to 2.18.2. We looked at the doc, but not the release notes (our fault). Something that would surely have helped us would have been the following paragraph from the blog post included in the official Pants documentation (maybe under the export section and/or Lockfiles for tools?). > Note that this means that you can no longer
export
the built-in, default lockfile for a tool, as that is not represented by a named resolve. If you need to export Python tool virtualenvs for consumption outside of Pants, e.g., by an IDE, you must first create a resolve for them. But thanks again for your support, we fixed the issue and continue to enjoy Pants!!
h
Yeah, unfortunately that was a side effect of a very large simplification of the lockfile mechanism, but it is pretty annoying so I may revisit to see if there is a way to restore that behavior.
👍 1
Apologies!
r
No worries! The apologies are all mine.
c
Thanks for the suggestion. I've made a PR to add to our docs in those places (and also fix the section on setting up an IDE 😬): https://github.com/pantsbuild/pantsbuild.org/pull/157
👍 1