Skip to content

Commit

Permalink
sagemathgh-36885: Switch more Python toolchain packages to use (platf…
Browse files Browse the repository at this point in the history
…orm-independent) wheels

    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->
We simplify the Sage distribution by installing more Python packages as
platform-independent wheels.
- No longer use direct installation using the deprecated `setup.py
install`
- `pip` bootstraps itself from its wheel
- `setuptools` is installed as a wheel
- remove the 2nd copy of setuptools (SPKG `setuptools_wheel`)

We also add the build backends `hatchling` and `flit_core` to
`PYTHON_TOOLCHAIN`. This fixes some missing dependencies, including
`editables` (as reported in https://groups.google.com/g/sage-
release/c/uP-rwlM__MU/m/oU-49z9VAwAJ).

The package `deprecation` is no longer used by any package (has it been
... deprecated?) and is removed here.

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->
- Depends on sagemath#36888 (for fixing the html workflow)

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36885
Reported by: Matthias Köppe
Reviewer(s): Dima Pasechnik
  • Loading branch information
Release Manager committed Dec 24, 2023
2 parents 02379f7 + 86105b4 commit a0d60c5
Show file tree
Hide file tree
Showing 94 changed files with 127 additions and 246 deletions.
2 changes: 1 addition & 1 deletion build/bin/sage-dist-helpers
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ sdh_pip_install() {
# Our default after #33789 (Sage 9.7): We allow the package to provision
# its build environment using the stored wheels.
# We pass --find-links.
# The SPKG needs to declare "setuptools_wheel" as a dependency.
# The SPKG needs to declare "setuptools" as a dependency.
build_isolation_option="--find-links=$SAGE_SPKG_WHEELS"
;;
--no-build-isolation)
Expand Down
4 changes: 3 additions & 1 deletion build/bin/sage-spkg
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,9 @@ else
# just copy to dist/ and create a simple install script.
mkdir -p dist
cp "$PKG_SRC" dist/
echo "sdh_store_and_pip_install_wheel ." > spkg-install.in
if [ ! -f spkg-install.in ]; then
echo "sdh_store_and_pip_install_wheel ." > spkg-install.in
fi
;;
*)
# Source tarball
Expand Down
2 changes: 1 addition & 1 deletion build/make/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ all-toolchain: base-toolchain

# Shorthand for a list of packages sufficient for building and installing
# typical Python packages from source. Wheel packages only need pip.
PYTHON_TOOLCHAIN = setuptools pip setuptools_scm wheel setuptools_wheel
PYTHON_TOOLCHAIN = setuptools pip setuptools_scm wheel flit_core hatchling

# Trac #32056: Avoid installed setuptools leaking into the build of python3 by uninstalling it.
# It will have to be reinstalled anyway because of its dependency on $(PYTHON).
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/calver/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
| $(PYTHON_TOOLCHAIN) $(PYTHON)
| pip $(PYTHON)

----------
All lines of this file are ignored except the first.
18 changes: 0 additions & 18 deletions build/pkgs/deprecation/SPKG.rst

This file was deleted.

5 changes: 0 additions & 5 deletions build/pkgs/deprecation/checksums.ini

This file was deleted.

4 changes: 0 additions & 4 deletions build/pkgs/deprecation/dependencies

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/deprecation/distros/conda.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/deprecation/install-requires.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/deprecation/package-version.txt

This file was deleted.

2 changes: 0 additions & 2 deletions build/pkgs/deprecation/spkg-install.in

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/deprecation/type

This file was deleted.

2 changes: 1 addition & 1 deletion build/pkgs/distlib/SPKG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Distribution utilities
License
-------

Python license
PSF-2.0

Upstream Contact
----------------
Expand Down
10 changes: 5 additions & 5 deletions build/pkgs/distlib/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=distlib-VERSION.tar.gz
sha1=5c99f8bd1cc58c387a8d22afa632f81c6fec9993
md5=44e4357e35bbd77fdf1b81e174e34f20
cksum=3690000669
upstream_url=https://pypi.io/packages/source/d/distlib/distlib-VERSION.tar.gz
tarball=distlib-VERSION-py2.py3-none-any.whl
sha1=97ea3bb71040f0348eaea272ec17fefea5806e87
md5=cf336842ba81996e554ae4eb2cd76d5d
cksum=3779817199
upstream_url=https://pypi.io/packages/py2.py3/d/distlib/distlib-VERSION-py2.py3-none-any.whl
2 changes: 1 addition & 1 deletion build/pkgs/distlib/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
| $(PYTHON_TOOLCHAIN) $(PYTHON)
| pip $(PYTHON)

----------
All lines of this file are ignored except the first.
2 changes: 1 addition & 1 deletion build/pkgs/distlib/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.7
0.3.8
2 changes: 0 additions & 2 deletions build/pkgs/distlib/spkg-install.in

This file was deleted.

2 changes: 1 addition & 1 deletion build/pkgs/editables/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
| $(PYTHON_TOOLCHAIN) $(PYTHON)
| flit_core $(PYTHON)

----------
All lines of this file are ignored except the first.
6 changes: 3 additions & 3 deletions build/pkgs/filelock/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=filelock-VERSION-py3-none-any.whl
sha1=74f5368865bf05ddc5b69949e4547ad25c078fc1
md5=63b0f117cb65ef531ffafb566170661e
cksum=1046951951
sha1=f1fa92751023660a10b248f8559d09f3c461403f
md5=d0af0f1a2ee56c24f630ece278cb062f
cksum=3749691502
upstream_url=https://pypi.io/packages/py3/f/filelock/filelock-VERSION-py3-none-any.whl
2 changes: 1 addition & 1 deletion build/pkgs/filelock/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
| $(PYTHON_TOOLCHAIN) $(PYTHON)
| pip $(PYTHON)

----------
All lines of this file are ignored except the first.
2 changes: 1 addition & 1 deletion build/pkgs/filelock/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.12.3
3.13.1
2 changes: 0 additions & 2 deletions build/pkgs/furo/spkg-install.in

This file was deleted.

10 changes: 5 additions & 5 deletions build/pkgs/hatch_fancy_pypi_readme/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=hatch_fancy_pypi_readme-VERSION.tar.gz
sha1=8c8568bb86bdc65133e9d8b27493a464fa3320da
md5=8755cce1a4a4d5e5d84992089801acbf
cksum=2176903739
upstream_url=https://pypi.io/packages/source/h/hatch_fancy_pypi_readme/hatch_fancy_pypi_readme-VERSION.tar.gz
tarball=hatch_fancy_pypi_readme-VERSION-py3-none-any.whl
sha1=4076ea14577b3c711a8345498d8f91b1c8a13d09
md5=d7acd13333f6c71dcbfa62420c7f257b
cksum=1527082323
upstream_url=https://pypi.io/packages/py3/h/hatch_fancy_pypi_readme/hatch_fancy_pypi_readme-VERSION-py3-none-any.whl
2 changes: 1 addition & 1 deletion build/pkgs/hatch_fancy_pypi_readme/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
| $(PYTHON_TOOLCHAIN) hatchling $(PYTHON)
hatchling | pip $(PYTHON)

----------
All lines of this file are ignored except the first.
2 changes: 0 additions & 2 deletions build/pkgs/hatch_fancy_pypi_readme/spkg-install.in

This file was deleted.

2 changes: 2 additions & 0 deletions build/pkgs/hatch_vcs/SPKG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Hatch plugin for versioning with your preferred VCS
License
-------

MIT

Upstream Contact
----------------

Expand Down
10 changes: 5 additions & 5 deletions build/pkgs/hatch_vcs/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=hatch_vcs-VERSION.tar.gz
sha1=026b964066b38fd7e823900817fb9ea7af3f8d9b
md5=c2f2cbe6851b7b2969cb4aa24c4b9b2f
cksum=588874896
upstream_url=https://pypi.io/packages/source/h/hatch_vcs/hatch_vcs-VERSION.tar.gz
tarball=hatch_vcs-VERSION-py3-none-any.whl
sha1=a4da813bf9a745ed2020bf462f4bc19a1ab7fc11
md5=82bee9889b95170e550c98f8dd11bc61
cksum=1575327634
upstream_url=https://pypi.io/packages/py3/h/hatch_vcs/hatch_vcs-VERSION-py3-none-any.whl
2 changes: 1 addition & 1 deletion build/pkgs/hatch_vcs/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
| $(PYTHON_TOOLCHAIN) hatchling $(PYTHON)
hatchling | pip $(PYTHON)

----------
All lines of this file are ignored except the first.
2 changes: 1 addition & 1 deletion build/pkgs/hatch_vcs/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.0
0.4.0
2 changes: 0 additions & 2 deletions build/pkgs/hatch_vcs/spkg-install.in

This file was deleted.

