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

happy-kitchen-89482

03/03/2023, 4:49 PM
python_tool_base.py has this comment:
Copy code
# If this tool does not mix with user requirements (e.g. Flake8 and Isort, but not Pylint and
    # Pytest), you should set this to True.
    # ...
    register_lockfile: ClassVar[bool] = False
However, all four of those tools have
register_lockfile = True
. In fact, every single tool that subclasses PythonToolRequirementsBase or PythonToolBase has
register_lockfile = True
now
Does anyone remember what that comment was getting at originally?
Possibly @hundreds-father-404?
It looks like we have zero tools that don't register a lockfile, so possibly the default should be to register one?
a

ancient-vegetable-10556

03/03/2023, 5:45 PM
@happy-kitchen-89482 don’t hold me to it, but I believe this was a transitional thing as we introduced lockfiles, possibly for making sure we didn’t break plugins. We may want to consider deprecating the field
Eric left an excellent PR discussion when
register_lockfile = True
was added to the PyTest subsystem. Just looks like the comment you found was not deleted.
h

happy-kitchen-89482

03/03/2023, 6:00 PM
Cool!
a

ancient-vegetable-10556

03/03/2023, 6:01 PM
@happy-kitchen-89482 If you want to sneak a deprecation for
register_lockfile = False
into 2.16, I’d approve it 🤣
h

happy-kitchen-89482

03/03/2023, 6:02 PM
I might start by setting it to True by default
a

ancient-vegetable-10556

03/03/2023, 6:03 PM
With an updated plugin upgrade guide, sure!
b

bitter-ability-32190

03/03/2023, 6:34 PM
It should be true by default AND every pants-provided tool should not be able to turn it off IMHO
a

ancient-vegetable-10556

03/03/2023, 6:35 PM
Yeah, definitely no good reason for anything in pants core to turn it off any more.
It’s really just how much we care about foisting it on plugin developers at this point (probably not much)
b

bitter-ability-32190

03/03/2023, 6:41 PM
Yeah I can see plugin developers not wanting to bother. But maybe they should bother... I'm off the mind we should force plugin authors to do the right thing when we can because 9/10 times the engineers in the codebase can't/won't discern in repo plugins from pants ones. It's all "pants" to them
h

hundreds-father-404

03/03/2023, 7:10 PM
Thanks for finding that Chris. And thanks Benjy for all this cleanup 🙂 Exciting
h

happy-kitchen-89482

03/03/2023, 11:30 PM
Well, if someone really wants a Python tool that doesn't involve a lockfile they can implement one from first principles pretty easily. PythonToolBase is a convenience we provide, and we can declare by fiat that the thing it is a convenience for is a lockfile.
👍 1
Without that it does very little lifting
2 Views