Skip to content

Commit 984cf57

Browse files
author
Release Manager
committed
sagemathgh-37430: Refactor `bootstrap`, `bootstrap-conda`, `m4/sage_spkg_collect.m4`, `sage-spkg-info` through `sage --package properties`, `sage-get-system-packages` <!-- ^^^^^ 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 --> Using the command `sage --package properties` added in sagemath#37018, we eliminate some direct references to `build/pkgs/` from various scripts and reduce code duplication in reading SPKG metadata. Using other `sage --package` commands, we also simplify the code for `bootstrap -s` and `bootstrap -D`. Review instructions: Note that there are changes to the `bootstrap`-generated file `m4/sage_spkg_configures.m4`: - The macro `SAGE_SPKG_COLLECT_INIT` is now called explicitly, with an argument (the full list of packages). - Lines such as `m4_define([SPKG_INSTALL_REQUIRES_exceptiongroup], [['exceptiongroup; python_version<\"3.11\"',]])dnl` are added for use by the macro `SAGE_PYTHON_PACKAGE_CHECK` (replacing direct access to `version_requirements.txt` files) <!-- 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". --> This is: - Split out from sagemath#36740 <!-- 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 - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#37430 Reported by: Matthias Köppe Reviewer(s): Julian Rüth, Kwankyu Lee, Matthias Köppe, Tobias Diez
2 parents 1f9b310 + ef04f80 commit 984cf57

6 files changed

+127
-149
lines changed

bootstrap

+43-61
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ cd "$SAGE_ROOT"
2929

3030
export PATH="$SAGE_ROOT/build/bin:$PATH"
3131

32-
PKG=build/pkgs/configure
3332
MAKE="${MAKE:-make}"
34-
CONFVERSION=$(cat $PKG/package-version.txt)
3533

3634

