important-psychiatrist-3923010/03/2022, 11:14 PM
to help generate structured json based logs. However, during development those logs are effectively useless. In general this is fine because I can vary the configuration to output easy to parse logs when you're in running locally. However, to get some extra high quality formatting in development we need to have an extra library available:
work and load up rich into the dev time pex file, I've had to add this to one fo the build files
This now works fine when running locally. However, that library has -zero- reason to exist in our hosted environments, but it will continue to be part of the pex file given the above configuration. Is there a lever to manage this that doesn't lead to significant overhead and duplication?
python_sources( dependencies=['//:deps#rich'] )
bitter-ability-3219010/04/2022, 12:52 AM
important-psychiatrist-3923010/04/2022, 2:58 AM
but when I do
that dependency has no value and just chews up space.
enough-analyst-5443410/04/2022, 3:27 AM
" callout box there given his response on another of your threads. In other words, apply transitive excludes to `pex_binary`targets to rid production of things like '//deps#rich' not needed there.
important-psychiatrist-3923010/04/2022, 4:08 PM
bitter-ability-3219010/04/2022, 4:30 PM
gotcha. Yeah I guess that'd work but that means my dev run commands couldn't use the same target as prod doesThey already will in a way. In Pants you can run the source file
which is faster than running the
./pants run path/to/file.py
. Prod will be using the
, whereas devs can chose but usually prefer the speed of running the source. So it's a good natural seam to have the
targets transitively exclude the dev dep and add the prod dep. At least, that;s my experience.
. Anything else is a Pants bug IMO
important-psychiatrist-3923010/04/2022, 4:37 PM
and it starts the dev server, there's no knowledge of how it's running needed. While that domain expertise isn't a Bad Thing ™️, it will result in a more weaker development experience. 😕
bitter-ability-3219010/04/2022, 4:39 PM
important-psychiatrist-3923010/04/2022, 5:00 PM
enough-analyst-5443410/04/2022, 5:04 PM
bitter-ability-3219010/04/2022, 5:30 PM
extensively at my last gig. I think in a few dimensions its just a fundamentally different way of doing things 😕 Poetry (and even tox if configured) makes a venv with everything in it, whereas Pants is "nothing more than exactly what is specified (implictly or explicitly)". That being said, I can see a world where
exists as a field. I think the logical hurdle is just how to know when it should be considered or ignored.
python_source( ..., dependencies=[...], dev_dependencies=[...], )
represents "prod" (E.g. ignore dev deps) and
./pants run/package/etc... path/to/target
would mix those in.
./pants --dev-deps run/package/etc... path/to/target
important-psychiatrist-3923010/04/2022, 5:32 PM
goal, which is more in line to how a lot of ecosystems think of it.
bitter-ability-3219010/04/2022, 5:33 PM