uv: Invalid dash-separated key 'description-file' on aiosonic, pytest-watch appeared in last hour

Summary

Can minimally reproduce with:

uv pip install datadog-api-client[async]~=2.33.1

Using Python 3.11.11 environment at: venv
  × Failed to build `aiosonic==0.15.1`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit status: 1)

      [stderr]
      <string>:5: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      Traceback (most recent call last):
        File "<string>", line 14, in <module>
        File "/home/ubuntu/.cache/uv/builds-v0/.tmpDeYjkr/lib/python3.11/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/ubuntu/.cache/uv/builds-v0/.tmpDeYjkr/lib/python3.11/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
          self.run_setup()
        File "/home/ubuntu/.cache/uv/builds-v0/.tmpDeYjkr/lib/python3.11/site-packages/setuptools/build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/home/ubuntu/.cache/uv/builds-v0/.tmpDeYjkr/lib/python3.11/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 50, in <module>
        File "/home/ubuntu/.cache/uv/builds-v0/.tmpDeYjkr/lib/python3.11/site-packages/setuptools/__init__.py", line 116, in setup
          _install_setup_requires(attrs)
        File "/home/ubuntu/.cache/uv/builds-v0/.tmpDeYjkr/lib/python3.11/site-packages/setuptools/__init__.py", line 87, in _install_setup_requires
          dist.parse_config_files(ignore_option_errors=True)
        File "/home/ubuntu/.cache/uv/builds-v0/.tmpDeYjkr/lib/python3.11/site-packages/_virtualenv.py", line 20, in parse_config_files
          result = old_parse_config_files(self, *args, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/ubuntu/.cache/uv/builds-v0/.tmpDeYjkr/lib/python3.11/site-packages/setuptools/dist.py", line 730, in parse_config_files
          self._parse_config_files(filenames=inifiles)
        File "/home/ubuntu/.cache/uv/builds-v0/.tmpDeYjkr/lib/python3.11/site-packages/setuptools/dist.py", line 599, in _parse_config_files
          opt = self._enforce_underscore(opt, section)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/ubuntu/.cache/uv/builds-v0/.tmpDeYjkr/lib/python3.11/site-packages/setuptools/dist.py", line 629, in _enforce_underscore
          raise InvalidConfigError(
      setuptools.errors.InvalidConfigError: Invalid dash-separated key 'description-file' in 'metadata' (setup.cfg), please use the underscore name 'description_file'
      instead.

      hint: This usually indicates a problem with the package or the build environment.
  help: `aiosonic` (v0.15.1) was included because `datadog-api-client[async]` (v2.33.1) depends on `aiosonic==0.15.1`

Also happens with pytest-marker. Our Github Actions based CI/CD system just started throwing these errors, so it seems that something inside uv, or setuptools, or PyPi has changed very recently.

Platform

Linux 5.15.0-1077-aws x86_64 GNU/Linux

Version

uv 0.6.9

Python version

Python 3.11.11

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 24 (14 by maintainers)

Commits related to this issue

Most upvoted comments

Yeah we’re missing one spot in uv sync. I will fix it.

Manually installed setuptools==77.0.3 in empty ubuntu:24.04 docker, python -m uv pip install gputil still does not work. python -m pip install gputil works with any setuptools version. I’m using python 3.11.11, uv 0.6.9, pip 25.0.1.

@vient you still need to set the build constraint. If you don’t want to set up a file you can pipe it in

echo "setuptools<78" | uv pip install -b - gputil

This is a change in the latest setuptools release: https://setuptools.pypa.io/en/stable/history.html#v78-0-0

You can pin your setuptools version via build constraints.

For me, the workaround setting build-constraint-dependencies doesn’t work

We must not be propagating these in uv sync somewhere. I’ll take a look.

No worries. Someone brought this up on Discord ~30 minutes ago so I was expecting to get a few issues along these lines. Unfortunately, I think this will affect a large number of projects.

Setuptools rolled back the change

https://github.com/pypa/setuptools/blob/main/NEWS.rst

Postponed removals of deprecated dash-separated and uppercase fields in setup.cfg. All packages with deprecated configurations are advised to move before 2026. (#4911)

I can no longer reproduce this bug myself. I expect that the workarounds discussed above are no longer needed.

👋 Just for search visibility, I also noticed this issue when trying to install apache-airflow-providers-google due to its dependency on on json-merge-patch==0.2

As above, constraining setuptools works well:

[tool.uv]
build-constraint-dependencies = ["setuptools<78"]

Edit: I have also noticed some flakiness. Will comment below.

The build constraint suggestion worked, so happy for you to close this if that’s best 👍

[tool.uv]
# Ensure that the setuptools is pinned whenever a package has a build dependency
# on setuptools. https://github.com/astral-sh/uv/issues/12434
build-constraint-dependencies = ["setuptools~=77.0.3"]

Cheers, figured it wasn’t a uv thing but also figured others would come here and search the string “Invalid dash-separated key”.

Thanks as always for the super fast responses! ❤