<#21757 support first party pytest plugins; such a...
# github-notifications
c
#21757 support first party pytest plugins; such as through install_from_resolve Issue created by cburroughs Is your feature request related to a problem? Please describe. There are a variety of ways to write and configure pytest plugins. I'd like to have first party (aka in my monorepo) plugins and configure them just as easily as third party ones (which use install_from_resolve / requirements). That would mean some way to attach first party code to the
pytest_runner.pex
Describe the solution you'd like Naively I thought that this would "just work already"
Copy code
[pytest]
install_from_resolve = "python-default"
requirements = [
   "//:reqs#pytest",
   "//my:plugin"
]
But that does not cause
//my:plugin
to appear in the sandbox. The contents of
requirements
is already a list of targets, so supporting first party targets either there or in a new field seems reasonable. Describe alternatives you've considered In this particularity case it is possible to configure the plugin through
conftest.py
. This works, but has downsides: •
conftest.py
is spooky hard to reason about magic • The plugin (and transitive deps) are duplicated as deps of every test instead of being part of the runner pex. Additional context pytest has a particularly rich plugin ecosystem, but this seems like a generally useful facility for any of the Python install_from_resolve subsystems. pantsbuild/pants