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

Monorepos: Replicating nx affected, nx run-many with uv. #11955

Open
gregglind opened this issue Mar 4, 2025 · 3 comments
Open

Monorepos: Replicating nx affected, nx run-many with uv. #11955

gregglind opened this issue Mar 4, 2025 · 3 comments
Labels
enhancement New feature or improvement to existing functionality wish Not on the immediate roadmap

Comments

@gregglind
Copy link

Summary

nx affected promises to "run only tasks affected by a PR".

Having uv tree and uv lock --check makes me wonder if uv could replace this command?

If this is out of scope for uv proper, is there a suggested better tool or pattern?

Context

Non-workspace monorepos, where each project is pytest testable, but there is a root pyproject to oversee and enforce code patterns (ruff, etc), python versions, and other shared contraints.

Example

No response

@gregglind gregglind added the enhancement New feature or improvement to existing functionality label Mar 4, 2025
@zanieb
Copy link
Member

zanieb commented Mar 4, 2025

We're interested in this, but we're far out from implementing it in a robust way.

The most relevant work here is astral-sh/ruff#13402 which is used by some people for test selection.

@zanieb zanieb added the wish Not on the immediate roadmap label Mar 4, 2025
@gregglind
Copy link
Author

Thanks for sharing that link and validating the desire.

Even "non-robust" ways (packages with source lines in the lockfile, assuming they are all in projects with a pyproject.toml) are a great starting point!

@gregglind
Copy link
Author

Further amplification: a place where UV can add value (the "most missing piece") is by exposing more of the dependency graph, either as part of lock or tree. This is orthogonal to the discussion in #5903.

Building a run-many task runner that uses that information might be a simple as calling uv run --project or uv run --directory for each line in that graph (bottom-up).

In particular, listing every pyproject.toml that would be involved in a particular uv lock scenario would be very helpful, and strictly better than grep.

uv -v lock --dry-run |& grep static has lines like

DEBUG Found static `pyproject.toml` for: my-lib @ file:///Users/glind/some/monorepo/path`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality wish Not on the immediate roadmap
Projects
None yet
Development

No branches or pull requests

2 participants