IBM / python-sdk-core

The python-sdk-core repository contains core functionality required by Python code generated by the IBM OpenAPI SDK Generator.
Apache License 2.0
20 stars 27 forks source link

New setuptools release prevents install of python core library #202

Closed melvin806 closed 3 months ago

melvin806 commented 3 months ago

Hi

I followed the instructions to upgrade the package python -m pip install --upgrade ibm-cloud-sdk-core

i am running on wsl, i am running on python 3.9 inside wsl my setuptools-72.0.0

But i am getting this error, may i know what i am missing? × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [18 lines of output]

    File "/tmp/pip-build-env-nz566fgr/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=[])
    File "/tmp/pip-build-env-nz566fgr/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-nz566fgr/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 497, in run_setup
      super().run_setup(setup_script=setup_script)
    File "/tmp/pip-build-env-nz566fgr/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 313, in run_setup
      exec(code, locals())
    File "<string>", line 20, in <module>
  ModuleNotFoundError: No module named 'setuptools.command.test'
  [end of output]
vinothsubramanian commented 3 months ago

I confirm that the same issue occurs using uv.

uv pip install -r .\requirements.txt
⠴ ibm-cloud-sdk-core==3.20.3                                                                                                                                                            
error: Failed to download and build 'ibm-cloud-sdk-core==3.20.3'
  Caused by: Failed to build: 'ibm-cloud-sdk-core==3.20.3'
  Caused by: Build backend failed to determine extra requires with 'build_wheel()' with exit code: 1
stdout:

--- stderr:
<string>:18: 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 "C:\Users\myuserid\AppData\Local\uv\cache\builds-v0\.tmp8oeKOV\Lib\site-packages\setuptools\build_meta.py", line 327, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=[])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\myuserid\AppData\Local\uv\cache\builds-v0\.tmp8oeKOV\Lib\site-packages\setuptools\build_meta.py", line 297, in _get_build_requires
    self.run_setup()
  File "C:\Users\myuserid\AppData\Local\uv\cache\builds-v0\.tmp8oeKOV\Lib\site-packages\setuptools\build_meta.py", line 497, in run_setup
    super().run_setup(setup_script=setup_script)
  File "C:\Users\myuserid\AppData\Local\uv\cache\builds-v0\.tmp8oeKOV\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup
    exec(code, locals())
  File "<string>", line 20, in <module>
ModuleNotFoundError: No module named 'setuptools.command.test'
---
vinothsubramanian commented 3 months ago

solved by installing with --no-build-isolation

Seems to be the workaround for now

willwade commented 3 months ago

+1 from me. this is stopping ci builds on 3.12,3.11

suresh-at-straker commented 3 months ago

similar issue for me.

Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'error' ... ... Getting requirements to build wheel did not run successfully. exit code: 1

willwade commented 3 months ago

I'm intrigued. why has this started overnight? Whats changed? (the workarounds arent working for me sadly)

vinothsubramanian commented 3 months ago

@willwade There is an release to setuptools published today. That seems to be the root cause of the issue.

melvin806 commented 3 months ago

solved by installing with --no-build-isolation

Seems to be the workaround for now

but how did you apply the workaround onto the cicd pipeline? i cant build any new build images

willwade commented 3 months ago

solved by installing with --no-build-isolation

Seems to be the workaround for now

but how did you apply the workaround onto the cicd pipeline? i cant build any new build images

https://github.com/pypa/setuptools/issues/4519#issuecomment-2255610924

pyrooka commented 3 months ago

Hi everyone! Thanks for all the feedback we are working on the fix. One thing that we can do is removing the test references from the setup.py file because - if I am correct - it's not used anymore. That should solve this issue. Give us a little time, we'll back soon!

pyrooka commented 3 months ago

FYI, the latest setuptools release which caused this issue has been yanked, so all builds should run fine without any changes. I still think we should remove the references to the deprecated code. I leave this issue open for a while to make sure everything works fine, so feel free to leave a feedback here.

bradhvr commented 3 months ago

@pyrooka Thanks for the quick responses on this!

pyrooka commented 3 months ago

@bradhvr Of course! We are trying to support our users as much as possible. :)

pyrooka commented 3 months ago

A new release - which removes the deprecated code from the project - was published not too long ago: https://pypi.org/project/ibm-cloud-sdk-core/3.20.4/

I'm closing this issue now, but feel free to re-open it if needed!