json2html icon indicating copy to clipboard operation
json2html copied to clipboard

Installation of json2html fails with setuptools>=78.0.1 due to deprecated config key

Open pcrespov opened this issue 8 months ago • 5 comments

After upgrading setuptools from version 77.0.3 to 78.0.1, the installation of the json2html package fails. The error appears to stem from a deprecated configuration key in its setup.cfg file:

setuptools.errors.InvalidConfigError: Invalid dash-separated key
'description-file' in 'metadata' (setup.cfg), please use the underscore
name 'description_file' instead.

This change in setuptools behavior enforces stricter validation of configuration keys, breaking compatibility with packages that still use the deprecated description-file format.

For reference, see the full error here

Downloaded virtualenv
  × Failed to build `json2html==1.3.0`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit
      status: 1)

      [stderr]
      Traceback (most recent call last):
        File "<string>", line 14, in <module>
        File
      "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpZo4w61/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/runner/work/_temp/setup-uv-cache/builds-v0/.tmpZo4w61/lib/python3.11/site-packages/setuptools/build_meta.py",
      line 304, in _get_build_requires
          self.run_setup()
        File
      "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpZo4w61/lib/python3.11/site-packages/setuptools/build_meta.py",
      line 522, in run_setup
          super().run_setup(setup_script=setup_script)
        File
      "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpZo4w61/lib/python3.11/site-packages/setuptools/build_meta.py",
      line 320, in run_setup
          exec(code, locals())
        File "<string>", line 11, in <module>
        File
      "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpZo4w61/lib/python3.11/site-packages/setuptools/__init__.py",
      line 116, in setup
          _install_setup_requires(attrs)
        File
      "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpZo4w61/lib/python3.11/site-packages/setuptools/__init__.py",
      line [87](https://github.com/ITISFoundation/osparc-simcore/actions/runs/14038993041/job/39304187921?pr=7409#step:7:88), in _install_setup_requires
          dist.parse_config_files(ignore_option_errors=True)
        File
      "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpZo4w61/lib/python3.11/site-packages/_virtualenv.py",
      line 20, in parse_config_files
          result = old_parse_config_files(self, *args, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File
      "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpZo4w61/lib/python3.11/site-packages/setuptools/dist.py",
      line 730, in parse_config_files
          self._parse_config_files(filenames=inifiles)
        File
      "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpZo4w61/lib/python3.11/site-packages/setuptools/dist.py",
      line 5[99](https://github.com/ITISFoundation/osparc-simcore/actions/runs/14038993041/job/39304187921?pr=7409#step:7:100), in _parse_config_files
          opt = self._enforce_underscore(opt, section)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File
      "/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmpZo4w61/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.

pcrespov avatar Mar 24 '25 17:03 pcrespov

It appears this is now fixed. However, since there has not been a release to PyPi since this change was implemented this bug is still appearing.

Mab879 avatar Mar 24 '25 18:03 Mab879

Hope this fix gets released as a PyPi package. @softvar

MadhavVij avatar Mar 24 '25 18:03 MadhavVij

This issue looks resolved, would you all agree?

felipegr avatar Mar 25 '25 16:03 felipegr

It's fixed for now since setuptools rolled back the breaking change, but I think they want to introduce it again in 2026. So a release with the fix would still be helpful.

Mab879 avatar Mar 25 '25 16:03 Mab879

I fully agree with you.

felipegr avatar Mar 25 '25 16:03 felipegr

Due to the upcoming pip deprecation, this project should switch to the new pyproject.toml format anyway. The pyproject.toml format should solve this issue as well, right?

Created a pull request https://github.com/softvar/json2html/pull/61

felixp98 avatar Jun 30 '25 16:06 felixp98