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'll start by saying this is probably not a very common use-case, but I wanted to ask this in case there is some better way of doing what I'm doing that I couldn't find in the documentation.
I have a project with some internal packages as dependencies. These packages are published to a private index, which is then mirrored to 2 different locations. One of these locations is on the same network segment as our development environments, so for development purposes is it faster to download packages from this index. The second one is faster for our ci/automation/production environments. I can differentiate between the environments with the sys_platform marker (we develop on mac and windows, but deploy on linux).
I thought about setting up the [tool.uv.sources] table in pyproject.toml like this:
[tool.uv.sources]
internal-package-1 = [
{ index = "private-index-dev", marker = "sys_platform == 'darwin' or sys_platform == 'win32'" },
{ index = "private-index-prd", marker = "sys_platform != 'darwin' and sys_platform != 'win32'" },
]
internal-package-2 = [
{ index = "private-index-dev", marker = "sys_platform == 'darwin' or sys_platform == 'win32'" },
{ index = "private-index-prd", marker = "sys_platform != 'darwin' and sys_platform != 'win32'" },
]
internal-package-3 = [
{ index = "private-index-dev", marker = "sys_platform == 'darwin' or sys_platform == 'win32'" },
{ index = "private-index-prd", marker = "sys_platform != 'darwin' and sys_platform != 'win32'" },
]
The same 2 lines for private-index-dev and private-index-prd are repeated for each internal package.
Is there any way to prevent this duplication?
As far as I know TOML doesn't support variable substitution, so I can't do something like this:
Interesting. Thanks for sharing. I guess we could add something like [tool.uv.source-definitions] then allow tool.uv.sources.<package> = { definition = ... }
It certainly adds some complexity though, so I'm hesitant to pursue it without more requests.
I'll start by saying this is probably not a very common use-case, but I wanted to ask this in case there is some better way of doing what I'm doing that I couldn't find in the documentation.
I have a project with some internal packages as dependencies. These packages are published to a private index, which is then mirrored to 2 different locations. One of these locations is on the same network segment as our development environments, so for development purposes is it faster to download packages from this index. The second one is faster for our ci/automation/production environments. I can differentiate between the environments with the
sys_platform
marker (we develop on mac and windows, but deploy on linux).I thought about setting up the
[tool.uv.sources]
table inpyproject.toml
like this:The same 2 lines for
private-index-dev
andprivate-index-prd
are repeated for each internal package.Is there any way to prevent this duplication?
As far as I know TOML doesn't support variable substitution, so I can't do something like this:
The text was updated successfully, but these errors were encountered: