Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependency to deprecated setuptools.command.test breaks installation #222

Closed
ShapingView opened this issue Jul 29, 2024 · 2 comments
Closed

Comments

@ShapingView
Copy link

ShapingView commented Jul 29, 2024

Hello,

installing numpy-stl from source breaks our pipelines. This is due to a dependency to setuptools, which removed a long deprecated function: https://setuptools.pypa.io/en/stable/history.html#v72-0-0

I could reproduce this locally using pip download:

pip download --no-binary :all: numpy-stl                                                                                                                                                                                                                                                                           1 ↵
Collecting numpy-stl
  Downloading numpy-stl-3.1.1.tar.gz (799 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 799.2/799.2 kB 9.8 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/lib/python3.11/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-chkssxz6/overlay/lib/python3.11/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-chkssxz6/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-chkssxz6/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 497, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-chkssxz6/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 6, in <module>
      ModuleNotFoundError: No module named 'setuptools.command.test'
      [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.

note: This error originates from a subprocess, and is likely not a problem with pip.

We are actually using an older version, where this is also the case

pip download --no-binary :all: numpy-stl==2.16.3                                                                                                                                                                                                                                                                   1 ↵
Collecting numpy-stl==2.16.3
  Using cached numpy-stl-2.16.3.tar.gz (772 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/lib/python3.11/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-yfnzkd2i/overlay/lib/python3.11/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-yfnzkd2i/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-yfnzkd2i/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 497, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-yfnzkd2i/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 8, in <module>
      ModuleNotFoundError: No module named 'setuptools.command.test'
      [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.

note: This error originates from a subprocess, and is likely not a problem with pip.

[notice] A new release of pip is available: 23.3.1 -> 24.2
[notice] To update, run: pip install --upgrade pip
``


This seems to be an issue for many packages now: https://github.com/pypa/setuptools/issues/4520

But the command is deprecated for 5 years, now.
@ShapingView
Copy link
Author

As of now, I used this hotfix, but a better solution would be specify build-dependencies within the numpy-stl package.

echo "setuptools<72" > pip_constraints.txt
export PIP_CONSTRAINT=pip_constraints.txt

@wolph wolph closed this as completed in 17a3a70 Aug 7, 2024
@wolph
Copy link
Owner

wolph commented Aug 7, 2024

It's silly really... I removed the code that was using it a long time ago but it seems I forgot to remove the import :)

wolph added a commit that referenced this issue Aug 7, 2024
fixed #222, removed deprecated unused import v3.1.2

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEFJMl/RWQTpxOuJ6V6BRE6c4faV0FAmaz/lUACgkQ6BRE6c4f
# aV0yYQ//c54SJVQc38C1MrVrqsKl1+B2eNe8TKNBiEl1m26UHw3yxnQPIgGQAnOQ
# TnsQ5+k4pr/FwHlFWfvV9hBxExIcQLtzHLiIw90h1lDcwVh9m8V1XfA9I4NRHUFP
# lRGGQHxAj0lKzzWKu/Mqcb6wlTxnIlt2yLzD3+hiW2Jmzu6/WFBYkvkrCydQOT4x
# tARx3wGOVqKam2l9VR16P7QsGQ9uhqcPeHc7ZMZ7Z7OQUXFu1QyU3Mifb0HXeThj
# tjaGSe65/HGp+C7G3xhq3+TrswvqiF3M21bOm95hHtrVzB0z4DjmDP1vIVp3z59h
# Ndupy32xmeTyrCFQ9S3HCgHE7h+O5T5rRpzKPpPB4JON6xfb5UAHHnpvNpxowsbb
# LmPE75bPj/tB4Ke7BE7AsHp2VINB9lobMJocDvNmc8QkMIHT/JQuFMQF9eeFuQh/
# WMYV7C5xtiCUMztwcAfGUe3U5KuZ0HRpgvsXSQT/GGtXi+TQUJwsyXyC96l6mAsk
# VUBgvQcqIuZ5aVcwamujQCID7BM1J2ngZUzlkEzJJj85kJNQNABUQFVnRKkkgWJl
# 4YzSAZVMJPKiqKFswtxG/qJOkcG1uP3QlNhjNqWaDFnsqRhUsty9f4KzHJFjglaY
# 52iqKYEiYHC4a8bMnjZVMOHU00k2lYtGMs+fL80c/gJv/IWjNoU=
# =Jgtj
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu Aug  8 01:08:05 2024 CEST
# gpg:                using RSA key 149325FD15904E9C4EB89E95E81444E9CE1F695D
# gpg: Good signature from "Rick van Hattem <[email protected]>" [ultimate]
# gpg:                 aka "[jpeg image of size 9662]" [ultimate]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants