You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like the ability to provide a list of sources in a file outside the package pyproject.toml to uv pip install. The reason the sources should be in an external file is that these sources will contain paths for all the packages in a monorepo, and the same file will be used whenever a package is installed in a test environment to ensure dependencies within the monorepo are resolved within the checked-out commit of the monorepo.
Details
In monorepo development, often one has many interdependent packages in the same repo. Let's call a dependency across packages within the monorepo an "internal dependency".
When testing, we'd typically like to resolve internal dependencies against the checked out version of the code.
Consider a toy version of the much more complicated scenario we have in Dagster. Suppose we have three packages in the monorepo: dagster-foodagster-bar, and dagster-baz. dagster-foo depends on dagster-bar, and dagster-bar depends on dagster-baz:
### dagster-foo/pyproject.toml
[project]
...
name = "dagster-foo"
dependencies = ["dagster-bar"]
### dagster-bar/pyproject.toml
[project]
...
name = "dagster-bar"
dependencies = ["dagster-baz"]
When I install dagster-foo into a test environment from a local path, I want to resolve both it's first order dep dagster-bar and second-order dep dagster-baz to the local versions within the monorepo.
One way to do this is to use [tool.uv.sources]. For that to work, we'd have to do this:
### dagster-foo/pyproject.toml
[project]
...
name = "dagster-foo",
dependencies = [
"dagster-bar",
"dagster-baz", # have to include this now because tool.uv.sources won't work for 2nd-order deps
]
[tool.uv.sources]
dagster-bar = { path = "/path/to/dagster/python_modules/dagster-bar", editable = true }
dagster-baz = { path = "/path/to/dagster/python_modules/dagster-baz", editable = true }
This is not ideal for a few reasons:
I have to list indirect dependencies under project.dependencies to make them work with uv.tool.sources
I need to manage the [tool.uv.sources] separately for every dagster-* package.
What would be better is if I could somehow maintain a single list of sources in some external file and link that file when installing any dagster-* into a test environment. This would effectively function like an "index" that shadows PyPI:
Then when installing dagster-foo, I would not have any tool.uv.sources listed in its pyproject.toml, but would just do:
uv pip install -e path/to/dagster-foo --sources SOURCES.toml
# analogous to the below command, _if_ we had a private index https://dagster.monorepo.index that somehow contained the
# local versions of all dagster-* packages (which we don't)
uv pip install -e path/to/dagster-foo --index https://dagster.monorepo.index
Is this functionality already supported through some pattern I haven't thought of? If not, consider this a feature request.
The text was updated successfully, but these errors were encountered:
I'd like the ability to provide a list of sources in a file outside the package
pyproject.toml
touv pip install
. The reason the sources should be in an external file is that these sources will contain paths for all the packages in a monorepo, and the same file will be used whenever a package is installed in a test environment to ensure dependencies within the monorepo are resolved within the checked-out commit of the monorepo.Details
In monorepo development, often one has many interdependent packages in the same repo. Let's call a dependency across packages within the monorepo an "internal dependency".
When testing, we'd typically like to resolve internal dependencies against the checked out version of the code.
Consider a toy version of the much more complicated scenario we have in Dagster. Suppose we have three packages in the monorepo:
dagster-foo
dagster-bar
, anddagster-baz
.dagster-foo
depends ondagster-bar
, anddagster-bar
depends ondagster-baz
:When I install
dagster-foo
into a test environment from a local path, I want to resolve both it's first order depdagster-bar
and second-order depdagster-baz
to the local versions within the monorepo.One way to do this is to use
[tool.uv.sources]
. For that to work, we'd have to do this:This is not ideal for a few reasons:
project.dependencies
to make them work withuv.tool.sources
[tool.uv.sources]
separately for everydagster-*
package.What would be better is if I could somehow maintain a single list of sources in some external file and link that file when installing any
dagster-*
into a test environment. This would effectively function like an "index" that shadows PyPI:Then when installing
dagster-foo
, I would not have anytool.uv.sources
listed in its pyproject.toml, but would just do:Is this functionality already supported through some pattern I haven't thought of? If not, consider this a feature request.
The text was updated successfully, but these errors were encountered: