Skip to content

Commit 338a8ea

Browse files
author
Release Manager
committed
gh-36979: Fix `sage-get-system-packages install-requires` after #29665 Currently broken (since #29665): ``` $ build/bin/sage-get-system-packages install-requires zipp $ build/bin/sage-get-system-packages install-requires-toml zipp ``` This causes `pkgs/sagemath-standard/pyproject.toml` to be broken; as noted in #36964 (comment) The correct output: ``` $ build/bin/sage-get-system-packages install-requires zipp zipp >=0.5.2 $ build/bin/sage-get-system-packages install-requires-toml zipp 'zipp >=0.5.2', ``` <!-- ^^^^^ 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 #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- 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 #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. - [x] 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 - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #36979 Reported by: Matthias Köppe Reviewer(s): Michael Orlitzky
2 parents 795a40e + 00ab9a3 commit 338a8ea

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

bootstrap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ EOF
108108
if test -f "$DIR/requirements.txt" -o -f "$DIR/install-requires.txt"; then
109109
# A Python package
110110
SPKG_TREE_VAR=SAGE_VENV
111-
echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(ENABLE_SYSTEM_SITE_PACKAGES=yes sage-get-system-packages install-requires ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions.m4
112-
echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(ENABLE_SYSTEM_SITE_PACKAGES=yes sage-get-system-packages install-requires-toml ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions_toml.m4
111+
echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions.m4
112+
echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires-toml ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions_toml.m4
113113
fi
114114
fi
115115
spkg_finalizes="$spkg_finalizes

build/bin/sage-get-system-packages

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,28 @@ case "$SYSTEM" in
4747
esac
4848
for PKG_BASE in $SPKGS; do
4949

50-
# Skip this package if it uses the SAGE_PYTHON_PACKAGE_CHECK
51-
# macro and if --enable-system-site-packages was NOT passed
52-
# to ./configure (or if ./configure has not yet been run).
53-
SPKG_CONFIGURE="${SAGE_ROOT}/build/pkgs/${PKG_BASE}/spkg-configure.m4"
54-
if [ -z "${ENABLE_SYSTEM_SITE_PACKAGES}" ]; then
55-
if grep -q SAGE_PYTHON_PACKAGE_CHECK "${SPKG_CONFIGURE}" 2>/dev/null;
56-
then
57-
continue;
58-
fi
59-
fi
50+
case "$SYSTEM:$ENABLE_SYSTEM_SITE_PACKAGES" in
51+
install-requires*|pip*)
52+
# This is output for installation of packages into a Python environment.
53+
# So it's OK to use any Python packages.
54+
;;
55+
*:)
56+
# --enable-system-site-packages was NOT passed to configure
57+
# (or script was run outside of the sage-build-env).
58+
#
59+
# Skip this package if it uses the SAGE_PYTHON_PACKAGE_CHECK macro.
60+
#
61+
SPKG_CONFIGURE="${SAGE_ROOT}/build/pkgs/${PKG_BASE}/spkg-configure.m4"
62+
if grep -q SAGE_PYTHON_PACKAGE_CHECK "${SPKG_CONFIGURE}" 2>/dev/null;
63+
then
64+
continue
65+
fi
66+
;;
67+
*)
68+
# --enable-system-site-packages was passed to configure.
69+
# So any package (Python, non-Python) is fine.
70+
;;
71+
esac
6072

6173
for NAME in $SYSTEM_PACKAGES_FILE_NAMES; do
6274
SYSTEM_PACKAGES_FILE="$SAGE_ROOT"/build/pkgs/$PKG_BASE/$NAME

0 commit comments

Comments
 (0)