Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add # sage_setup: distribution directives to all files #37901

Open
wants to merge 104 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
30e012f
src/pyproject.toml.m4: Merge all metadata from src/setup.cfg.m4, remo…
mkoeppe Dec 23, 2023
e4b376b
Set up all__sage_categories.py
mkoeppe Jun 29, 2020
a960393
sage.*.all*: Update from #35095
mkoeppe Nov 8, 2023
2a71fe1
relative to absolute imports
mkoeppe Nov 8, 2023
0b7f892
Fixups in .all*
mkoeppe Nov 8, 2023
6a8f404
Reverts
mkoeppe Nov 8, 2023
c791f78
Restores
mkoeppe Nov 8, 2023
366035e
src/sage/misc/dev_tools.py: Update doctest output
mkoeppe Nov 9, 2023
a96f570
src/sage/misc/sageinspect.py: Update doctests for increased use of la…
mkoeppe Nov 9, 2023
c749f35
Defer some changes to all__sagemath_{objects,categories} until #36566
mkoeppe Nov 9, 2023
563a3f2
sage -fixdoctests --no-test --distribution sagemath_categories --upda…
mkoeppe Nov 10, 2023
22395ae
Defer some changes to all__sagemath_repl until #36566
mkoeppe Nov 10, 2023
7de8387
src/sage/calculus/all.py: Move 'symbolic_expression' to new module .expr
mkoeppe Nov 10, 2023
e411118
for a in $(git --no-pager grep -l lazy_import src/sage/**/all*.py); d…
mkoeppe Nov 11, 2023
7a07f69
Manual fixes re 'del lazy_import'
mkoeppe Nov 11, 2023
dfc6cca
autopep8 --in-place --ignore E402 --max-line-length=88 src/sage/**/al…
mkoeppe Nov 12, 2023
a7fdfc9
sed -i.bak 's,http:,https:,g' src/sage/**/all*.py
mkoeppe Nov 12, 2023
e630e90
Fix errors from 'sage -tox -e pycodestyle -- --ignore E402 src/sage/*…
mkoeppe Nov 12, 2023
bcc7137
src/doc/en/reference/calculus/index.rst: Add sage.calculus.expr to to…
mkoeppe Nov 13, 2023
80d33ee
src/sage/calculus/expr.py: Move imports from method to module
mkoeppe Nov 13, 2023
49a508d
for a in $(git --no-pager grep -l install_doc src/sage/**/all*.py); d…
mkoeppe Nov 13, 2023
91ad68f
src/sage/combinat/all.py: Also del install_dict
mkoeppe Nov 13, 2023
e9f86a0
src/sage/rings/all__sagemath_categories.py: Add import of lazy_import
mkoeppe Mar 14, 2024
2c6dd83
Fixup changes to reestablish #36676
saraedum Apr 14, 2024
aaff425
sage.*.all*: Update from #35095
mkoeppe Nov 8, 2023
966bfb2
relative to absolute imports
mkoeppe Nov 8, 2023
f0a9936
Fixups in .all*
mkoeppe Nov 8, 2023
9841731
Reverts
mkoeppe Nov 8, 2023
2cef186
Restores
mkoeppe Nov 8, 2023
4d08e0b
Restores
mkoeppe Nov 8, 2023
4bfd114
src/sage/combinat/all__sagemath_combinat.py: pycodestyle fix (whitesp…
mkoeppe Nov 8, 2023
1361c65
src/sage/misc/dev_tools.py: Update doctest output
mkoeppe Nov 9, 2023
8ae157a
src/sage/misc/sageinspect.py: Update doctests for increased use of la…
mkoeppe Nov 9, 2023
113d34d
Defer some changes to all__sagemath_{objects,categories} until #36566
mkoeppe Nov 9, 2023
4c53093
src/sage/rings/all.py: Reorder imports
mkoeppe Nov 10, 2023
f2b24cb
sage -fixdoctests --no-test --distribution sagemath_categories --upda…
mkoeppe Nov 10, 2023
4d36d9c
Defer some changes to all__sagemath_repl until #36566
mkoeppe Nov 10, 2023
33aeb2c
src/sage/combinat/all__sagemath_combinat.py: one more relative to abs…
mkoeppe Nov 10, 2023
01039f7
src/sage/calculus/all.py: Move import to top
mkoeppe Nov 10, 2023
6f58f59
src/sage/calculus/all.py: Move 'symbolic_expression' to new module .expr
mkoeppe Nov 10, 2023
b423aab
for a in $(git --no-pager grep -l lazy_import src/sage/**/all*.py); d…
mkoeppe Nov 11, 2023
ded3be7
Manual fixes re 'del lazy_import'
mkoeppe Nov 11, 2023
cdf3655
autopep8 --in-place --ignore E402 --max-line-length=88 src/sage/**/al…
mkoeppe Nov 12, 2023
deca050
sed -i.bak 's,http:,https:,g' src/sage/**/all*.py
mkoeppe Nov 12, 2023
997614a
Fix errors from 'sage -tox -e pycodestyle -- --ignore E402 src/sage/*…
mkoeppe Nov 12, 2023
f0c7025
src/doc/en/reference/calculus/index.rst: Add sage.calculus.expr to to…
mkoeppe Nov 13, 2023
7175d41
src/sage/calculus/expr.py: Move imports from method to module
mkoeppe Nov 13, 2023
b5c6a3f
for a in $(git --no-pager grep -l install_doc src/sage/**/all*.py); d…
mkoeppe Nov 13, 2023
8c0bda8
src/sage/combinat/all.py: Also del install_dict
mkoeppe Nov 13, 2023
a62ad93
src/pyproject.toml.m4: Merge all metadata from src/setup.cfg.m4, remo…
mkoeppe Dec 23, 2023
6607780
build/bin/sage-get-system-packages (install-requires[-toml], pip): Do…
mkoeppe Dec 29, 2023
c6b245e
build/bin/sage-get-system-packages: Add/update comments
mkoeppe Dec 31, 2023
663a5e5
src/sage/misc/package_dir.py (read_distribution): Don't fail on FileN…
mkoeppe Dec 25, 2023
7bf8816
pkgs/sagemath-standard/setup.py: Handle added distributions
mkoeppe Dec 25, 2023
3c2e590
Update output of self-referential doctests
mkoeppe Dec 26, 2023
202e442
Run 'make pypi-sdists && ./sage -fixdistributions --set all --from-eg…
mkoeppe Dec 26, 2023
a8424d0
grep -l 'coding: *utf-8' src/sage | xargs sed -i.bak '/^#.*coding: *u…
mkoeppe Dec 26, 2023
1a1aae5
Fixups
mkoeppe Dec 26, 2023
0f643be
src/sage_setup/find.py: Relax a doctest
mkoeppe Dec 27, 2023
f78fdb5
pkgs/sagemath-standard/setup.py: Conditionalize source discovery - no…
mkoeppe Dec 29, 2023
e6449b6
Fix doctests of is_package_or_sage_namespace_package_dir for multiple…
mkoeppe Dec 30, 2023
80d8cc6
src/sage/rings/all__sagemath_categories.py: Add import of lazy_import
mkoeppe Mar 14, 2024
29e7d6e
Merge branch '36951' into 36964
saraedum Apr 14, 2024
a4078f0
Merge branch '36676' into 36964
saraedum Apr 14, 2024
f8cda25
Merge remote-tracking branch 'origin/develop' into 36676
saraedum Apr 28, 2024
df78533
Merge remote-tracking branch 'origin/develop' into 36964
saraedum Apr 28, 2024
c84b064
src/MANIFEST.in: graft sage
mkoeppe Apr 15, 2024
a05e957
src/MANIFEST.in: Fix 'exclude' line for tdlib
mkoeppe May 1, 2024
ac36cbc
Merge tag '10.4.beta5' into 36676
mkoeppe May 12, 2024
db9c848
m4/sage_spkg_collect.m4: Handle wheel packages like normal packages
mkoeppe Nov 19, 2023
71a6980
m4/sage_spkg_collect.m4: Use 'sage-package properties' to get versions
mkoeppe Feb 22, 2024
d6a91d2
bootstrap: Simplify by using 'sage-package properties'
mkoeppe Apr 9, 2024
fb3962b
m4/sage_spkg_collect.m4: Fix handling of missing package dirs (test: …
mkoeppe Feb 22, 2024
b348283
Repair 'bootstrap -D'
mkoeppe Feb 22, 2024
ebc9ebf
bootstrap: Use 'sage -package update' to update the configure tarball…
mkoeppe Feb 22, 2024
5195d13
bootstrap -D: Simplify using 'sage-package download'
mkoeppe Feb 22, 2024
c2594fb
bootstrap: Remove use of CONFVERSION
mkoeppe Mar 8, 2024
048d891
m4/sage_python_package_check.m4: Replace direct access to version_req…
mkoeppe May 14, 2024
2ef4beb
build/bin/sage-get-system-packages: Restore correct search order for …
mkoeppe May 14, 2024
6ee000b
build/bin/sage-spkg-info: Show versions using new command 'sage-get-s…
mkoeppe May 14, 2024
6a3047e
m4/sage_python_package_check.m4: Update doc to mention src/pyproject.…
mkoeppe May 14, 2024
934f9cf
Merge branch 'fix_ci_linux' into 36951
mkoeppe May 17, 2024
7ba97e7
Merge branch 'bootstrap_use_sage_package_properties' into 36951
mkoeppe May 17, 2024
0280c38
src/pyproject.toml.m4: Merge all metadata from src/setup.cfg.m4, remo…
mkoeppe May 17, 2024
0b927be
Restore the deleted version_requirements.txt files in build/pkgs/*/, …
mkoeppe May 14, 2024
78bb595
Revert "delete generated version requirements files during cleanup"
mkoeppe May 14, 2024
33003d7
Revert "add generated version requirements files to configure tarball"
mkoeppe May 14, 2024
452d6da
build/pkgs/*/version_requirements.txt: Deduplicate version constraint…
mkoeppe May 17, 2024
6a54d56
build/bin/sage-get-system-packages: Extract from pyproject.toml [proj…
mkoeppe May 17, 2024
e0aed28
build/bin/sage-get-system-packages: When scanning pyproject.toml for …
mkoeppe May 17, 2024
a228617
build/bin/sage-get-system-packages: Sort/uniquify package info extrac…
mkoeppe May 17, 2024
45cc4bd
Merge remote-tracking branch 'upstream/develop' into 36676
mkoeppe May 19, 2024
112a6ca
Merge branch '36951' into 36676+37902
mkoeppe May 23, 2024
a436233
Merge branch '36676+37902' into 36964
mkoeppe May 23, 2024
0a27566
Merge remote-tracking branch 'upstream/develop' into 36676
mkoeppe May 25, 2024
903cb92
Merge branch '36676' into 36964
mkoeppe May 25, 2024
20e6cda
sage.combinat, sage.games: Use more lazy_import in all.py files
mkoeppe May 27, 2024
a34bd71
src/sage/structure/parent.pyx: In doctest, use SymmetricFunctions fro…
mkoeppe May 27, 2024
327fb5c
src/sage/categories/weyl_groups.py: Fix import
mkoeppe May 27, 2024
af1ff33
Merge branch 'lazy_import_combinat' into 36676
mkoeppe Jun 1, 2024
902784d
Merge branch 'sagemath_categories_distribution_directives_2024' into …
mkoeppe Jun 2, 2024
df9dd71
Merge branch '36676+38088' into 36964
mkoeppe Jun 2, 2024
fd5ba9a
Merge remote-tracking branch 'upstream/develop' into 36676
mkoeppe Jun 9, 2024
2bd68c9
Merge branch '36676' into 36964
mkoeppe Jun 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .ci/write-dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ $ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap bootstrap-
$ADD config/config.rpath /new/config/config.rpath
$ADD src/doc/bootstrap /new/src/doc/bootstrap
$ADD src/bin /new/src/bin
$ADD src/Pipfile.m4 src/pyproject.toml src/requirements.txt.m4 src/setup.cfg.m4 src/VERSION.txt /new/src/
$ADD src/Pipfile.m4 src/pyproject.toml src/requirements.txt.m4 src/VERSION.txt /new/src/
$ADD m4 /new/m4
$ADD pkgs /new/pkgs
$ADD build /new/build
Expand Down
13 changes: 0 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -185,19 +185,6 @@ __pycache__/
build/temp.*/
build/bin/sage-build-env-config

# Generated files in build
build/pkgs/cypari/version_requirements.txt
build/pkgs/cysignals/version_requirements.txt
build/pkgs/cython/version_requirements.txt
build/pkgs/gmpy2/version_requirements.txt
build/pkgs/jupyter_core/version_requirements.txt
build/pkgs/memory_allocator/version_requirements.txt
build/pkgs/numpy/version_requirements.txt
build/pkgs/pkgconfig/version_requirements.txt
build/pkgs/pplpy/version_requirements.txt
build/pkgs/setuptools/version_requirements.txt
build/pkgs/wheel/version_requirements.txt

# Generated files in the top-level source trees
/pkgs/*/build
/pkgs/*/dist
Expand Down
11 changes: 0 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,6 @@ bootstrap-clean:
rm -f src/Pipfile
rm -f src/requirements.txt
rm -f src/setup.cfg
rm -f build/pkgs/cypari/version_requirements.txt
rm -f build/pkgs/cysignals/version_requirements.txt
rm -f build/pkgs/cython/version_requirements.txt
rm -f build/pkgs/gmpy2/version_requirements.txt
rm -f build/pkgs/jupyter_core/version_requirements.txt
rm -f build/pkgs/memory_allocator/version_requirements.txt
rm -f build/pkgs/numpy/version_requirements.txt
rm -f build/pkgs/pkgconfig/version_requirements.txt
rm -f build/pkgs/pplpy/version_requirements.txt
rm -f build/pkgs/setuptools/version_requirements.txt
rm -f build/pkgs/wheel/version_requirements.txt

# Remove absolutely everything which isn't part of the git repo
maintainer-clean: distclean bootstrap-clean
Expand Down
127 changes: 44 additions & 83 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,10 @@ cd "$SAGE_ROOT"

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

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


bootstrap () {
for pkgname in cypari cysignals cython gmpy2 jupyter_core memory_allocator numpy pkgconfig pplpy setuptools wheel; do
# Write the version_requirements.txt files for dependencies declared in pyproject.toml
target=build/pkgs/${pkgname}/version_requirements.txt
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
echo "bootstrap:$LINENO: installing '"$target"'"
fi
echo "# Generated by SAGE_ROOT/bootstrap based on src/pyproject.toml; do not edit directly" > $target
sage-get-system-packages install-requires ${pkgname} >> $target
done
for a in m4/sage_spkg_configures.m4 m4/sage_spkg_versions.m4 m4/sage_spkg_versions_toml.m4; do
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
echo "bootstrap:$LINENO: installing '"$a"'"
Expand All @@ -54,6 +43,7 @@ bootstrap () {
for a in m4/sage_spkg_versions.m4 m4/sage_spkg_versions_toml.m4; do
echo 'changequote(`>>>'"'"', `<<<'"')dnl" >> $a
done
eval $(sage-package properties --format=shell :all:)
spkg_configures=""
# initialize SAGE_ENABLE... options for standard packages
for pkgname in $(sage-package list :standard:); do
Expand All @@ -62,75 +52,67 @@ AS_VAR_SET_IF([SAGE_ENABLE_$pkgname], [], [AS_VAR_SET([SAGE_ENABLE_$pkgname], [y
done
# --enable-SPKG options
for pkgname in $(sage-package list :optional: :experimental:); do
eval DIR=\$path_$pkgname pkgtype=\$type_$pkgname pkgsource=\$source_$pkgname
case "$pkgname:$pkgsource" in
*:pip)
# Issue #29629: Temporary solution for Sage 9.1: Do not provide
# --enable-SPKG options for installing pip packages
if [ ! -f build/pkgs/$pkgname/requirements.txt ]; then
pkgtype="$(cat build/pkgs/$pkgname/type)"
# Issue #29124: Do not provide --enable-_recommended and similar
case "$pkgname" in
_*) ;;
*) spkg_configures="$spkg_configures
;;
_*:*)
# Issue #29124: Do not provide --enable-_recommended and similar
;;
*:none)
# Issue #31163: Just an optional dummy package
spkg_configures="$spkg_configures
AC_SUBST(SAGE_ENABLE_$pkgname, [if_installed])"
if [ -f build/pkgs/$pkgname/spkg-install -o -f build/pkgs/$pkgname/spkg-install.in ]; then
# Issue #31163: Not just an optional dummy package
spkg_configures="$spkg_configures
SAGE_SPKG_ENABLE([$pkgname], [$pkgtype], [$(grep -v ^= build/pkgs/$pkgname/SPKG.rst | head -n1 2>/dev/null || echo $pkgname)])"
fi
;;
esac
fi
;;
*:*)
spkg_configures="$spkg_configures
AC_SUBST(SAGE_ENABLE_$pkgname, [if_installed])"
spkg_configures="$spkg_configures
SAGE_SPKG_ENABLE([$pkgname], [$pkgtype], [$(grep -v ^= "$DIR/SPKG.rst" | head -n1 2>/dev/null || echo $pkgname)])"
;;
esac
done
cat >> m4/sage_spkg_configures.m4 <<EOF
SAGE_SPKG_COLLECT_INIT([$(echo $(sage-package list))])
EOF
for pkgname in $(sage-package list --has-file spkg-configure.m4); do
echo "m4_sinclude([build/pkgs/$pkgname/spkg-configure.m4])"
eval DIR=\$path_$pkgname
echo "m4_sinclude([$DIR/spkg-configure.m4])"
config="SAGE_SPKG_CONFIGURE_$(echo ${pkgname} | tr '[a-z]' '[A-Z]')"
if grep -q SAGE_PYTHON_PACKAGE_CHECK build/pkgs/$pkgname/spkg-configure.m4; then
if grep -q SAGE_PYTHON_PACKAGE_CHECK "$DIR/spkg-configure.m4"; then
spkg_configures_python="$spkg_configures_python
$config"
else
spkg_configures="$spkg_configures
$config"
fi
done >> m4/sage_spkg_configures.m4
cat >> m4/sage_spkg_configures.m4 <<EOF
$spkg_configures
$spkg_configures_python
EOF
for pkgname in $(sage-package list); do
DIR=build/pkgs/$pkgname
pkgtype="$(cat $DIR/type)"
if test -f "$DIR/requirements.txt"; then
SPKG_SOURCE=pip
elif test ! -f "$DIR/checksums.ini"; then
if test -f "$DIR/spkg-install" -o -f "$DIR/spkg-install.in"; then
SPKG_SOURCE=script
else
# a dummy package
SPKG_SOURCE=none
fi
else
SPKG_SOURCE=normal
fi
if test -f "$DIR/trees.txt"; then
SPKG_TREE_VAR="$(sed "s/#.*//;" "$DIR/trees.txt")"
else
SPKG_TREE_VAR=SAGE_LOCAL
if test -f "$DIR/requirements.txt" -o -f "$DIR/version_requirements.txt"; then
# A Python package
SPKG_TREE_VAR=SAGE_VENV
echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions.m4
echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires-toml ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions_toml.m4
fi
eval DIR=\$path_$pkgname pkgtype=\$type_$pkgname SPKG_SOURCE=\$source_$pkgname SPKG_TREE_VAR=\$trees_$pkgname
if test -f "$DIR/requirements.txt" -o -f "$DIR/version_requirements.txt"; then
# A Python package
echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions.m4
INSTALL_REQUIRES_TOML=
echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires-toml ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions_toml.m4
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
fi
spkg_finalizes="$spkg_finalizes
SAGE_SPKG_FINALIZE([$pkgname], [$pkgtype], [$SPKG_SOURCE], [$SPKG_TREE_VAR])"
done
echo "$spkg_finalizes" >> m4/sage_spkg_configures.m4
for a in m4/sage_spkg_versions.m4 m4/sage_spkg_versions_toml.m4; do
echo 'changequote(>>>`<<<, >>>'"'"'<<<)dnl' >> $a
done
cat >> m4/sage_spkg_configures.m4 <<EOF
$spkg_configures
$spkg_configures_python
$spkg_finalizes
EOF

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

if [ $# != 0 ]; then
Expand Down Expand Up @@ -196,10 +178,10 @@ SAGE_SPKG_FINALIZE([$pkgname], [$pkgtype], [$SPKG_SOURCE], [$SPKG_TREE_VAR])"
bootstrap_download () {
SAGE_DL_LOGLEVEL=""
[ "${BOOTSTRAP_QUIET}" = "yes" ] && SAGE_DL_LOGLEVEL="--log=WARNING"
sage-download-file ${SAGE_DL_LOGLEVEL} configure-$CONFVERSION.tar.gz

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

Expand Down Expand Up @@ -241,30 +223,10 @@ save () {
src/environment-optional-3.[89].yml src/environment-optional-3.1[0-9].yml \
src/Pipfile \
src/pyproject.toml \
src/requirements.txt \
src/setup.cfg \
build/pkgs/cypari/version_requirements.txt \
build/pkgs/cysignals/version_requirements.txt \
build/pkgs/cython/version_requirements.txt \
build/pkgs/gmpy2/version_requirements.txt \
build/pkgs/jupyter_core/version_requirements.txt \
build/pkgs/memory_allocator/version_requirements.txt \
build/pkgs/numpy/version_requirements.txt \
build/pkgs/pkgconfig/version_requirements.txt \
build/pkgs/pplpy/version_requirements.txt \
build/pkgs/setuptools/version_requirements.txt \
build/pkgs/wheel/version_requirements.txt

# Update version
echo "$NEWCONFVERSION" >$PKG/package-version.txt
src/requirements.txt

# Compute checksum
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
sage-package fix-checksum configure
else
# Hide the "Updating checksum..." message
sage-package fix-checksum configure > /dev/null
fi
# Update version; this re-computes the checksum
sage-package update configure "$NEWCONFVERSION"
}


Expand Down Expand Up @@ -304,7 +266,6 @@ do
done
shift $(($OPTIND - 1))
export BOOTSTRAP_QUIET
CONFBALL="upstream/configure-$CONFVERSION.tar.gz"

if [ $DOWNLOAD$SAVE = yesyes ]; then
echo >&2 "$0: refusing to download and save."
Expand Down
8 changes: 4 additions & 4 deletions bootstrap-conda
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ SAGELIB_PACKAGES=
SAGELIB_OPTIONAL_PACKAGES=
DEVELOP_PACKAGES=

eval $(sage-package properties --format=shell :all:)

for PKG_BASE in $(sage-package list --has-file distros/conda.txt --exclude _sagemath); do
PKG_SCRIPTS=build/pkgs/$PKG_BASE
eval PKG_SCRIPTS=\$path_$PKG_BASE PKG_TYPE=\$type_$PKG_BASE
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/distros/conda.txt
PKG_TYPE=$(cat $PKG_SCRIPTS/type)
PKG_SYSTEM_PACKAGES=$(echo $(${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE))
if [ -n "$PKG_SYSTEM_PACKAGES" ]; then
if [ -f $PKG_SCRIPTS/spkg-configure.m4 ]; then
Expand Down Expand Up @@ -133,12 +134,11 @@ echo >&2 $0:$LINENO: generate conda environment files
echo >&4 " - pip:"
echo >&5 " - pip:"
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
PKG_SCRIPTS=build/pkgs/$PKG_BASE
eval PKG_SCRIPTS=\$path_$PKG_BASE PKG_TYPE=\$type_$PKG_BASE
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/requirements.txt
if [ ! -f $SYSTEM_PACKAGES_FILE ]; then
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/version_requirements.txt
fi
PKG_TYPE=$(cat $PKG_SCRIPTS/type)
if grep -q SAGERUNTIME $PKG_SCRIPTS/dependencies $PKG_SCRIPTS/dependencies_order_only 2>/dev/null; then
: # cannot install packages that depend on the Sage library
else
Expand Down
84 changes: 53 additions & 31 deletions build/bin/sage-get-system-packages
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,37 @@ fi
case "$SYSTEM" in
install-requires)
# Collect from src/pyproject.toml or from version_requirements.txt (falling back to requirements.txt) and output it in the format
# needed by setup.cfg [options] version_requirements=
SYSTEM_PACKAGES_FILE_NAMES="version_requirements.txt requirements.txt"
STRIP_COMMENTS="sed s/#.*//;/^[[:space:]]*$/d;"
FROM_PYPROJECT_TOML=1
# needed by setup.cfg [options] install_requires=
SYSTEM_PACKAGES_FILE_NAMES="src/pyproject.toml version_requirements.txt requirements.txt"
# also normalizes quotes from "" to ''.
STRIP_COMMENTS="sed s/#.*//;/^[[:space:]]*$/d;s/\"/'/g;"
COLLECT=
;;
install-requires-toml)
# Collect from src/pyproject.toml or from version_requirements.txt (falling back to requirements.txt) and output it in the format
# needed by pyproject.toml [build-system] requires=
SYSTEM_PACKAGES_FILE_NAMES="version_requirements.txt requirements.txt"
STRIP_COMMENTS="sed s/#.*//;/^[[:space:]]*$/d;s/^/'/;s/$/',/;"
FROM_PYPROJECT_TOML=1
SYSTEM_PACKAGES_FILE_NAMES="src/pyproject.toml version_requirements.txt requirements.txt"
# also normalizes quotes from '' to "".
STRIP_COMMENTS="sed s/#.*//;/^[[:space:]]*$/d;s/'/\"/g;s/^/'/;s/$/',/;"
COLLECT=
;;
pip)
SYSTEM_PACKAGES_FILE_NAMES="requirements.txt version_requirements.txt"
SYSTEM_PACKAGES_FILE_NAMES="requirements.txt src/pyproject.toml version_requirements.txt"
STRIP_COMMENTS='sed s/#.*//;s/[[:space:]]//g;'
FROM_PYPROJECT_TOML=1
COLLECT=echo
;;
versions)
# For use in sage-spkg-info
SYSTEM_PACKAGES_FILE_NAMES="package-version.txt requirements.txt src/pyproject.toml version_requirements.txt"
strip_comments () {
echo "$NAME::"
echo
sed "s/#.*//;/^[[:space:]]*$/d;s/\"/'/g;s/^/ /;" "$@"
echo
}
STRIP_COMMENTS=strip_comments
COLLECT=
;;
*)
if [ "$SYSTEM" = auto ]; then
SYSTEM=$(sage-guess-package-system 2>/dev/null)
Expand All @@ -45,7 +56,6 @@ case "$SYSTEM" in
fi
SYSTEM_PACKAGES_FILE_NAMES="distros/$SYSTEM.txt"
STRIP_COMMENTS="sed s/#.*//;s/\${PYTHON_MINOR}/${PYTHON_MINOR}/g"
FROM_PYPROJECT_TOML=0
COLLECT=echo
;;
esac
Expand All @@ -57,19 +67,10 @@ case "$SPKGS" in
esac

for PKG_BASE in $SPKGS; do
if [ $FROM_PYPROJECT_TOML -eq 1 ]; then
if [ -f "$SAGE_ROOT/src/pyproject.toml" ]; then
# Extract from the "requires" block in src/pyproject.toml
# Packages are in the format "'sage-conf ~= 10.3b3',"
PACKAGE_INFO=$(sed -n '/requires *= *\[/,/^\]/s/^ *'\''\('$PKG_BASE'.*\)'\'',/\1/p' "$SAGE_ROOT/src/pyproject.toml")
if [ -n "$PACKAGE_INFO" ]; then
echo "$PACKAGE_INFO" | ${STRIP_COMMENTS}
continue
fi
fi
fi

case "$SYSTEM:$ENABLE_SYSTEM_SITE_PACKAGES" in
versions*)
# Show everything.
;;
install-requires*|pip*)
# This is output for installation of packages into a Python environment.
# So it's OK to use any Python packages.
Expand All @@ -93,14 +94,35 @@ for PKG_BASE in $SPKGS; do
esac

for NAME in $SYSTEM_PACKAGES_FILE_NAMES; do
SYSTEM_PACKAGES_FILE="$SAGE_ROOT"/build/pkgs/$PKG_BASE/$NAME
if [ -f $SYSTEM_PACKAGES_FILE ]; then
if [ -z "$COLLECT" ]; then
${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE
else
$COLLECT $(${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE)
fi
break
fi
case $NAME in
*pyproject.toml)
SYSTEM_PACKAGES_FILE="$SAGE_ROOT"/$NAME
if [ -f "$SYSTEM_PACKAGES_FILE" ]; then
# 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',"
# 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" | sort -u)
if [ -n "$PACKAGE_INFO" ]; then
echo "$PACKAGE_INFO" | ${STRIP_COMMENTS}
[ $SYSTEM = versions ] || break
fi
fi
;;
*)
SYSTEM_PACKAGES_FILE="$SAGE_ROOT"/build/pkgs/$PKG_BASE/$NAME
if [ -f $SYSTEM_PACKAGES_FILE ]; then
if [ -z "$COLLECT" ]; then
${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE
else
$COLLECT $(${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE)
fi
[ $SYSTEM = versions ] || break
fi
;;
esac
done
done
Loading
Loading