js-beautify: ModuleNotFoundError: No module named 'setuptools.command.test' as of latest setuptools package release
The latest setuptools==72.0.0 release breaks the python package install, because of a deprecation removal https://setuptools.pypa.io/en/stable/history.html#deprecations-and-removals
You can see by either running pip install jsbeautifier on a fresh install using the public PyPI package, or running make py in this repo.
$ pip install --no-cache jsbeautifier
Collecting jsbeautifier
Downloading jsbeautifier-1.15.1.tar.gz (75 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
╰─> [17 lines of output]
Traceback (most recent call last):
File "/Users/danielleone/.envs/test/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/Users/danielleone/.envs/test/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/Users/danielleone/.envs/test/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/private/var/folders/59/bys8flwx4ns3y422p1y5pdnm0000gn/T/pip-build-env-0x9kjfoz/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
File "/private/var/folders/59/bys8flwx4ns3y422p1y5pdnm0000gn/T/pip-build-env-0x9kjfoz/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
self.run_setup()
File "/private/var/folders/59/bys8flwx4ns3y422p1y5pdnm0000gn/T/pip-build-env-0x9kjfoz/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 497, in run_setup
super().run_setup(setup_script=setup_script)
File "/private/var/folders/59/bys8flwx4ns3y422p1y5pdnm0000gn/T/pip-build-env-0x9kjfoz/overlay/lib/python3.10/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]
Workaround for using this package in the mean time is to use:
PIP_CONSTRAINT='constraints.txt' pip install my-package where constraints.txt is:
setuptools==71.1.0
NOTE: you must use the PIP_CONSTRAINT env var and not the pip -c flag as the -c flag does not propagate to subprocesses of which is being used here.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 22
- Comments: 17
Commits related to this issue
- Remove obsolete setuptools test integration `make pytest` already runs a superset of all the tests run by `python3 setup-css.py test` and `python3 setup-js.py test`. (The former didn't work anyway d... — committed to cjwatson/js-beautify by cjwatson 2 years ago
- Remove obsolete setuptools test integration (#2304) `make pytest` already runs a superset of all the tests run by `python3 setup-css.py test` and `python3 setup-js.py test`. (The former didn't wor... — committed to beautifier/js-beautify by cjwatson 2 years ago
I ran into this issue as well
Even so, please remove the problematic import. It will still be removed in a future version. Heck, even migrate to
pyproject.tomlsince there is nothing custom insetup.pyother than thatActually, this helped:
changed to
Strangely, I get this even when I explicitly install older versions of setuptools on GitHub actions.