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

With setuptools 72.0.0 requests can no longer be installed from git #6775

Closed
felixfontein opened this issue Jul 29, 2024 · 5 comments
Closed

Comments

@felixfontein
Copy link

Expected Result

pip install git+https://github.com/psf/requests gives me the latest development version of requests.

Actual Result

Installation fails due to an import in setup.py:

Running command git clone -q https://github.com/psf/requests /tmp/pip-req-build-bwz96dmd
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3.9 /usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpqmb1elhu
       cwd: /tmp/pip-req-build-bwz96dmd
  Complete output (17 lines):
  Traceback (most recent call last):
    File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 349, in <module>
      main()
    File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 331, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 117, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-thl7ju8g/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-thl7ju8g/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-thl7ju8g/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-thl7ju8g/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 313, in run_setup
      exec(code, locals())
    File "<string>", line 7, in <module>
  ModuleNotFoundError: No module named 'setuptools.command.test'
  ----------------------------------------
WARNING: Discarding git+https://github.com/psf/requests. Command errored out with exit status 1: /usr/bin/python3.9 /usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpqmb1elhu Check the logs for full command output.
ERROR: Command errored out with exit status 1: /usr/bin/python3.9 /usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpqmb1elhu Check the logs for full command output.

See the setuptools changelog: https://setuptools.pypa.io/en/stable/history.html#v72-0-0

The test command has been removed. Users relying on ‘setup.py test’ will need to migrate to another test runner or pin setuptools before this version. (#931)

Reproduction Steps

Create a venv with latest setuptools. Then run pip install git+https://github.com/psf/requests.

@Keruspe
Copy link

Keruspe commented Jul 29, 2024

See also #6774

@nateprewitt
Copy link
Member

This change was reverted in setuptools with pypa/setuptools@441799f. We'll work on the deprecation in an upcoming release.

@zahlman
Copy link

zahlman commented Jul 31, 2024

I was surprised to hear that Requests was affected by this, because (just as I recalled) its own source code is Python-only. Looking around a bit, I conclude:

  • Developers don't appear to be using any kind of deprecated setup.py-based workflow, instead relying on a Makefile, Tox etc.
  • There is already a pyproject.toml, but it only contains configuration for dev tools (isort and pytest)
  • Aside from the just-removed code for a test command, setup.py is currently used for:
    • an "unsupported Python version" warning; but this should be redundant with requires-python metadata, Pip functionality etc.
    • a setup.py publish shortcut (which doesn't go through the Setuptools machinery but just inspects sys.argv); but this is redundant with and inferior to the publish target in the Makefile
    • reading __version__.py to get some dynamic metadata; but this can be done by configuring [tool.setuptools.dynamic] in pyproject.toml

In conclusion, AFAICT, nothing currently done in setup.py needs to be done there, and the continued existence of this file just exposes the risk of future speed bumps as further attempts are made to deprecate and disable old workflows.

Would there be any interest in a PR to migrate the project to a proper PEP517-conformant build, such as I already offered to another project here?

@nateprewitt
Copy link
Member

Thanks @zahlman, we already have the work done for this and announced the change back in May in our Changelog. As stated above, this will be included in the next minor version release.

@zahlman
Copy link

zahlman commented Jul 31, 2024

Apologies, I misunderstood the implications of "work on the deprecation". Cheers :)

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

4 participants