pip, wheel, setuptools: Make wheels available in SAGE_SPKG_WHEELS
Closed this issue · 15 comments
From #30913:
Currently, pip, wheel, and setuptools are installed without making wheels available in SAGE_SPKG_WHEELS.
In this ticket, we make wheels available in SAGE_SPKG_WHEELS. For the case of setuptools, we create a new spkg setuptools_wheel that takes care of it (it depends on wheel).
This is so that after installation, we have a complete set of wheels for all Python packages installed by the Sage distribution. This allows users to create a venv by installing a compatible set of wheels (whose compiled extensions use the configured libraries in SAGE_LOCAL and the system). The most robust way of doing so is by disabling the use of PyPI (pip install --no-index) so that no incompatible wheels can leak in. (This can be tested using #30913.)
As PEP 517 packages (packages with a pyproject.toml, such as pplpy) are built using build isolation (without access to already installed packages), they need access to their build system packages such as wheel and setuptools. When use of PyPI is disabled, this relies on distributions (either source or wheel) to be available otherwise. On this ticket, we make them available as wheels. (We make pip available as a wheel for completeness.)
CC: @videlec @tobiasdiez @jhpalmieri @kliem
Component: build
Author: Matthias Koeppe
Branch/Commit: 1d19802
Reviewer: John Palmieri
Issue created by migration from https://trac.sagemath.org/ticket/31045
Description changed:
---
+++
@@ -4,6 +4,6 @@
In this ticket, we make wheels (or at least sdists) available in `SAGE_SPKG_WHEELS`.
-This is so that PEP 517 packages such as `pplpy` can be installed themselves even when we don't allow use of PyPI.
+This is so that PEP 517 packages such as `pplpy` can be installed even when we don't allow use of PyPI.
Description changed:
---
+++
@@ -2,7 +2,7 @@
Currently, `pip`, `wheel`, and `setuptools` are installed without making wheels available in `SAGE_SPKG_WHEELS`.
-In this ticket, we make wheels (or at least sdists) available in `SAGE_SPKG_WHEELS`.
+In this ticket, we make wheels available in `SAGE_SPKG_WHEELS`. For the case of `setuptools`, we create a new spkg `setuptools_wheel` that takes care of it (it depends on `wheel`).
This is so that PEP 517 packages such as `pplpy` can be installed even when we don't allow use of PyPI.
Author: Matthias Koeppe
Just out of interest, what is the use case behind "when we don't allow use of PyPI.", i.e. why would you want to do this?
Mainly it's a way to guarantee a fully functional build using only the given version constraints (in install-requires and pyprojects.toml).
Critical for completing the goal of user-defined venvs in Sage 9.3.
Description changed:
---
+++
@@ -4,6 +4,8 @@
In this ticket, we make wheels available in `SAGE_SPKG_WHEELS`. For the case of `setuptools`, we create a new spkg `setuptools_wheel` that takes care of it (it depends on `wheel`).
-This is so that PEP 517 packages such as `pplpy` can be installed even when we don't allow use of PyPI.
+This is so that after installation, we have a complete set of wheels for all Python packages installed by the Sage distribution. This allows users to create a venv by installing a compatible set of wheels (whose compiled extensions use the configured libraries in `SAGE_LOCAL` and the system). The most robust way of doing so is by disabling the use of PyPI (`pip install --no-index`) so that no incompatible wheels can leak in. (This can be tested using #30913.)
+
+As PEP 517 packages (packages with a `pyproject.toml`, such as `pplpy`) are built using build isolation (without access to already installed packages), they need access to their build system packages such as `wheel` and `setuptools`. When use of PyPI is disabled, this relies on distributions (either source or wheel) to be available otherwise. On this ticket, we make them available as wheels. (We make `pip` available as a wheel for completeness.)
Expanded the description, needs review
Reviewer: John Palmieri
This looks okay to me.
Thank you!