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

Add diff aware filtering to analyze graph #13623

Open
mjclarke94 opened this issue Oct 4, 2024 · 0 comments
Open

Add diff aware filtering to analyze graph #13623

mjclarke94 opened this issue Oct 4, 2024 · 0 comments

Comments

@mjclarke94
Copy link

This may be a post-red-knot issue (or even a uv issue), so happy to relocate this as needed.

One of the really powerful features which pants offers is the ability to leverage its dependency graph to only run tests/linting on files which are directly or indirectly impacted by changes. The multi-file (and presumably multi-package) analysis of red-knot plus the projects api of uv means that a lot of the components required to support this behaviour are being developed or are in place already.

Copying pants' api for an example syntax:

ruff analyze graph --changed-since=origin/main --changed-dependents=transitive  .
ruff check --changed-since=HEAD

Given how fast ruff is, this might seem unnecessary, but the real value here comes from being able to then leverage this using other tools like pytest to only run tests which are impacted by your changes.

Another point I'd note here is that pants does the dependency graph at the file level, but red-knot could enable this down to the function level to allow even more granular test selection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant