Skip to content

Commit

Permalink
build/bin/sage-get-system-packages: When scanning pyproject.toml for …
Browse files Browse the repository at this point in the history
…package names, treat dashes and underscores as equivalent
  • Loading branch information
Matthias Koeppe committed Jun 12, 2024
1 parent c9c5bd1 commit 59f7215
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build/bin/sage-get-system-packages
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ for PKG_BASE in $SPKGS; do
# - from "[project] dependencies",
# - from "[project.optional-dependencies]"
# Packages are in the format "'sage-conf ~= 10.3b3',"
PACKAGE_INFO=$(sed -n '/\(requires\|dependencies\|R\) *= *\[/,/^\]/s/^ *'\''\('$PKG_BASE'.*\)'\'',/\1/p' "$SAGE_ROOT/src/pyproject.toml")
# Accept dashes and underscores in package names as equivalent:
PKG_REGEX=$(echo $PKG_BASE | sed 's/[-_]/[-_]/g')
PACKAGE_INFO=$(sed -En '/(requires|dependencies|R) *= *\[/,/^\]/s/^ *'\''('$PKG_REGEX'.*)'\'',/\1/p' "$SAGE_ROOT/src/pyproject.toml")
if [ -n "$PACKAGE_INFO" ]; then
echo "$PACKAGE_INFO" | ${STRIP_COMMENTS}
[ $SYSTEM = versions ] || break
Expand Down

0 comments on commit 59f7215

Please sign in to comment.