Skip to content

py-setuptools: install setuptools from wheels directly #31131

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

Merged

Conversation

alalazo
Copy link
Member

@alalazo alalazo commented Jun 14, 2022

When installing setuptools from sources in Spack, we might get into weird failures due to the way we use pip.

In particular, for Spack it's necessary to install in a non-isolated pip environment to allow using PYTHONPATH as a selection method for all the build requirements of a Python package.

This can fail when installing setuptools since there might be a setuptools version already installed for the Python interpreter being used, with different entry points than the one we want to install. The failure encountered in that case is like the one shown here.

Installing from wheels both pip and setuptools should harden our installation procedure in the context of:

  • Bootstrapping Python dependencies of Spack
  • Using external Python packages

This PR takes this approach and changes the way we install py-setuptools in Spack.

alalazo added 2 commits June 14, 2022 20:55
When installing setuptools from sources in Spack, we might
get into weird failures due to the way we use pip.

In particular, for Spack it's necessary to install in a
non-isolated pip environment to allow using PYTHONPATH as a
selection method for all the build requirements of a
Python package.

This can fail when installing setuptools since there might
be a setuptools version already installed for the Python
interpreter being used, with different entry points than
the one we want to install.

Installing from wheels both pip and setuptools should
harden our installation procedure in the context of:
- Bootstrapping Python dependencies of Spack
- Using external Python packages
@spackbot-app spackbot-app bot requested a review from adamjstewart June 14, 2022 19:04
@alalazo alalazo changed the title Bootstrap/harden support for setuptools py-setuptools: install setuptools from wheels directly Jun 14, 2022
adamjstewart
adamjstewart previously approved these changes Jun 14, 2022
@alalazo alalazo marked this pull request as ready for review June 14, 2022 20:12
@alalazo
Copy link
Member Author

alalazo commented Jun 14, 2022

I have another issue to track down, i.e. a system python2 that:

Python 2.7.18 (default, Mar  8 2021, 13:02:45) 
[GCC 9.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from sysconfig import get_paths
>>> get_paths()
{'platinclude': '/usr/local/include/python2.7', 'platstdlib': '/usr/lib/python2.7', 'platlib': '/usr/local/lib/python2.7/dist-packages', 'purelib': '/usr/local/lib/python2.7/dist-packages', 'stdlib': '/usr/lib/python2.7', 'scripts': '/usr/local/bin', 'include': '/usr/local/include/python2.7', 'data': '/usr/local'}

but then install packages under site-packages. But I'll track that in a following PR.

@alalazo
Copy link
Member Author

alalazo commented Jun 16, 2022

@spackbot run pipeline

@spackbot-app
Copy link

spackbot-app bot commented Jun 16, 2022

I've started that pipeline for you!

@alalazo
Copy link
Member Author

alalazo commented Jun 16, 2022

@spackbot run pipeline

@spackbot-app
Copy link

spackbot-app bot commented Jun 16, 2022

I've started that pipeline for you!

@alalazo alalazo merged commit 667c399 into spack:develop Jun 17, 2022
@alalazo alalazo deleted the bootstrap/harden_support_for_setuptools branch June 17, 2022 08:42
bhatiaharsh pushed a commit to bhatiaharsh/spack that referenced this pull request Aug 8, 2022
When installing setuptools from sources in Spack, we might
get into weird failures due to the way we use pip.

In particular, for Spack it's necessary to install in a
non-isolated pip environment to allow using PYTHONPATH as a
selection method for all the build requirements of a
Python package.

This can fail when installing setuptools since there might
be a setuptools version already installed for the Python
interpreter being used, with different entry points than
the one we want to install.

Installing from wheels both pip and setuptools should
harden our installation procedure in the context of:
- Bootstrapping Python dependencies of Spack
- Using external Python packages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants