-
-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #31045: pip, wheel, setuptools: Make wheels available in SAGE_SP…
…KG_WHEELS 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.) URL: https://trac.sagemath.org/31045 Reported by: mkoeppe Ticket author(s): Matthias Koeppe Reviewer(s): John Palmieri
- Loading branch information
Showing
10 changed files
with
47 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,9 @@ | ||
cd src | ||
|
||
sdh_setup_bdist_wheel | ||
|
||
# pip can install itself! But first we need to ensure that the pip | ||
# pip can install its own wheel! But first we need to ensure that the pip | ||
# source directory in on the PYTHONPATH | ||
export PYTHONPATH="$(pwd)/src" | ||
|
||
# need to use --upgrade or --ignore-installed; Otherwise pip, which is | ||
# importing itself, will think itself is already installed | ||
# | ||
versions=3 | ||
|
||
for vers in $versions; do | ||
python${vers} -m pip install --verbose --no-index --ignore-installed \ | ||
--no-build-isolation --isolated --root="$SAGE_DESTDIR" . || \ | ||
sdh_die "Error building / installing pip${vers}" | ||
done | ||
sdh_store_and_pip_install_wheel . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
setuptools_wheel: Build the setuptools package as a wheel | ||
========================================================= | ||
|
||
After installing setuptools and wheel, we build a wheel of setuptools | ||
to complete the set of wheels stored in our wheelhouse. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../setuptools/checksums.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$(PYTHON) setuptools wheel | ||
|
||
---------- | ||
All lines of this file are ignored except the first. | ||
It is copied by SAGE_ROOT/build/make/install into SAGE_ROOT/build/make/Makefile. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# We use this file to mark the package as a Python package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../setuptools/package-version.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
cd src | ||
sdh_setup_bdist_wheel | ||
sdh_store_wheel . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
standard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
cd src | ||
|
||
versions=3 | ||
python3 setup.py --no-user-cfg install \ | ||
--single-version-externally-managed --root="$SAGE_DESTDIR" || \ | ||
sdh_die "Error building / installing package 'wheel'" | ||
|
||
for vers in $versions; do | ||
python${vers} setup.py --no-user-cfg install \ | ||
--single-version-externally-managed --root="$SAGE_DESTDIR" || \ | ||
sdh_die "Error building / installing wheel for Python ${vers}" | ||
done | ||
# Now build a wheel so that we have a complete set of wheels. | ||
|
||
# Because of staging, we cannot use the installed 'wheel' package yet. | ||
export PYTHONPATH="$(pwd)/src" | ||
|
||
sdh_setup_bdist_wheel | ||
sdh_store_wheel . |