hundreds-father-404
02/01/2022, 2:07 AM./pants repl
is frustrating that it's hardcoded to default to python
, even if you do ./pants repl jvm ::
hundreds-father-404
02/01/2022, 2:08 AMrepl --shell=<alterantive>
to change the valuefast-nail-55400
02/01/2022, 2:08 AMfast-nail-55400
02/01/2022, 2:09 AMfast-nail-55400
02/01/2022, 2:09 AMhundreds-father-404
02/01/2022, 2:09 AM./pants repl ::
would assume you want Python and ignore the Scala targets
Maybe log a warning for how you can get it to choose Scala insteadhundreds-father-404
02/01/2022, 2:11 AMalthough scala and ammonite would both claim the same targetsYes so there is a related question: how do we choose which REPL of multiple to use for the language. I think that should get set in your config. So, 1. A user sets up their preferences: IPython > Python, Ammonite > Scala 2. Pants uses those + inspects the "root" targets to infer which REPL you wanted to use You can ignore both those things by explicitly setting
repl --shell=ammonite
hundreds-father-404
02/01/2022, 2:11 AM--shell
would now default to something like --shell=<infer>
hundreds-father-404
02/01/2022, 2:13 AMus simply inspecting the "root" targets and choosing based on what is the most common target type?This scheme biases file-based languages (Python, Scala) over directory-based languages (Go). Maybe we can do something like based on # of directories involved to make it apples-to-apples
fast-nail-55400
02/01/2022, 2:27 AMfast-nail-55400
02/01/2022, 2:27 AMhundreds-father-404
02/01/2022, 2:30 AM./pants filter
. See https://github.com/pantsbuild/pants/issues/14295, that's what we plan to do with multiple resolves
I think it's maybe friendlier to assume what you want with a warning and instructions for how to get the other thing. But unclear to mehundreds-father-404
02/01/2022, 2:31 AMI think it's maybe friendlier to assume what you want with a warning and instructions for how to get the other thingI'm thinking that because if I do
./pants repl src/python::
in Pants, it's pretty obvious to me as a human that I want to open a Python REPL. But we technically have a few JVM and Scala targets there! I would be annoyed if that caused the command to fail