https://pantsbuild.org/ logo
#development
Title
# development
f

fast-nail-55400

09/16/2021, 4:40 AM
What is the current procedure for adding a dependency to Pants? context: I added a requirement to
3rdparty/python/requirements.txt
and ran `build-support/bin/generate_all_lockfiles.sh`but
3rdparty/python/lockfiles/user_reqs.txt
is not updated with the dependency.
h

hundreds-father-404

09/16/2021, 5:04 AM
it needs to also be used somewhere to be picked up
https://github.com/pantsbuild/pants/issues/12848 is another way you could force it to be included, but WIP
f

fast-nail-55400

09/16/2021, 5:04 AM
h

hundreds-father-404

09/16/2021, 5:04 AM
ah it needs module_mapping
f

fast-nail-55400

09/16/2021, 5:05 AM
gah
h

hundreds-father-404

09/16/2021, 5:06 AM
but @fast-nail-55400 it would be better to use PythonToolBase to build a Pex with that. That means that you don't have to build this when installing Pants every time, and it allows the user to set up a lockfile and change the version over time
f

fast-nail-55400

09/16/2021, 5:07 AM
This is an internal impl detail of the Terraform plugin.
not a tool that we are exposing to the user
like “black” and “pylint”
but not installing it except when the plugin is configured is useful
1
h

hundreds-father-404

09/16/2021, 5:16 AM
Especially given that CI often needs to bootstrap Pants, so every dep we add slows down users' CI
f

fast-nail-55400

09/16/2021, 5:41 AM
any examples of how I run a script in the context of a PythonToolbase pex?
the examples I see all invoke a
ConsoleScript
provided by one of the module in the pex
h

hundreds-father-404

09/16/2021, 5:46 AM
See lockfile.py for a script that imports poetry