Skip to content

Invalid dash-separated key 'description-file' in 'metadata' (setup.cfg) #122

@wrr

Description

@wrr

I'm using python-postmark successfully for many years, thank your for your great work! Recently, while trying to install it on a machine with Python 3.12.3 and pip 25.01, I'm getting the following installation error:

Collecting python-postmark==0.6.0 (from -r requirements.txt (line 12))
 Using cached python-postmark-0.6.0.tar.gz (11 kB)
 Installing build dependencies: started
 Installing build dependencies: finished with status 'done'
 Getting requirements to build wheel: started
 Getting requirements to build wheel: finished with status 'error'
 error: subprocess-exited-with-error
 
 × Getting requirements to build wheel did not run successfully.
 │ exit code: 1
 ╰─> [29 lines of output]
     Traceback (most recent call last):
       File "/home/alice/project/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
         main()
       File "/home/alice/project/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
         json_out['return_val'] = hook(**hook_input['kwargs'])
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       File "/home/alice/project/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
         return hook(config_settings)
                ^^^^^^^^^^^^^^^^^^^^^
       File "/tmp/pip-build-env-_oweoi4l/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
         return self._get_build_requires(config_settings, requirements=[])
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       File "/tmp/pip-build-env-_oweoi4l/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
         self.run_setup()
       File "/tmp/pip-build-env-_oweoi4l/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 522, in run_setup
         super().run_setup(setup_script=setup_script)
       File "/tmp/pip-build-env-_oweoi4l/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 320, in run_setup
         exec(code, locals())
       File "<string>", line 9, in <module>
       File "/tmp/pip-build-env-_oweoi4l/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 160, in setup
         dist.parse_config_files()
       File "/tmp/pip-build-env-_oweoi4l/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 730, in parse_config_files
         self._parse_config_files(filenames=inifiles)
       File "/tmp/pip-build-env-_oweoi4l/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 599, in _parse_config_files
         opt = self._enforce_underscore(opt, section)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       File "/tmp/pip-build-env-_oweoi4l/overlay/lib/python3.12/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)3, please use the underscore name 'description_file' instead.

Brief search indicates that the deprecation of keys with dashes (description-file) in favor of underscore (description_file) has become a hard error with newer setuptools. I'm not very knowledgeable of the Python setuptools in general, so I'm not sure if changing the key could cause problems for users that use old setuptools. Based on a brief search, description-file isn't a widely used setting, and perhaps could be removed altogether?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions