Skip to content

Restore support for install via pip. #4969

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

Closed
wants to merge 2 commits into from
Closed

Conversation

jaraco
Copy link
Member

@jaraco jaraco commented Apr 29, 2025

Closes #3143

Summary of changes

Closes

Pull Request Checklist

@jaraco
Copy link
Member Author

jaraco commented Apr 29, 2025

@hroncok Would you mind reviewing this change? Will it satisfy the use case, at least until November?

@hroncok
Copy link
Contributor

hroncok commented Apr 29, 2025

This adds a dependency on pip:

$ python setup.py install --prefix ../../fake_prefix
running install
.../venv/lib64/python3.13/site-packages/setuptools/_distutils/cmd.py:90: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
.../venv/lib64/python3.13/site-packages/setuptools/_distutils/cmd.py:90: InstallDeprecationWarning: install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``install``.
        Instead, use standards-based tools like pip or uv.

        By 2025-Oct-31, you need to update your project and remove deprecated calls
        or your builds will no longer be supported.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  self.initialize_options()
.../venv/bin/python: No module named pip
Traceback (most recent call last):
  File ".../empty/setup.py", line 3, in <module>
    setup(name='wtf', version='1')
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../venv/lib64/python3.13/site-packages/setuptools/__init__.py", line 117, in setup
    return distutils.core.setup(**attrs)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File ".../venv/lib64/python3.13/site-packages/setuptools/_distutils/core.py", line 186, in setup
    return run_commands(dist)
  File ".../venv/lib64/python3.13/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
    dist.run_commands()
    ~~~~~~~~~~~~~~~~~^^
  File ".../venv/lib64/python3.13/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands
    self.run_command(cmd)
    ~~~~~~~~~~~~~~~~^^^^^
  File ".../venv/lib64/python3.13/site-packages/setuptools/dist.py", line 1104, in run_command
    super().run_command(command)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File ".../venv/lib64/python3.13/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
    cmd_obj.run()
    ~~~~~~~~~~~^^
  File ".../venv/lib64/python3.13/site-packages/setuptools/command/install.py", line 110, in run
    self.do_pip_install()
    ~~~~~~~~~~~~~~~~~~~^^
  File ".../venv/lib64/python3.13/site-packages/setuptools/command/install.py", line 153, in do_pip_install
    subprocess.check_call(cmd)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "/usr/lib64/python3.13/subprocess.py", line 419, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['.../venv/bin/python', '-m', 'pip', 'install', '.', '--use-pep517', '--prefix', '../../fake_prefix']' returned non-zero exit status 1.

Meanwhile, using --root still works:

$ python setup.py install --root ../.. --prefix /fake_prefix
running install
.../venv/lib64/python3.13/site-packages/setuptools/_distutils/cmd.py:90: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
.../venv/lib64/python3.13/site-packages/setuptools/_distutils/cmd.py:90: InstallDeprecationWarning: install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``install``.
        Instead, use standards-based tools like pip or uv.

        By 2025-Oct-31, you need to update your project and remove deprecated calls
        or your builds will no longer be supported.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  self.initialize_options()
running build
running install_egg_info
running egg_info
writing wtf.egg-info/PKG-INFO
writing dependency_links to wtf.egg-info/dependency_links.txt
writing top-level names to wtf.egg-info/top_level.txt
reading manifest file 'wtf.egg-info/SOURCES.txt'
writing manifest file 'wtf.egg-info/SOURCES.txt'
removing '../../fake_prefix/lib/python3.13/site-packages/wtf-1-py3.13.egg-info' (and everything under it)
Copying wtf.egg-info to ../../fake_prefix/lib/python3.13/site-packages/wtf-1-py3.13.egg-info
running install_scripts

As such, I don't believe this really fixes the problem.

@jaraco
Copy link
Member Author

jaraco commented Apr 29, 2025

Indeed, it does add a dependency on pip. I was thinking that would be acceptable, that pip could be an implied dependency for these workflows, but it sounds like that's not the case. I'll revisit in the ticket.

@jaraco jaraco closed this Apr 29, 2025
@jaraco jaraco deleted the feature/pip-install branch April 29, 2025 16:13
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

Successfully merging this pull request may close these issues.

[BUG] setup.py install --prefix ... uses easy_install -- breaks completely with setuptools 80+
2 participants