10 changes: 5 additions & 5 deletions build/pkgs/hatchling/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=hatchling-VERSION.tar.gz
sha1=f3db8639e9bee89e2e2420d1bc7a048a910622c9
md5=43f7203cacb6c3c178b93149b8a8151d
cksum=235277633
upstream_url=https://pypi.io/packages/source/h/hatchling/hatchling-VERSION.tar.gz
tarball=hatchling-VERSION-py3-none-any.whl
sha1=aa9d69b9dd820716440252d737a4aeaf9b4e541f
md5=20e5ea4deea21f91759fb2269b71f0dd
cksum=446304413
upstream_url=https://pypi.io/packages/py3/h/hatchling/hatchling-VERSION-py3-none-any.whl
2 changes: 1 addition & 1 deletion build/pkgs/hatchling/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pathspec tomli editables pluggy packaging trove_classifiers | $(PYTHON_TOOLCHAIN) $(PYTHON)
pathspec tomli editables pluggy packaging trove_classifiers | pip $(PYTHON)

----------
All lines of this file are ignored except the first.
2 changes: 1 addition & 1 deletion build/pkgs/hatchling/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.18.0
1.20.0
2 changes: 0 additions & 2 deletions build/pkgs/hatchling/spkg-install.in

This file was deleted.

10 changes: 5 additions & 5 deletions build/pkgs/importlib_metadata/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=importlib_metadata-VERSION.tar.gz
sha1=0e5742cd1d559863573bfb4f6cb7ca9ad8dcf466
md5=c04c814eee1abf42790cfa4bd0454af1
cksum=1038169537
upstream_url=https://pypi.io/packages/source/i/importlib_metadata/importlib_metadata-VERSION.tar.gz
tarball=importlib_metadata-VERSION-py3-none-any.whl
sha1=0e693ba704ac628065bab72a097dad3311213f4b
md5=67eac786f2f9e8bf5879e88ef527250a
cksum=1288292429
upstream_url=https://pypi.io/packages/py3/i/importlib_metadata/importlib_metadata-VERSION-py3-none-any.whl
2 changes: 1 addition & 1 deletion build/pkgs/importlib_metadata/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.8.0
7.0.0
14 changes: 0 additions & 14 deletions build/pkgs/importlib_metadata/spkg-install.in

This file was deleted.

10 changes: 5 additions & 5 deletions build/pkgs/importlib_resources/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=importlib_resources-VERSION.tar.gz
sha1=4af82ed75a1672a45157bfa7d09c4dfd0605802a
md5=525d238db212bdec2df06c0d4b479e73
cksum=1494471486
upstream_url=https://pypi.io/packages/source/i/importlib_resources/importlib_resources-VERSION.tar.gz
tarball=importlib_resources-VERSION-py3-none-any.whl
sha1=5caa4e8a9ee93123a5c3badb6edbc009b5d8494a
md5=a4ba26d808eed58bde249276da04c9e1
cksum=2487282894
upstream_url=https://pypi.io/packages/py3/i/importlib_resources/importlib_resources-VERSION-py3-none-any.whl
2 changes: 1 addition & 1 deletion build/pkgs/importlib_resources/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
zipp | $(PYTHON_TOOLCHAIN) $(PYTHON)
zipp | pip $(PYTHON)

----------
All lines of this file are ignored except the first.
2 changes: 1 addition & 1 deletion build/pkgs/importlib_resources/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.1.0
6.1.1
2 changes: 0 additions & 2 deletions build/pkgs/importlib_resources/spkg-install.in

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/nbconvert/spkg-install.in

This file was deleted.

10 changes: 5 additions & 5 deletions build/pkgs/pathspec/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=pathspec-VERSION.tar.gz
sha1=418ae4112af18af995c0f20a22e5a903b8ce50ae
md5=28c87c3581b10152c4581d10fe33f765
cksum=2161527634
upstream_url=https://pypi.io/packages/source/p/pathspec/pathspec-VERSION.tar.gz
tarball=pathspec-VERSION-py3-none-any.whl
sha1=e31b7b2b1a59ab192eb2e92ac283211a11039769
md5=53caa061bbda861c5b4766f41b084ec8
cksum=1745881358
upstream_url=https://pypi.io/packages/py3/p/pathspec/pathspec-VERSION-py3-none-any.whl
2 changes: 1 addition & 1 deletion build/pkgs/pathspec/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
| $(PYTHON_TOOLCHAIN) $(PYTHON)
| pip $(PYTHON)

----------
All lines of this file are ignored except the first.
2 changes: 1 addition & 1 deletion build/pkgs/pathspec/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.2
0.12.1
2 changes: 0 additions & 2 deletions build/pkgs/pathspec/spkg-install.in

This file was deleted.

10 changes: 5 additions & 5 deletions build/pkgs/pip/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=pip-VERSION.tar.gz
sha1=d1400a4eb662e4741ac68957f47bc97d600743f8
md5=f0c9fba61e9d9badcc9921062e993d84
cksum=309527365
upstream_url=https://pypi.io/packages/source/p/pip/pip-VERSION.tar.gz
tarball=pip-VERSION-py3-none-any.whl
sha1=4b2baddc0673f73017e531648a9ee27e47925e7a
md5=5d2d058044a3ae2800d18e358ddc72ca
cksum=1470281176
upstream_url=https://pypi.io/packages/py3/p/pip/pip-VERSION-py3-none-any.whl
2 changes: 1 addition & 1 deletion build/pkgs/pip/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
setuptools wheel | $(PYTHON)
| $(PYTHON)

----------
All lines of this file are ignored except the first.
15 changes: 5 additions & 10 deletions build/pkgs/pip/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
cd src
# pip can install its own wheel! But first we need to ensure that the
# wheel file is on the PYTHONPATH
export PYTHONPATH=$(pwd)/$(cd dist && for w in *.whl; do cp $w ..; echo $w; break; done)

sdh_setup_bdist_wheel

# 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"

# --ignore-installed makes sure that pip does not mistake
# its own source tree as an existing installation
sdh_store_and_pip_install_wheel --ignore-installed .
# This line is the same as what sage-spkg uses to install the wheel.
sdh_store_and_pip_install_wheel .
6 changes: 2 additions & 4 deletions build/pkgs/pip/spkg-pipinst.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
cd src

# 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"
# wheelfile is on the PYTHONPATH
export PYTHONPATH=$(pwd)/$(echo *.whl)
10 changes: 5 additions & 5 deletions build/pkgs/platformdirs/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=platformdirs-VERSION.tar.gz
sha1=82e215dc9c45eedf9168584fede36d795714f677
md5=a6ba3a442347fac346982acb597c8bf8
cksum=2465457023
upstream_url=https://pypi.io/packages/source/p/platformdirs/platformdirs-VERSION.tar.gz
tarball=platformdirs-VERSION-py3-none-any.whl
sha1=cafa761738da959f2df0a8a92da4c72fd8eaf93e
md5=487007776ff343efc509b68d08cd7fd7
cksum=162426958
upstream_url=https://pypi.io/packages/py3/p/platformdirs/platformdirs-VERSION-py3-none-any.whl
2 changes: 1 addition & 1 deletion build/pkgs/platformdirs/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
setuptools_scm | $(PYTHON_TOOLCHAIN) hatchling hatch_vcs $(PYTHON)
| pip $(PYTHON)

----------
All lines of this file are ignored except the first.
2 changes: 1 addition & 1 deletion build/pkgs/platformdirs/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11.0
4.1.0
2 changes: 0 additions & 2 deletions build/pkgs/platformdirs/spkg-install.in

This file was deleted.

2 changes: 1 addition & 1 deletion build/pkgs/pluggy/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
| $(PYTHON_TOOLCHAIN) $(PYTHON)
| pip $(PYTHON)

----------
All lines of this file are ignored except the first.
2 changes: 1 addition & 1 deletion build/pkgs/referencing/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
attrs | $(PYTHON_TOOLCHAIN) $(PYTHON)
attrs pyrsistent | $(PYTHON_TOOLCHAIN) $(PYTHON)

----------
All lines of this file are ignored except the first.
10 changes: 5 additions & 5 deletions build/pkgs/setuptools/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=setuptools-VERSION.tar.gz
sha1=b0c9b16863c57d70adc22651906eea7eaee09803
md5=d967ca2ba7f46db887daee2d5c9bd6a2
cksum=2346145273
upstream_url=https://pypi.io/packages/source/s/setuptools/setuptools-VERSION.tar.gz
tarball=setuptools-VERSION-py3-none-any.whl
sha1=4227225bb193e3a45542f45966caf777d4c913e8
md5=f096ed836f4036a11aa277fa16dc09ff
cksum=263664173
upstream_url=https://pypi.io/packages/py3/s/setuptools/setuptools-VERSION-py3-none-any.whl
2 changes: 1 addition & 1 deletion build/pkgs/setuptools/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
| $(PYTHON)
| pip $(PYTHON)

----------
All lines of this file are ignored except the first.
2 changes: 1 addition & 1 deletion build/pkgs/setuptools/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
68.2.2
69.0.2
5 changes: 0 additions & 5 deletions build/pkgs/setuptools/spkg-install.in

This file was deleted.

5 changes: 0 additions & 5 deletions build/pkgs/setuptools_wheel/SPKG.rst

This file was deleted.

1 change: 0 additions & 1 deletion build/pkgs/setuptools_wheel/checksums.ini

This file was deleted.

0 comments on commit a0d60c5

Please sign in to comment.