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

Replace easy_install with pip install #917

Open
jaraco opened this issue Jan 9, 2017 · 29 comments
Open

Replace easy_install with pip install #917

jaraco opened this issue Jan 9, 2017 · 29 comments
Labels
Needs Discussion Issues where the implementation still needs to be discussed.

Comments

@jaraco
Copy link
Member

jaraco commented Jan 9, 2017

There are many open issues with Setuptools that stem from the differences between easy_install and pip install. Now that #250 is complete and there exists a mechanism by which pip install can largely satisfy the use cases currently filled by easy_install. Perhaps at some point I will link to or enumerate the issues that would be addressed by such a replacement but not right now.

In the replacement, I imagine the following:

Invocations of easy_install whether from a command-line entry point or an implicit invocation as part of a setup.py install will instead shell out to pip to perform the equivalent operation. Some options may become unavailable while others will be translated to their pip equivalent.

One big open question is whether installs should still be done as eggs (using the deprecated pip install --egg) or if it should rely on pip's use of wheel. I'm leaning toward the latter.

There are probably other open issues that I haven't yet considered.

@graingert
Copy link
Contributor

probably worth just deprecating easy_install and adding a header from the docs that points to pip

@jaraco
Copy link
Member Author

jaraco commented Jan 13, 2017

It's not so simple. Easy-install is used by tests requires and setup requires, which has not replacement. Perhaps it makes sense to only replace those functions.

@ghost
Copy link

ghost commented Jan 21, 2017

If I'm not mistaken, running pip install while pip is already running can cause problems. The only way that this is going to work is if pip understands setup_requires or setuptools does some sort of runtime hack/monkeypatch on pip.

@ghost
Copy link

ghost commented Jan 21, 2017

See pypa/pip#2745 and pypa/pip#2361.

@graingert
Copy link
Contributor

Tests requires should be deprecated in favour of tox

@jaraco
Copy link
Member Author

jaraco commented Jan 22, 2017

If I'm not mistaken, running pip install while pip is already running can cause problems. The only way that this is going to work is if pip understands setup_requires or setuptools does some sort of runtime hack/monkeypatch on pip.

I don't think these issues are relevant. In the case where pip is invoking setup.py to build a package from source and that package has setup_requires dependencies, those dependencies would still be "installed", but to a temporary location (perhaps as eggs to ./.eggs as they are now), meaning they would still be isolated from the target environment via subprocesses and temporary directories, so I would expect not to encounter those issues.

@dstufft
Copy link
Member

dstufft commented Jan 23, 2017

FWIW longer term PEP 518 is the solution to setup_requires.

@graingert
Copy link
Contributor

maybe for now, just a docs header saying, "hey unless you know what you're doing: don't use easy_install, you probably want pip instead"

@marscher
Copy link

marscher commented Mar 15, 2017

pypa/pip#1820 (comment) gives a reference on why recursive pip calls are not a good solution. I think this should be handled by setuptools, because setup_requires is a setuptools feature, which pip is currently unaware of.

PEP 518 is only a specification of the actual build time dependencies, but not an attempt to solve the installation problem:

This PEP covers step 2. It is fully expected that a future PEP will cover step 3, including how to have the build system dynamically specify more dependencies that the build system requires to perform its job. The purpose of this PEP though, is to specify the minimal set of requirements for the build system to simply begin execution.

So this is still unsolved, isn't it?

People tend not to use setup_requires, because easy_install does not use wheel and people have to compile eg. hard to build projects like scipy. So one should definitely prefer a wheel supporting mechanism.

@methane
Copy link
Contributor

methane commented Apr 23, 2017

How about remove easy_install command but keep python -m easy_install for setup_requires for a while?

@ghost
Copy link

ghost commented May 6, 2017

@jaraco what do you think about autogenerating pyproject.toml for source distributions?

@jaraco
Copy link
Member Author

jaraco commented Dec 13, 2018

Sorry for the late follow-up.

@jaraco what do you think about autogenerating pyproject.toml for source distributions?

I think I'd rather users be incentivized to provide the declaration in the preferred location. I'd support a warning, though.

@jaraco
Copy link
Member Author

jaraco commented Dec 13, 2018

This issue continues to be an issue if only because not every invocation of setup.py goes through a PEP 518 runner. For example, tox invokes setup.py --name to get the name of a package - that triggers setup_requires/easy_install. Package managers run setup.py --description or setup.py --version to get metadata. Other distutils commands still exist and are certainly in use in the wild. Perhaps we can eliminate the reliance on setup.py invocations entirely, though that prospect seems daunting.

@fungi

This comment has been minimized.

@fungi

This comment has been minimized.

@pganssle

This comment has been minimized.

mara004 added a commit to mara004/JSPyBridge that referenced this issue Nov 19, 2023
Fixes: "SetuptoolsDeprecationWarning: setup.py install is deprecated.
Instead, use pypa/build, pypa/installer or other standards-based tools.
See pypa/setuptools#917 for details."
pmisik added a commit to pmisik/buildbot that referenced this issue Jan 5, 2024
This fixed deprecation warnings in console:
/home/buildbot/.venv/lib/python3.10/site-packages/setuptools/__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  dist.fetch_build_eggs(dist.setup_requires)
/home/buildbot/.venv/lib/python3.10/site-packages/setuptools/command/develop.py:39: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

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

        See pypa/setuptools#917 for details.
        ********************************************************************************

!!
  easy_install.initialize_options(self)
/home/buildbot/.venv/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: 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.
        ********************************************************************************
pmisik added a commit to pmisik/buildbot that referenced this issue Jan 8, 2024
This fixed deprecation warnings in console:
/home/buildbot/.venv/lib/python3.10/site-packages/setuptools/__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  dist.fetch_build_eggs(dist.setup_requires)
/home/buildbot/.venv/lib/python3.10/site-packages/setuptools/command/develop.py:39: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

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

        See pypa/setuptools#917 for details.
        ********************************************************************************

!!
  easy_install.initialize_options(self)
/home/buildbot/.venv/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: 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.
        ********************************************************************************
pmisik added a commit to pmisik/buildbot that referenced this issue Jan 8, 2024
This fixed deprecation warnings in console:
/home/buildbot/.venv/lib/python3.10/site-packages/setuptools/__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  dist.fetch_build_eggs(dist.setup_requires)
/home/buildbot/.venv/lib/python3.10/site-packages/setuptools/command/develop.py:39: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

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

        See pypa/setuptools#917 for details.
        ********************************************************************************

!!
  easy_install.initialize_options(self)
/home/buildbot/.venv/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: 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.
        ********************************************************************************
pmisik added a commit to pmisik/buildbot that referenced this issue Jan 9, 2024
This fixed deprecation warnings in console:
/home/buildbot/.venv/lib/python3.10/site-packages/setuptools/__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  dist.fetch_build_eggs(dist.setup_requires)
/home/buildbot/.venv/lib/python3.10/site-packages/setuptools/command/develop.py:39: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

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

        See pypa/setuptools#917 for details.
        ********************************************************************************

!!
  easy_install.initialize_options(self)
/home/buildbot/.venv/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: 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.
        ********************************************************************************
digikata added a commit to infinyon/fluvio-client-python that referenced this issue Mar 20, 2024
Change from deprecated "python setup.py develop" to "pip install -e ."

This removes annoying deprecated setup.py message (for which direct
calling is deprecated not setup.py itself?)

pypa/setuptools#917 (comment)
morenol pushed a commit to infinyon/fluvio-client-python that referenced this issue Mar 20, 2024
Change from deprecated "python setup.py develop" to "pip install -e ."

This removes annoying deprecated setup.py message (for which direct
calling is deprecated not setup.py itself?)

pypa/setuptools#917 (comment)
DaveLak added a commit to DaveLak/oss-fuzz that referenced this issue Aug 13, 2024
misantamaria added a commit to vrodriguezf/deepvats that referenced this issue Oct 15, 2024
Para Debido a un error solucionar el error siguiente:

jupyter-1  | Obtaining file:///home/macu/work
jupyter-1  |   Preparing metadata (setup.py) ... done
jupyter-1  | Installing collected packages: dvats
jupyter-1  |   Running setup.py develop for dvats
jupyter-1  |     error: subprocess-exited-with-error
jupyter-1  |
jupyter-1  |     × python setup.py develop did not run successfully.
jupyter-1  |     │ exit code: 1
jupyter-1  |     ╰─> [32 lines of output]
jupyter-1  |         /home/macu/work/setup.py:1: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
jupyter-1  |           from pkg_resources import parse_version
jupyter-1  |         running develop
jupyter-1  |         /usr/local/share/miniconda3/envs/env/lib/python3.10/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
jupyter-1  |         !!
jupyter-1  |
jupyter-1  |                 ********************************************************************************
jupyter-1  |                 Please avoid running ``setup.py`` and ``easy_install``.
jupyter-1  |                 Instead, use pypa/build, pypa/installer or other
jupyter-1  |                 standards-based tools.
jupyter-1  |
jupyter-1  |                 See pypa/setuptools#917 for details.
jupyter-1  |                 ********************************************************************************
jupyter-1  |
jupyter-1  |         !!
jupyter-1  |           easy_install.initialize_options(self)
jupyter-1  |         /usr/local/share/miniconda3/envs/env/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
jupyter-1  |         !!
jupyter-1  |
jupyter-1  |                 ********************************************************************************
jupyter-1  |                 Please avoid running ``setup.py`` directly.
jupyter-1  |                 Instead, use pypa/build, pypa/installer or other
jupyter-1  |                 standards-based tools.
jupyter-1  |
jupyter-1  |                 See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
jupyter-1  |                 ********************************************************************************
jupyter-1  |
jupyter-1  |         !!
jupyter-1  |           self.initialize_options()
jupyter-1  |         running egg_info
jupyter-1  |         creating dvats.egg-info
jupyter-1  |         error: could not create 'dvats.egg-info': Permission denied
jupyter-1  |         [end of output]
jupyter-1  |
jupyter-1  |     note: This error originates from a subprocess, and is likely not a problem with pip.
jupyter-1  | error: subprocess-exited-with-error
jupyter-1  |
jupyter-1  | × python setup.py develop did not run successfully.
jupyter-1  | │ exit code: 1
jupyter-1  | ╰─> [32 lines of output]
jupyter-1  |     /home/macu/work/setup.py:1: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
jupyter-1  |       from pkg_resources import parse_version
jupyter-1  |     running develop
jupyter-1  |     /usr/local/share/miniconda3/envs/env/lib/python3.10/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
jupyter-1  |     !!
jupyter-1  |
jupyter-1  |             ********************************************************************************
jupyter-1  |             Please avoid running ``setup.py`` and ``easy_install``.
jupyter-1  |             Instead, use pypa/build, pypa/installer or other
jupyter-1  |             standards-based tools.
jupyter-1  |
jupyter-1  |             See pypa/setuptools#917 for details.
jupyter-1  |             ********************************************************************************
jupyter-1  |
jupyter-1  |     !!
jupyter-1  |       easy_install.initialize_options(self)
jupyter-1  |     /usr/local/share/miniconda3/envs/env/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
jupyter-1  |     !!
jupyter-1  |
jupyter-1  |             ********************************************************************************
jupyter-1  |             Please avoid running ``setup.py`` directly.
jupyter-1  |             Instead, use pypa/build, pypa/installer or other
jupyter-1  |             standards-based tools.
jupyter-1  |
jupyter-1  |             See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
jupyter-1  |             ********************************************************************************
jupyter-1  |
jupyter-1  |     !!
jupyter-1  |       self.initialize_options()
jupyter-1  |     running egg_info
jupyter-1  |     creating dvats.egg-info
jupyter-1  |     error: could not create 'dvats.egg-info': Permission denied
jupyter-1  |     [end of output]
jupyter-1  |
jupyter-1  | note: This error originates from a subprocess, and is likely not a problem with pip.

Se mueve la instalación de DeepVATS (la carpeta work) de entrypoint.sh al final de Dockerfile.jupyter, copiando únicamente las carpetas y ficheros necesarios para la instalación.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Discussion Issues where the implementation still needs to be discussed.
Projects
None yet
Development

No branches or pull requests