Skip to content

Commit

Permalink
build/bin/sage-get-system-packages: Extract from pyproject.toml [proj…
Browse files Browse the repository at this point in the history
…ect] dependencies, [project.optional-dependencies] too
  • Loading branch information
Matthias Koeppe committed Jun 12, 2024
1 parent c190c9e commit c9c5bd1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions build/bin/sage-get-system-packages
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,12 @@ for PKG_BASE in $SPKGS; do
*pyproject.toml)
SYSTEM_PACKAGES_FILE="$SAGE_ROOT"/$NAME
if [ -f "$SYSTEM_PACKAGES_FILE" ]; then
# Extract from the "requires" block in src/pyproject.toml
# Extract from src/pyproject.toml:
# - from the "[build-system] requires" value
# - from "[project] dependencies",
# - from "[project.optional-dependencies]"
# Packages are in the format "'sage-conf ~= 10.3b3',"
PACKAGE_INFO=$(sed -n '/requires *= *\[/,/^\]/s/^ *'\''\('$PKG_BASE'.*\)'\'',/\1/p' "$SAGE_ROOT/src/pyproject.toml")
PACKAGE_INFO=$(sed -n '/\(requires\|dependencies\|R\) *= *\[/,/^\]/s/^ *'\''\('$PKG_BASE'.*\)'\'',/\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 c9c5bd1

Please sign in to comment.