I'm building a python script to format files not t...
# general
i
I'm building a python script to format files not tracked by pants (rogue python scripts, markdown, html, json, yaml, etc.) and was wondering if the
requirements.txt
file will install a dependency in CI to give my script access to it from the shell. Now, I could just load
black
as a module but I'd rather have all commands for
black
,
prettier
,
scalafmt
, and any other formatters to be handled the same exact way (subprocess.run). Will
black
be available from the shell w/ the requirements.txt file specifying
black
as a dep?
h
Hi Ken! You'd need to install your
requirements.txt
independently of Pants, like directly creating a virtual environment and doing
pip install -r reqs.txt
. When Pants installs dependencies, it does so in a sandbox and it is not exposed to the general system
i
Thx! This was my concern.
h
Alternatively, Pants 2.9 added
./pants export
which will create a virtual environment of your
constraints.txt
if you're using
[python].requirement_constraints
i
interesting. I'll give that a look.