flat-zoo-3195209/29/2020, 6:25 PM
output the value of
./pants dependencies --type=3rdparty
hundreds-father-40409/29/2020, 6:32 PM
, you can use either
, which will show you the current value. Or use
./pants help-advanced python-repos
, which will output JSON and you can use something like JQ to parse.
flat-zoo-3195209/29/2020, 6:50 PM
hundreds-father-40409/29/2020, 6:52 PM
i’m trying to script up creating a virtualenv from the deps so my IDE can understand what’s going onVery helpful indeed. See https://www.pantsbuild.org/docs/python-third-party-dependencies#tip-set-up-a-virtual-environment-optional for a starter script
witty-crayon-2278609/29/2020, 7:02 PM
… although the structure doesn’t seem to render the final value directly, so you’d still need some logic.
./pants help-all | jq '.scope_to_help_info["python-repos"].advanced | map(select(.config_key=="indexes")) | ..value_history'
./pants help-all | jq '.scope_to_help_info["python-repos"].advanced | map(select(.config_key=="indexes")) | ..value_history.ranked_values[-1].value'
happy-kitchen-8948209/29/2020, 8:00 PM
flat-zoo-3195209/29/2020, 8:28 PM
but more generally, we should probably expose venv export for IDE and jupyter purposeson this note, is there a good way to export "editable installs" to this venv? i'm trying a BUILD file in the source root and a
target but there might be a better way
witty-crayon-2278609/29/2020, 9:10 PM
nice jq, i would have had no idea how to write thati learned yesterday! heh.
hundreds-father-40409/29/2020, 9:17 PM
is there a good way to export “editable installs” to this venv?You want to create a
for your code, and then have pip install it via an editable install? What’s the motivation? Generally, for an IDE with creating the venv, I’d think you only want your 3rdparty reqs in it, and then have the IDE treat your first-party code like it normally would, rather than loading it via an editable install
flat-zoo-3195209/29/2020, 9:20 PM
hundreds-father-40409/29/2020, 9:20 PM
flat-zoo-3195209/29/2020, 9:21 PM
hundreds-father-40409/29/2020, 9:22 PM
is a source root so that it knows the import
is really from
flat-zoo-3195209/29/2020, 9:23 PM