setuptools v78 no longer accepts options containing uppercase or dash characters in setup.cfg. This means if your package uses this feature, or if any of your dependencies need to be built from source (and are using the invalid syntax) then an error will be raised.
This can be worked around in the uv CLI by excluding new versions:
$ uv sync --exclude-newer 2025-03-24
This fix can be persisted in the pyproject.toml as:
[tool.uv]
exclude-newer = "2025-03-24T00:00:00Z"
Note this will prevent upgrading other packages.
If you are using uv pip, you can set a build constraint instead:
echo "setuptools<78" | uv pip install -b - <package>
This fix can be persisted in the pyproject.toml as:
[tool.uv]
build-constraint-dependencies = ["setuptools<78"]
There is an unrelated uv bug that does not propagate build-constraint-dependencies in uv sync (#12441). We will be releasing a fix for that soon.
I've asked for the change to be reverted upstream at pypa/setuptools#4870 (comment)
We're also adding a dedicated warning for this error case in #12438
See also
setuptoolsv78 no longer accepts options containing uppercase or dash characters insetup.cfg. This means if your package uses this feature, or if any of your dependencies need to be built from source (and are using the invalid syntax) then an error will be raised.This can be worked around in the uv CLI by excluding new versions:
This fix can be persisted in the
pyproject.tomlas:Note this will prevent upgrading other packages.
If you are using
uv pip, you can set a build constraint instead:This fix can be persisted in the
pyproject.tomlas:There is an unrelated uv bug that does not propagate
build-constraint-dependenciesinuv sync(#12441). We will be releasing a fix for that soon.I've asked for the change to be reverted upstream at pypa/setuptools#4870 (comment)
We're also adding a dedicated warning for this error case in #12438
See also
fasttextUsinguvdespite Fix #1446 #12437