Hey, I was trying to migrate from poetry to uv, bu...
# general
a
Hey, I was trying to migrate from poetry to uv, but having trouble with the overrides section.
poetry_requirements
would produce a bunch of targets such as
//:root#aiohttp
but that doesn't seem to be the case with
uv_requirements
. Therefore I am getting this error:
Copy code
InvalidFieldException: Unused key in the `overrides` field for //:root: ['fastapi', 'redis']
Target in thread
Copy code
uv_requirements(
    name="root",
    module_mapping={
        "opentelemetry-sdk": ["opentelemetry"],
        "hubspot-api-client": ["hubspot"],
        "office365-rest-python-client": ["office365"],
        "py3-wkhtmltopdf": ["wkhtmltopdf"],
        "python-magic": ["magic"],
    },
    overrides={
        "fastapi": {
            "dependencies": [
                "//:root#aiohttp",
                "//:root#orjson",
            ],
        },  
        "redis": {"dependencies": ["//:root#async-timeout"]},
    },
)
b
have you tried the regular
python_requirements
target pointed at pyproject.toml? I think
uv
works well with dependencies in the normal
[project.dependencies]
table
b
@abundant-tent-27407 see here: https://github.com/pantsbuild/pants/pull/21380#issuecomment-2781112058 Besides the fact
uv_requirements
really means
uv_dev_requirements
only, its implementation for that is out of date since uv has long since switched to the standard `[dependency-groups] dev = [...]`: https://docs.astral.sh/uv/concepts/projects/dependencies/#development-dependencies
At this point
uv_requirements
is a pure misfeature landmine hazing ritual prank. It should probably be renamed to
uv_legacy_dev_requirements_only_not_project_requirements
.
😬 1
🤣 1