Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support first party pytest plugins; such as through install_from_resolve #21757

Open
cburroughs opened this issue Dec 13, 2024 · 0 comments
Open
Labels
backend: Python Python backend-related issues enhancement

Comments

@cburroughs
Copy link
Contributor

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"

[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.

@cburroughs cburroughs added enhancement backend: Python Python backend-related issues labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: Python Python backend-related issues enhancement
Projects
None yet
Development

No branches or pull requests

1 participant