3735
bootstrap () {
@@ -54,6 +52,7 @@ bootstrap () {
5452
for a in m4/sage_spkg_versions.m4 m4/sage_spkg_versions_toml.m4; do
5553
echo 'changequote(`>>>'"'"', `<<<'"')dnl" >> $a
5654
done
55+
eval $(sage-package properties --format=shell :all:)
5756
spkg_configures=""
5857
# initialize SAGE_ENABLE... options for standard packages
5958
for pkgname in $(sage-package list :standard:); do
@@ -62,75 +61,67 @@ AS_VAR_SET_IF([SAGE_ENABLE_$pkgname], [], [AS_VAR_SET([SAGE_ENABLE_$pkgname], [y
6261
done
6362
# --enable-SPKG options
6463
for pkgname in $(sage-package list :optional: :experimental:); do
64+
eval DIR=\$path_$pkgname pkgtype=\$type_$pkgname pkgsource=\$source_$pkgname
65+
case "$pkgname:$pkgsource" in
66+
*:pip)
6567
# Issue #29629: Temporary solution for Sage 9.1: Do not provide
6668
# --enable-SPKG options for installing pip packages
67-
if [ ! -f build/pkgs/$pkgname/requirements.txt ]; then
68-
pkgtype="$(cat build/pkgs/$pkgname/type)"
69-
# Issue #29124: Do not provide --enable-_recommended and similar
70-
case "$pkgname" in
71-
_*) ;;
72-
*) spkg_configures="$spkg_configures
69+
;;
70+
_*:*)
71+
# Issue #29124: Do not provide --enable-_recommended and similar
72+
;;
73+
*:none)
74+
# Issue #31163: Just an optional dummy package
75+
spkg_configures="$spkg_configures
7376
AC_SUBST(SAGE_ENABLE_$pkgname, [if_installed])"
74-
if [ -f build/pkgs/$pkgname/spkg-install -o -f build/pkgs/$pkgname/spkg-install.in ]; then
75-
# Issue #31163: Not just an optional dummy package
76-
spkg_configures="$spkg_configures
77-
SAGE_SPKG_ENABLE([$pkgname], [$pkgtype], [$(grep -v ^= build/pkgs/$pkgname/SPKG.rst | head -n1 2>/dev/null || echo $pkgname)])"
78-
fi
79-
;;
80-
esac
81-
fi
77+
;;
78+
*:*)
79+
spkg_configures="$spkg_configures
80+
AC_SUBST(SAGE_ENABLE_$pkgname, [if_installed])"
81+
spkg_configures="$spkg_configures
82+
SAGE_SPKG_ENABLE([$pkgname], [$pkgtype], [$(grep -v ^= "$DIR/SPKG.rst" | head -n1 2>/dev/null || echo $pkgname)])"
83+
;;
84+
esac
8285
done
86+
cat >> m4/sage_spkg_configures.m4 <<EOF
87+
SAGE_SPKG_COLLECT_INIT([$(echo $(sage-package list))])
88+
EOF
8389
for pkgname in $(sage-package list --has-file spkg-configure.m4); do
84-
echo "m4_sinclude([build/pkgs/$pkgname/spkg-configure.m4])"
90+
eval DIR=\$path_$pkgname
91+
echo "m4_sinclude([$DIR/spkg-configure.m4])"
8592
config="SAGE_SPKG_CONFIGURE_$(echo ${pkgname} | tr '[a-z]' '[A-Z]')"
86-
if grep -q SAGE_PYTHON_PACKAGE_CHECK build/pkgs/$pkgname/spkg-configure.m4; then
93+
if grep -q SAGE_PYTHON_PACKAGE_CHECK "$DIR/spkg-configure.m4"; then
8794
spkg_configures_python="$spkg_configures_python
8895
$config"
8996
else
9097
spkg_configures="$spkg_configures
9198
$config"
9299
fi
93100
done >> m4/sage_spkg_configures.m4
94-
cat >> m4/sage_spkg_configures.m4 <<EOF
95-
$spkg_configures
96-
$spkg_configures_python
97-
EOF
98101
for pkgname in $(sage-package list); do
99-
DIR=build/pkgs/$pkgname
100-
pkgtype="$(cat $DIR/type)"
101-
if test -f "$DIR/requirements.txt"; then
102-
SPKG_SOURCE=pip
103-
elif test ! -f "$DIR/checksums.ini"; then
104-
if test -f "$DIR/spkg-install" -o -f "$DIR/spkg-install.in"; then
105-
SPKG_SOURCE=script
106-
else
107-
# a dummy package
108-
SPKG_SOURCE=none
109-
fi
110-
else
111-
SPKG_SOURCE=normal
112-
fi
113-
if test -f "$DIR/trees.txt"; then
114-
SPKG_TREE_VAR="$(sed "s/#.*//;" "$DIR/trees.txt")"
115-
else
116-
SPKG_TREE_VAR=SAGE_LOCAL
117-
if test -f "$DIR/requirements.txt" -o -f "$DIR/version_requirements.txt"; then
118-
# A Python package
119-
SPKG_TREE_VAR=SAGE_VENV
120-
echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions.m4
121-
echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires-toml ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions_toml.m4
122-
fi
102+
eval DIR=\$path_$pkgname pkgtype=\$type_$pkgname SPKG_SOURCE=\$source_$pkgname SPKG_TREE_VAR=\$trees_$pkgname
103+
if test -f "$DIR/requirements.txt" -o -f "$DIR/version_requirements.txt"; then
104+
# A Python package
105+
echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions.m4
106+
INSTALL_REQUIRES_TOML=
107+
echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires-toml ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions_toml.m4
108+
echo "m4_define([SPKG_INSTALL_REQUIRES_${pkgname}], [[$(echo $(sage-get-system-packages install-requires-toml ${pkgname} | sed 's/"/\\"/g'))]])dnl" >> m4/sage_spkg_configures.m4
123109
fi
124110
spkg_finalizes="$spkg_finalizes
125111
SAGE_SPKG_FINALIZE([$pkgname], [$pkgtype], [$SPKG_SOURCE], [$SPKG_TREE_VAR])"
126112
done
127-
echo "$spkg_finalizes" >> m4/sage_spkg_configures.m4
128113
for a in m4/sage_spkg_versions.m4 m4/sage_spkg_versions_toml.m4; do
129114
echo 'changequote(>>>`<<<, >>>'"'"'<<<)dnl' >> $a
130115
done
116+
cat >> m4/sage_spkg_configures.m4 <<EOF
117+
$spkg_configures
118+
$spkg_configures_python
119+
$spkg_finalizes
120+
EOF
131121

132122
for pkgname in $(sage-package list --has-file bootstrap "$@"); do
133-
(cd build/pkgs/$pkgname && if [ -x bootstrap ]; then ./bootstrap; else echo >&2 "bootstrap:$LINENO: Nothing to do for $pkgname"; fi) || exit 1
123+
eval DIR=\$path_$pkgname
124+
(cd "$DIR" && if [ -x bootstrap ]; then ./bootstrap; else echo >&2 "bootstrap:$LINENO: Nothing to do for $pkgname"; fi) || exit 1
134125
done
135126

136127
if [ $# != 0 ]; then
@@ -196,10 +187,10 @@ SAGE_SPKG_FINALIZE([$pkgname], [$pkgtype], [$SPKG_SOURCE], [$SPKG_TREE_VAR])"
196187
bootstrap_download () {
197188
SAGE_DL_LOGLEVEL=""
198189
[ "${BOOTSTRAP_QUIET}" = "yes" ] && SAGE_DL_LOGLEVEL="--log=WARNING"
199-
sage-download-file ${SAGE_DL_LOGLEVEL} configure-$CONFVERSION.tar.gz
200190

191+
CONFBALL=$(sage-package download $SAGE_DL_LOGLEVEL configure)
201192
if [ $? -ne 0 ]; then
202-
echo >&2 "Error: downloading configure-$CONFVERSION.tar.gz failed"
193+
echo >&2 "Error: downloading configure tarball failed"
203194
exit 1
204195
fi
205196

@@ -255,16 +246,8 @@ save () {
255246
build/pkgs/setuptools/version_requirements.txt \
256247
build/pkgs/wheel/version_requirements.txt
257248

258-
# Update version
259-
echo "$NEWCONFVERSION" >$PKG/package-version.txt
260-
261-
# Compute checksum
262-
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
263-
sage-package fix-checksum configure
264-
else
265-
# Hide the "Updating checksum..." message
266-
sage-package fix-checksum configure > /dev/null
267-
fi
249+
# Update version; this re-computes the checksum
250+
sage-package update configure "$NEWCONFVERSION"
268251
}
269252

270253

@@ -304,7 +287,6 @@ do
304287
done
305288
shift $(($OPTIND - 1))
306289
export BOOTSTRAP_QUIET
307-
CONFBALL="upstream/configure-$CONFVERSION.tar.gz"
308290

309291
if [ $DOWNLOAD$SAVE = yesyes ]; then
310292
echo >&2 "$0: refusing to download and save."

bootstrap-conda

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ SAGELIB_PACKAGES=
1818
SAGELIB_OPTIONAL_PACKAGES=
1919
DEVELOP_PACKAGES=
2020

21+
eval $(sage-package properties --format=shell :all:)
22+
2123
for PKG_BASE in $(sage-package list --has-file distros/conda.txt --exclude _sagemath); do
22-
PKG_SCRIPTS=build/pkgs/$PKG_BASE
24+
eval PKG_SCRIPTS=\$path_$PKG_BASE PKG_TYPE=\$type_$PKG_BASE
2325
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/distros/conda.txt
24-
PKG_TYPE=$(cat $PKG_SCRIPTS/type)
2526
PKG_SYSTEM_PACKAGES=$(echo $(${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE))
2627
if [ -n "$PKG_SYSTEM_PACKAGES" ]; then
2728
if [ -f $PKG_SCRIPTS/spkg-configure.m4 ]; then
@@ -133,12 +134,11 @@ echo >&2 $0:$LINENO: generate conda environment files
133134
echo >&4 " - pip:"
134135
echo >&5 " - pip:"
135136
for PKG_BASE in $(sage-package list :standard: :optional: --has-file requirements.txt --no-file distros/conda.txt --no-file src; sage-package list :standard: :optional: --has-file version_requirements.txt --no-file requirements.txt --no-file distros/conda.txt --no-file src); do
136-
PKG_SCRIPTS=build/pkgs/$PKG_BASE
137+
eval PKG_SCRIPTS=\$path_$PKG_BASE PKG_TYPE=\$type_$PKG_BASE
137138
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/requirements.txt
138139
if [ ! -f $SYSTEM_PACKAGES_FILE ]; then
139140
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/version_requirements.txt
140141
fi
141-
PKG_TYPE=$(cat $PKG_SCRIPTS/type)
142142
if grep -q SAGERUNTIME $PKG_SCRIPTS/dependencies $PKG_SCRIPTS/dependencies_order_only 2>/dev/null; then
143143
: # cannot install packages that depend on the Sage library
144144
else

build/bin/sage-get-system-packages

+51-31
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,40 @@ fi
1515
case "$SYSTEM" in
1616
install-requires)
1717
# Collect from src/pyproject.toml or from version_requirements.txt (falling back to requirements.txt) and output it in the format
18-
# needed by setup.cfg [options] version_requirements=
19-
SYSTEM_PACKAGES_FILE_NAMES="version_requirements.txt requirements.txt"
20-
STRIP_COMMENTS="sed s/#.*//;/^[[:space:]]*$/d;"
21-
FROM_PYPROJECT_TOML=1
18+
# needed by setup.cfg [options] install_requires=
19+
SYSTEM_PACKAGES_FILE_NAMES="src/pyproject.toml version_requirements.txt requirements.txt"
20+
# also normalizes quotes from "" to ''.
21+
STRIP_COMMENTS="sed s/#.*//;/^[[:space:]]*$/d;s/\"/'/g;"
2222
COLLECT=
2323
;;
2424
install-requires-toml)
2525
# Collect from src/pyproject.toml or from version_requirements.txt (falling back to requirements.txt) and output it in the format
2626
# needed by pyproject.toml [build-system] requires=
27-
SYSTEM_PACKAGES_FILE_NAMES="version_requirements.txt requirements.txt"
28-
STRIP_COMMENTS="sed s/#.*//;/^[[:space:]]*$/d;s/^/'/;s/$/',/;"
29-
FROM_PYPROJECT_TOML=1
27+
SYSTEM_PACKAGES_FILE_NAMES="src/pyproject.toml version_requirements.txt requirements.txt"
28+
# also normalizes quotes from '' to "".
29+
STRIP_COMMENTS="sed s/#.*//;/^[[:space:]]*$/d;s/'/\"/g;s/^/'/;s/$/',/;"
3030
COLLECT=
3131
;;
3232
pip)
33-
SYSTEM_PACKAGES_FILE_NAMES="requirements.txt version_requirements.txt"
33+
SYSTEM_PACKAGES_FILE_NAMES="requirements.txt src/pyproject.toml version_requirements.txt"
3434
STRIP_COMMENTS='sed s/#.*//;s/[[:space:]]//g;'
35-
FROM_PYPROJECT_TOML=1
3635
COLLECT=echo
3736
;;
37+
versions)
38+
# For use in sage-spkg-info
39+
SYSTEM_PACKAGES_FILE_NAMES="package-version.txt requirements.txt src/pyproject.toml version_requirements.txt"
40+
strip_comments () {
41+
TEXT=$(sed "s/#.*//;/^[[:space:]]*$/d;s/\"/'/g;s/^/ /;" "$@")
42+
if [ -n "$(echo $TEXT)" ]; then
43+
echo "$NAME::"
44+
echo
45+
echo "$TEXT"
46+
echo
47+
fi
48+
}
49+
STRIP_COMMENTS=strip_comments
50+
COLLECT=
51+
;;
3852
*)
3953
if [ "$SYSTEM" = auto ]; then
4054
SYSTEM=$(sage-guess-package-system 2>/dev/null)
@@ -45,7 +59,6 @@ case "$SYSTEM" in
4559
fi
4660
SYSTEM_PACKAGES_FILE_NAMES="distros/$SYSTEM.txt"
4761
STRIP_COMMENTS="sed s/#.*//;s/\${PYTHON_MINOR}/${PYTHON_MINOR}/g"
48-
FROM_PYPROJECT_TOML=0
4962
COLLECT=echo
5063
;;
5164
esac
@@ -57,19 +70,10 @@ case "$SPKGS" in
5770
esac
5871

5972
for PKG_BASE in $SPKGS; do
60-
if [ $FROM_PYPROJECT_TOML -eq 1 ]; then
61-
if [ -f "$SAGE_ROOT/src/pyproject.toml" ]; then
62-
# Extract from the "requires" block in src/pyproject.toml
63-
# Packages are in the format "'sage-conf ~= 10.3b3',"
64-
PACKAGE_INFO=$(sed -n '/requires *= *\[/,/^\]/s/^ *'\''\('$PKG_BASE'.*\)'\'',/\1/p' "$SAGE_ROOT/src/pyproject.toml")
65-
if [ -n "$PACKAGE_INFO" ]; then
66-
echo "$PACKAGE_INFO" | ${STRIP_COMMENTS}
67-
continue
68-
fi
69-
fi
70-
fi
71-
7273
case "$SYSTEM:$ENABLE_SYSTEM_SITE_PACKAGES" in
74+
versions*)
75+
# Show everything.
76+
;;
7377
install-requires*|pip*)
7478
# This is output for installation of packages into a Python environment.
7579
# So it's OK to use any Python packages.
@@ -93,14 +97,30 @@ for PKG_BASE in $SPKGS; do
9397
esac
9498

9599
for NAME in $SYSTEM_PACKAGES_FILE_NAMES; do
96-
SYSTEM_PACKAGES_FILE="$SAGE_ROOT"/build/pkgs/$PKG_BASE/$NAME
97-
if [ -f $SYSTEM_PACKAGES_FILE ]; then
98-
if [ -z "$COLLECT" ]; then
99-
${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE
100-
else
101-
$COLLECT $(${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE)
102-
fi
103-
break
104-
fi
100+
case $NAME in
101+
*pyproject.toml)
102+
SYSTEM_PACKAGES_FILE="$SAGE_ROOT"/$NAME
103+
if [ -f "$SYSTEM_PACKAGES_FILE" ]; then
104+
# Extract from the "requires" block in src/pyproject.toml
105+
# Packages are in the format "'sage-conf ~= 10.3b3',"
106+
PACKAGE_INFO=$(sed -n '/requires *= *\[/,/^\]/s/^ *'\''\('$PKG_BASE'.*\)'\'',/\1/p' "$SAGE_ROOT/src/pyproject.toml")
107+
if [ -n "$PACKAGE_INFO" ]; then
108+
echo "$PACKAGE_INFO" | ${STRIP_COMMENTS}
109+
[ $SYSTEM = versions ] || break
110+
fi
111+
fi
112+
;;
113+
*)
114+
SYSTEM_PACKAGES_FILE="$SAGE_ROOT"/build/pkgs/$PKG_BASE/$NAME
115+
if [ -f $SYSTEM_PACKAGES_FILE ]; then
116+
if [ -z "$COLLECT" ]; then
117+
${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE
118+
else
119+
$COLLECT $(${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE)
120+
fi
121+
[ $SYSTEM = versions ] || break
122+
fi
123+
;;
124+
esac
105125
done
106126
done

build/bin/sage-spkg-info

+1-8
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,7 @@ echo
5454
echo "Version Information"
5555
echo "-------------------"
5656
echo
57-
for a in package-version.txt requirements.txt version_requirements.txt; do
58-
if [ -f "$PKG_SCRIPTS"/"$a" ]; then
59-
echo "$a::"
60-
echo
61-
sed 's/^/ /' "$PKG_SCRIPTS/$a"
62-
echo
63-
fi
64-
done
57+
sage-get-system-packages versions $PKG_BASE
6558
echo
6659
echo "Equivalent System Packages"
6760
echo "--------------------------"

m4/sage_python_package_check.m4

+13-24
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# Determine if the system copy of a python package can be used by sage.
99
#
1010
# This macro uses setuptools.version's pkg_resources to check that the
11-
# "version_requirements.txt" file for the named package is satisfied, and
12-
# it can typically fail in four ways:
11+
# "version_requirements.txt" file (or entry in "src/pyproject.toml") for
12+
# the named package is satisfied, and it can typically fail in four ways:
1313
#
1414
# 1. If --enable-system-site-packages was not passed to ./configure,
1515
#
@@ -19,8 +19,9 @@
1919
#
2020
# 4. If setuptools is not available to the system python,
2121
#
22-
# 5. If the contents of version_requirements.txt are not met (wrong
23-
# version, no version, etc.) by the system python.
22+
# 5. If the contents of version_requirements.txt (or entry in
23+
# "src/pyproject.toml") are not met (wrong version, no version,
24+
# etc.) by the system python.
2425
#
2526
# In any of those cases, we set sage_spkg_install_$package to "yes"
2627
# so that the corresponding SPKG is installed. Otherwise, we do
@@ -56,29 +57,17 @@ AC_DEFUN([SAGE_PYTHON_PACKAGE_CHECK], [
5657
config.venv dnl
5758
2>&AS_MESSAGE_LOG_FD], [
5859
AC_MSG_RESULT(yes)
59-
dnl strip all comments from version_requirements.txt; this should leave
60-
dnl only a single line containing the version specification for this
61-
dnl package. Afterwards, convert all double-quotes to single quotes.
62-
dnl Both work, but only single quotes are documented. However, at the
63-
dnl time of writing, double quotes are more compatible with our toml
64-
dnl generation in ./bootstrap. Converting them from double- to single-
65-
dnl quotes on-the-fly here lets us support both (in this macro, at
66-
dnl least).
67-
SAGE_PKG_VERSPEC=$(sed \
68-
-e '/^#/d' \
69-
-e "s/\"/'/g" \
70-
"./build/pkgs/$1/version_requirements.txt"
71-
)
72-
AC_MSG_CHECKING([for python package $1 ("${SAGE_PKG_VERSPEC}")])
60+
dnl SAGE_PKG_VERSPEC is in the format of a toml list, but
61+
dnl without surrounding brackets, of single-quoted strings,
62+
dnl with any double-quotes escaped by backslash.
63+
AS_VAR_SET([SAGE_PKG_VERSPEC], ["SPKG_INSTALL_REQUIRES_]$1["])
64+
AC_MSG_CHECKING([for python package $1 (${SAGE_PKG_VERSPEC%,})])
7365
7466
WITH_SAGE_PYTHONUSERBASE([dnl
75-
dnl double-quote SAGE_PKG_VERSPEC because platform-specific
76-
dnl dependencies like python_version<'3.11' will have single
77-
dnl quotes in them. (We normalized the quotes earlier with sed.)
7867
AS_IF(
79-
[config.venv/bin/python3 -c dnl
80-
"import pkg_resources; dnl
81-
pkg_resources.require(\"${SAGE_PKG_VERSPEC}\".splitlines())" dnl
68+
[config.venv/bin/python3 -c dnl
69+
"import pkg_resources; dnl
70+
pkg_resources.require((${SAGE_PKG_VERSPEC}))" dnl
8271
2>&AS_MESSAGE_LOG_FD],
8372
[AC_MSG_RESULT(yes)],
8473
[AC_MSG_RESULT(no); sage_spkg_install_$1=yes]

0 commit comments

Comments
 (0)