jolly-midnight-72759
10/28/2020, 2:29 AMsys.path
. @hundreds-father-404 has pointed me to PEX_EXTRA_SYS_PATH
but the way it is implemented in pants.backend.python.goals.repl
I am not sure how it gets to pants.core.goals.repl
. The relevant goal (create_ipython_repl_request
) is only found in the latter and not the former which my plugin is templated from.jolly-midnight-72759
10/28/2020, 2:30 AMjolly-midnight-72759
10/28/2020, 2:31 AMPEX_EXTRA_SYS_PATH
so my targets get added to the sys.path
as happens when one runs pants repl :target
?jolly-midnight-72759
10/28/2020, 2:42 AMcreate_ipython_repl_request
a goal that the pants engine does something with? So if I start with the following input -> output rules [PythonRepl
, PexEnvironment
-> ReplRequest
] then the engine will magically implement the logic within create_ipython_repl_request
?jolly-midnight-72759
10/28/2020, 2:43 AMsys.path
within my current goal or should I make a new goal?jolly-midnight-72759
10/28/2020, 2:44 AMcreate_python_repl_request
so I can simplify my plugin?hundreds-father-404
10/29/2020, 4:29 AMPEX_EXTRA_SYS_PATH
is more a question of how things are factored, and less how the logic works. It’s similar to normal programming, that you could inline everything into one huge main()
block; or you can factor out helper functions to make things more readable and reduce duplication.
The important part is setting PEX_EXTRA_SYS_PATH
in the env
var for your InteractiveProcess
object, wherever that is being created, regardless of if it’s in a @goal_rule
or some helper rule.