kevin1024 / vcrpy

Automatically mock your HTTP interactions to simplify and speed up testing
MIT License
2.72k stars 388 forks source link

Fix compatibility with setuptools 72 #855

Closed strujilloc closed 4 months ago

strujilloc commented 4 months ago

Due to Test command removal in setuptools, installation fails with version 72:

Collecting vcrpy
  Using cached vcrpy-6.0.1.tar.gz (84 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 "/private/var/folders/pb/0cllx_zx6vb88jht981qy96c0000gn/T/pip-build-env-c0ajc0p7/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/pb/0cllx_zx6vb88jht981qy96c0000gn/T/pip-build-env-c0ajc0p7/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/pb/0cllx_zx6vb88jht981qy96c0000gn/T/pip-build-env-c0ajc0p7/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/pb/0cllx_zx6vb88jht981qy96c0000gn/T/pip-build-env-c0ajc0p7/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]

  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.
Toeplitz commented 4 months ago

what's the most correct fix for this currently?

agroszer commented 4 months ago

Looks like GH actions just use exec pytest so is that piece of code still in use?

DanieleIsoni commented 4 months ago

I think this is a duplicate of #854

agroszer commented 4 months ago

I think this is a duplicate of #854

It is, but title is misleading.

bitphage commented 4 months ago

Fix via setting PIP_CONSTRAINTS https://github.com/pypa/setuptools/issues/4519#issuecomment-2254983472

omidkk commented 4 months ago

@agroszer seems pre-commit and some tests failed after your PR.

deronnax commented 4 months ago

The problematic setuptools version has been yanked.