hundreds-father-404
08/24/2021, 5:03 AM[black].lockfile to either <default> (provided by Pants), <none>, or a path to your own file. It defaults to <default>
For supporting multiple user lockfiles, you can set lockfile=path/to/lock.txt on targets like pex_binary, otherwise it defaults to [python-setup].lockfile. You can also set lockfile="<none>" to opt out. I can't decide if it should be lockfile=None or lockfile="<default>" to signal to use the global default...I think the latter for consistency and because it seems like lockfile=None would be confusing that people might think it meant "don't use a lockfile"proud-dentist-22844
08/24/2021, 3:02 PMlockfile=None over lockfile="<none>"
Also, maybe treat it as a bool
lockfile=True use the global default
lockfile=False or lockfile=None opt out of lockfile
lockfile=some/path/file.lock for an explicit lock file
I avoid magic strings wherever I canhundreds-father-404
08/24/2021, 3:06 PMbool | str for tool lockfiles? If False, no lockfile. If True, default lockfile provided by Pants. If str, path to custom lockfileproud-dentist-22844
08/24/2021, 3:34 PMhundreds-father-404
08/24/2021, 3:35 PMancient-vegetable-10556
08/24/2021, 3:38 PM--no-lockfile or --lockfile=blah.lock then sure, but lockfile=True /`lockfile=False` /`--lockfile=blah.txt` feels pretty awkwardancient-vegetable-10556
08/24/2021, 3:40 PMancient-vegetable-10556
08/24/2021, 3:43 PM--[namespace-]no-lockfile for no lockfile
• --[namespace-]default-lockfile for default lockfile (where applicable)
• --[namespace-]lockfile for user-specified lockfileproud-dentist-22844
08/24/2021, 3:45 PMancient-vegetable-10556
08/24/2021, 3:45 PMancient-vegetable-10556
08/24/2021, 3:45 PMproud-dentist-22844
08/24/2021, 3:46 PMno-lockfile=True?hundreds-father-404
08/24/2021, 3:56 PMhundreds-father-404
08/24/2021, 3:56 PMIf we can use
--no-lockfile or --lockfile=blah.lock then sure, but lockfile=True /`lockfile=False` /`--lockfile=blah.txt` feels pretty awkward
Yes, you could on the CLI use --lockfile, --no-lockfile, and --lockfile=blah.txtancient-vegetable-10556
08/24/2021, 3:56 PMwitty-crayon-22786
08/24/2021, 4:20 PMpants.toml with an implicit default resolvewitty-crayon-22786
08/24/2021, 4:20 PMhundreds-father-404
08/24/2021, 4:39 PMwitty-crayon-22786
08/24/2021, 4:41 PMwitty-crayon-22786
08/24/2021, 4:41 PMresolve: str | None with None giving you the default resolve.witty-crayon-22786
08/24/2021, 4:42 PMpants.toml , depending on how it’s modeled.hundreds-father-404
08/24/2021, 4:46 PMwitty-crayon-22786
08/24/2021, 4:46 PMwitty-crayon-22786
08/24/2021, 4:47 PMwitty-crayon-22786
08/24/2021, 4:47 PMhundreds-father-404
08/24/2021, 4:53 PMwitty-crayon-22786
08/24/2021, 4:53 PMhundreds-father-404
08/24/2021, 4:55 PMhappy-kitchen-89482
08/24/2021, 5:00 PMhundreds-father-404
08/24/2021, 5:00 PMhappy-kitchen-89482
08/24/2021, 5:01 PMbool | str as an option typehundreds-father-404
08/24/2021, 5:01 PMpex_binary, python_tests) have an escape hatch to opt out of lockfiles, even if you use them for everything else?witty-crayon-22786
08/24/2021, 5:06 PMhappy-kitchen-89482
08/24/2021, 8:03 PMhappy-kitchen-89482
08/24/2021, 8:03 PMhappy-kitchen-89482
08/24/2021, 8:06 PMhundreds-father-404
08/24/2021, 8:11 PMplatforms and pex_binary we didn't anticipate, where they needed to disable the constraints file for those pex_binary targets. We had no escape hatch except for a global opt out, so we had to cherry-pick a hotfix that always opts you out in that case
At least while multiple user lockfiles are in flux (e.g. w/ Pex generation upcoming), a more granular escape hatch seems like great insurancehappy-kitchen-89482
08/24/2021, 9:09 PMwitty-crayon-22786
08/24/2021, 9:10 PMhundreds-father-404
08/24/2021, 9:10 PM--no-transitive, your lockfile must be valid - you can't just use an empty lockfile
I think "disable lockfiles everywhere" is too coarse if you only want to disable lockfiles for a particularly problematic targethundreds-father-404
08/31/2021, 12:30 AMresolve="data-science" for example
• The field defaults to default, without any <> characters. The resolve's name is simply default, which the user will have set in [python-setup].resolves_to_lockfiles
This leaves open the question of how to model disabling a lockfile, with two options:
1. resolve="<none>"
2. resolve=None
First gives parity with tool lockfiles. Wdyt?hundreds-father-404
08/31/2021, 12:36 AMNone type
Do what's idiomatic over conformity?
--
(update) Yeah, I think resolve=None is the way to go. It's the simplest modeling code-wisewitty-crayon-22786
08/31/2021, 12:52 AMhundreds-father-404
08/31/2021, 1:14 AMresolve field to pex_binary
The main open question for me is how to handle MyPy and Pylint knowing which resolve to use when running on python_library targets. Otherwise, named resolves has solved most of my UX concerns