sdk-python icon indicating copy to clipboard operation
sdk-python copied to clipboard

Fix setup.cfg description_file

Open jusdino opened this issue 8 months ago • 6 comments

setup.cfg is using a long-deprecated field name, which now does not build with the latest version of setuptools. This PR updates the field name to its currently-supported equivalent:

Collecting authorizenet==1.1.5 (from -r requirements.txt (line 7))
  Downloading authorizenet-1.1.5.tar.gz (158 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
  ╰─> [31 lines of output]
      Traceback (most recent call last):
        File "/usr/app/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
        File "/usr/app/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/app/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-scnu31m8/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-scnu31m8/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-scnu31m8/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-scnu31m8/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 14, in <module>
        File "/tmp/pip-build-env-scnu31m8/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 116, in setup
          _install_setup_requires(attrs)
        File "/tmp/pip-build-env-scnu31m8/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 87, in _install_setup_requires
          dist.parse_config_files(ignore_option_errors=True)
        File "/tmp/pip-build-env-scnu31m8/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-scnu31m8/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-scnu31m8/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), please use the underscore name 'description_file' instead.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

Closes #166

jusdino avatar Mar 24 '25 15:03 jusdino

@gnongsie Can you please review this and get it pulled in? This is blocking all of our local development and CICD pipeline deployments. Thank you.

landonshumway-ia avatar Mar 24 '25 15:03 landonshumway-ia

Specifically, it's setuptools v78.0.0, which says in its changelog:

Setuptools no longer accepts options containing uppercase or dash characters in setup.cfg. Please ensure to write the options in setup.cfg using the lower_snake_case convention (e.g. Name => name, install-requires => install_requires). This is a follow-up on deprecations introduced in v54.1.0 (see #1608) and v54.1.1 (see #2592).

noelleleigh avatar Mar 24 '25 16:03 noelleleigh

I have same issue, would be grateful if this issue is fixed.

nosikolga avatar Mar 24 '25 19:03 nosikolga

We are trying to get authorize working on our end, we would appreciate having this merged.

TakumiHendricksDev avatar Mar 25 '25 15:03 TakumiHendricksDev

Yesterday setuptools v78.0.2 was released which reverted the compatibility change from v78.0.0:

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

noelleleigh avatar Mar 25 '25 17:03 noelleleigh

Interesting development from the setuptools maintainers: It turns out that description_file is also not a supported field, but a bug in setuptools was letting it pass: https://github.com/pypa/setuptools/pull/4911#issuecomment-2749079867

https://github.com/pypa/setuptools/issues/4913

The right way may actually be to open() the file an read the data into long_description instead.

jusdino avatar Apr 03 '25 16:04 jusdino

Closing this pull request as the correct changes have been absorbed as part of #168

gnongsie avatar Apr 28 '25 06:04 gnongsie