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

Installation error setuptools.command.test for version 2.6.0 #772

Closed
wongjiahau opened this issue Jul 29, 2024 · 13 comments
Closed

Installation error setuptools.command.test for version 2.6.0 #772

wongjiahau opened this issue Jul 29, 2024 · 13 comments

Comments

@wongjiahau
Copy link

wongjiahau commented Jul 29, 2024

Summary:

Fixed in #771

This error has happened since today when the CI for my Django projects cannot install django-celery-beat all of a sudden without changes to the codebase.

Exact steps to reproduce the issue:

  1. Run pip wheel --no-cache-dir --use-pep517 "django-celery-beat (==2.6.0)"
  2. Expect success, but got failure (see Log below)

Detailed information

  • OS: Debian 12.6
  • pip --version: pip 24.0 from /usr/local/lib/python3.12/site-packages/pip (python 3.12)
  • Python version: 3.12.4
  • CPU Architecture: aarch64

Log

root@b4efef3c4e02 /django-backend (fix-ci-build-error) [1]# pip wheel --no-cache-dir --use-pep517 "django-celery-beat (==2.6.0)"
Collecting django-celery-beat==2.6.0
  Downloading django-celery-beat-2.6.0.tar.gz (160 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 160.5/160.5 kB 6.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.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/local/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 "/usr/local/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-88c4orq0/overlay/lib/python3.12/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-88c4orq0/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-88c4orq0/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 497, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-88c4orq0/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 9, 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.

Fix attempts

  1. The pip wheel ... command above works in macOS
  2. Replacing 2.6.0 with 2.5.0 also works
@kwongtn
Copy link
Contributor

kwongtn commented Jul 29, 2024

Its most likely due to an update to setuptools, breaking setuptools.command.test during setup

Pushed a fixed, merged in main now 😁

@octdanb
Copy link

octdanb commented Jul 29, 2024

Yeah having the same problem here

@cclauss cclauss changed the title Installation error for version 2.6.0 Installation error setuptools.command.test for version 2.6.0 Jul 29, 2024
@cclauss cclauss pinned this issue Jul 29, 2024
@wongjiahau
Copy link
Author

For poetry users looking for a temporary fix, run:

poetry add git+https://github.com/kwongtn/django-celery-beat#fix/restrict-setuptools-to-max-v71

nijel added a commit to WeblateOrg/docker that referenced this issue Jul 29, 2024
I couldn't find a way to restrict just setuptools, so it affects all
packages breaking further upgrades, but at least the Docker image can be
built.

Should be removed once
celery/django-celery-beat#772 is fixed.
nijel added a commit to WeblateOrg/docker that referenced this issue Jul 29, 2024
Improved version which restricts just setuptools without blocking other
upgrades. This had to be done by disabling build isolation, see
astral-sh/uv#5551.

Should be removed once
celery/django-celery-beat#772 is fixed.
@cclauss
Copy link
Contributor

cclauss commented Jul 29, 2024

@Craprax
Copy link

Craprax commented Jul 29, 2024

@cclauss Was wollte uns der Künstler damit sagen? (Translation: What did the artist want to tell us?)

@boilzzz
Copy link

boilzzz commented Jul 29, 2024

setuptools = "<72.0.0" - quick fix

upd. (I'm testing it, it hasn't helped yet)

@xpund
Copy link

xpund commented Jul 29, 2024

setuptools = "<72.0.0" - quick fix

this does not work if using poetry

#39 12.09   - Downgrading setuptools (71.1.0 -> 71.0.4)
#39 12.13   - Installing whitenoise (6.7.0)
#39 12.25   - Installing xlsxwriter (3.2.0)
#39 13.27 
#39 13.27   ChefBuildError
#39 13.27 
#39 13.27   Backend subprocess exited when trying to invoke get_requires_for_build_wheel
#39 13.27   
#39 13.27   Traceback (most recent call last):
#39 13.27     File "/usr/local/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in <module>
#39 13.27       main()
#39 13.27     File "/usr/local/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 357, in main
#39 13.27       json_out["return_val"] = hook(**hook_input["kwargs"])
#39 13.27                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#39 13.27     File "/usr/local/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 134, in get_requires_for_build_wheel
#39 13.27       return hook(config_settings)
#39 13.27              ^^^^^^^^^^^^^^^^^^^^^
#39 13.27     File "/tmp/tmpbzlp9aup/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
#39 13.27       return self._get_build_requires(config_settings, requirements=[])
#39 13.27              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#39 13.27     File "/tmp/tmpbzlp9aup/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
#39 13.27       self.run_setup()
#39 13.27     File "/tmp/tmpbzlp9aup/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 497, in run_setup
#39 13.27       super().run_setup(setup_script=setup_script)
#39 13.27     File "/tmp/tmpbzlp9aup/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup
#39 13.27       exec(code, locals())
#39 13.27     File "<string>", line 9, in <module>
#39 13.27   ModuleNotFoundError: No module named 'setuptools.command.test'

...

#39 13.27   at /usr/local/lib/python3.12/site-packages/poetry/installation/chef.py:164 in _prepare
#39 13.28       160│ 
#39 13.29       161│                 error = ChefBuildError("\n\n".join(message_parts))
#39 13.29       162│ 
#39 13.29       163│             if error is not None:
#39 13.29     → 164│                 raise error from None
#39 13.29       165│ 
#39 13.29       166│             return path
#39 13.29       167│ 
#39 13.29       168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
#39 13.29 
#39 13.29 Note: This error originates from the build backend, and is likely not a problem with poetry but with django-celery-beat (2.6.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "django-celery-beat (==2.6.0)"'.

@kwongtn
Copy link
Contributor

kwongtn commented Jul 29, 2024

@boilzzz @xpund
Fix your CI to commit a50011def879c84dd361a85a329dd4f7923d1f0a of this repo and you're good to go

@alerodrom
Copy link

@boilzzz
Copy link

boilzzz commented Jul 29, 2024

setuptools = "<72.0.0" - quick fix

this does not work if using poetry

#39 12.09   - Downgrading setuptools (71.1.0 -> 71.0.4)
#39 12.13   - Installing whitenoise (6.7.0)
#39 12.25   - Installing xlsxwriter (3.2.0)
#39 13.27 
#39 13.27   ChefBuildError
#39 13.27 
#39 13.27   Backend subprocess exited when trying to invoke get_requires_for_build_wheel
#39 13.27   
#39 13.27   Traceback (most recent call last):
#39 13.27     File "/usr/local/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in <module>
#39 13.27       main()
#39 13.27     File "/usr/local/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 357, in main
#39 13.27       json_out["return_val"] = hook(**hook_input["kwargs"])
#39 13.27                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#39 13.27     File "/usr/local/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 134, in get_requires_for_build_wheel
#39 13.27       return hook(config_settings)
#39 13.27              ^^^^^^^^^^^^^^^^^^^^^
#39 13.27     File "/tmp/tmpbzlp9aup/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
#39 13.27       return self._get_build_requires(config_settings, requirements=[])
#39 13.27              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#39 13.27     File "/tmp/tmpbzlp9aup/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
#39 13.27       self.run_setup()
#39 13.27     File "/tmp/tmpbzlp9aup/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 497, in run_setup
#39 13.27       super().run_setup(setup_script=setup_script)
#39 13.27     File "/tmp/tmpbzlp9aup/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup
#39 13.27       exec(code, locals())
#39 13.27     File "<string>", line 9, in <module>
#39 13.27   ModuleNotFoundError: No module named 'setuptools.command.test'

...

#39 13.27   at /usr/local/lib/python3.12/site-packages/poetry/installation/chef.py:164 in _prepare
#39 13.28       160│ 
#39 13.29       161│                 error = ChefBuildError("\n\n".join(message_parts))
#39 13.29       162│ 
#39 13.29       163│             if error is not None:
#39 13.29     → 164│                 raise error from None
#39 13.29       165│ 
#39 13.29       166│             return path
#39 13.29       167│ 
#39 13.29       168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
#39 13.29 
#39 13.29 Note: This error originates from the build backend, and is likely not a problem with poetry but with django-celery-beat (2.6.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "django-celery-beat (==2.6.0)"'.

У @alerodrom
Более подробный ответ на эту тему

@prhbrt
Copy link

prhbrt commented Jul 29, 2024

Fix attempts

  1. Replacing 2.6.0 with 2.5.0 also works

This is a no-go for django>=5 requirements-wise.

The quick-fix then is:

pip3 install --upgrade 'setuptools==71.1.0'

Until django-celery-beat becomes compatible with newer versions of setuptools.

@hottwaj
Copy link

hottwaj commented Jul 29, 2024

Thanks @cclauss & team for putting a fix together. What is the expected timeline for releasing this e.g. is a new release with just this fix planned in the next few days, or will this fix not be released until later along with other added features/fixes?

@cclauss
Copy link
Contributor

cclauss commented Jul 29, 2024

setuptools v72.0.0 was yanked and replaced with a new version that fixes this problem upstream.

@cclauss cclauss closed this as completed Jul 29, 2024
@cclauss cclauss unpinned this issue Jul 29, 2024
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

10 participants