Open a-teammate opened 2 years ago
Thanks, @a-teammate ! I agree this would be really great to have.
Generally, we believe we shouldn't rely on people reading the docs. While we hope folks do, realistically, for most Pants users Pants is just another tool they use. So, we want Pants's UX to be intuitive enough you can mostly figure it out without needing docs, e.g. good error messages.
We don't currently have any precedent for "catching" exceptions and inserting our own suggestions. Although I'd like to get there.
When I transfer old code to have its dependencies resolved via pants, at some point I likely get
ImportError: could not resolve some.package.in.our.monorepo.or.thirdparty.package
. This seems to be a normal part of using pants for dependency management, until I arrive at the point that pants has enough information to resolve all dependencies.But currently I am left alone and need to understand the internals of pants and some advanced usage tricks to get further. I would love to see some first level support for this use-case, for beginner users. When my coworkers will need to do the same, I don't want to tell them "ah yeah, you need to set these 4 flags and then open the sandbox and maybe with some luck and inspecting that start command, you'll find out what you should have actually imported instead of the name you referenced in your python file".
Solution
Generally it would be beneficial from my perspective to focus this use-case in the pants development a little more, if that is not the case yet: The scenario "a beginner user wants to use pants for dependencies and their build. They have an import error and need to fix it in order to successfully build with pants." might be checked from time-to-time with a beginner user to continuously make this easier for them. Maybe this is already done.
Concrete proposal:
Given the user wants to add a new piece of code, using 3rdparty libs and internal libs
pants test
orpants run
, all "import errors" are caught by pantsExample: