Invalid option `extra_requirements` when using `ipdb`
Describe the bug
I was following the documentation page on Debugging, and I wanted to use the better debugger ipbd.
I added the lines
[pytest]
extra_requirements.add = ["ipdb"]
as documented there to my pants.toml file. However, when running any command, such as pants version, it fails with:
10:53:59.33 [ERROR] Invalid option 'extra_requirements' under [pytest] in pants.toml
10:53:59.33 [ERROR] Invalid config entries detected. See log for details on which entries to update or remove.
I tried researching a lot about this, and it looks like this entry has been removed. If that is the case, it got left incorrectly in the documentation.
Can you confirm if that is the case? And if so, what is the recommended approach for using ipdb with pants?
Pants version I tested it with versions 2.20.0 and 2.26.0
OS Are you encountering the bug on MacOS, Linux, or both?
I tested in on Ubuntu 20.04.
Additional info
My current workaround to use ipdb is to have a requirements.txt file with ipdb in it, and in my config:
[pytest]
requirements = ["//:requirements"]
Then I run generate-lockfiles and so the line import ipdb; ipdb.set_trace() begins working.
However, it lacks the auto-completion of custom objects, but at least is way better than regular pdb in which not even backspace works.
Ah yes, I guess that documentation is out of date. Thanks for pointing that out.
Your "workaround" is actually the right solution, and is close to correct - you need a lockfile that includes pytest and ipdb, and to point pytest at it using install_from_resolve and requirements.
See https://www.pantsbuild.org/prerelease/docs/python/overview/lockfiles#lockfiles-for-tools