Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6127016
bootstrap-conda: Generate environment files with hard-coded Python mi…
mkoeppe Oct 5, 2023
03a2acf
src/doc/en/installation/conda.rst: Update for versioned environment-.…
mkoeppe Oct 8, 2023
5c0bac8
bootstrap, Makefile (bootstrap-clean): Update for versioned environme…
mkoeppe Sep 27, 2023
c2be172
tox.ini (local-conda-environment): Update for versioned environment-.…
mkoeppe Sep 27, 2023
b3ba591
.github/workflows/ci-conda.yml: Update for versioned environment*.yml
mkoeppe Sep 27, 2023
018de2b
.github/workflows/ci-conda.yml: Fix environment name
mkoeppe Oct 3, 2023
fc9bab5
tox.ini (conda-environment-{src,dev}), .github/workflows/ci-conda.yml…
mkoeppe Sep 27, 2023
b02ef8e
bootstrap-conda: Refactor using sage-get-system-packages
mkoeppe Oct 5, 2023
235ce91
bootstrap-conda: Only one 'python' line + speed up
mkoeppe Oct 9, 2023
3332a89
build/sage_bootstrap/download/mirror_list.py: Remove sagepad.org
mkoeppe Oct 9, 2023
dd939ff
sage_bootstrap.{tarball, download.mirror_list}: Lower layout of the m…
mkoeppe Oct 9, 2023
2dfe081
sage_bootstrap.download.mirror_list: Delay downloading/reading/rankin…
mkoeppe Oct 9, 2023
a37f4fd
sage_bootstrap.download.mirror_list: Use master list of download sour…
mkoeppe Oct 9, 2023
2323480
src/bin/sage-update-version: Update .upstream.d/20-github.amrom.workers.dev-sagemat…
mkoeppe Oct 9, 2023
7e65260
sage_bootstrap.download.mirror_list: Skip empty lines earlier
mkoeppe Oct 9, 2023
371be50
src/bin/sage-update-version: Also commit
mkoeppe Oct 9, 2023
423e48a
build/bin/write-dockerfile.sh: ADD .upstream.d
mkoeppe Oct 9, 2023
73ab316
bootstrap-conda (src/environment-dev*.yml): Suppress pip section, for…
mkoeppe Oct 10, 2023
f429993
.ci/retrofit-worktree.sh: New, factored out from .github/workflows/bu…
mkoeppe Oct 10, 2023
47f6a98
src/tox.ini (pyright): Remove old version pin, do not rely on global …
mkoeppe Oct 10, 2023
47e2783
.github/workflows/build.yml: Simplify use of pyright by going through…
mkoeppe Oct 10, 2023
94c8b88
Fixup
mkoeppe Oct 11, 2023
8bf3bcb
src/tox.ini (pyright): Do not restrict to subdirectories by default
mkoeppe Oct 11, 2023
81e1afa
src/tox.ini (pyright): Pin to 1.1.331 (latest)
mkoeppe Oct 11, 2023
e3dce3f
conda: Do not pin setuptools, instead add legacy editable to install …
mkoeppe Oct 12, 2023
c60de9a
build/pkgs/setuptools_wheel: Make distros a symlink too
mkoeppe Sep 27, 2023
756e5c4
src/doc/en/installation/conda.rst: Restore 'bootstrap' in instruction…
mkoeppe Oct 11, 2023
ddbbdc5
pkgs/sage-conf_conda/setup.py: Always run configure
mkoeppe Oct 11, 2023
d0cae80
pkgs/sage-conf_conda/setup.py: Remove 'reusing configured SAGE_ROOT' …
mkoeppe Oct 12, 2023
c555723
Merge branch 'tox_pyright_update' into ci_streamline
mkoeppe Oct 12, 2023
19f029b
Merge branch 'conda_legacy_editable' into ci_streamline
mkoeppe Oct 12, 2023
68e9997
Merge branch 'bootstrap_conda_refactor' into ci_streamline
mkoeppe Oct 12, 2023
66a8be4
Merge branch 'gh_actions_release' into ci_streamline
mkoeppe Oct 12, 2023
2e11b0f
Merge branch 'ci_refactor_build' into ci_streamline
mkoeppe Oct 12, 2023
0bfb487
build/bin/write-dockerfile.sh, tox.ini (docker-incremental): Make inc…
mkoeppe Oct 11, 2023
8e25cbd
.github/workflows/build.yml: Merge doc-build.yml, doc-build-pdf.yml
mkoeppe Oct 11, 2023
459da44
.github/workflows/build.yml: Merge ci-linux-incremental.yml
mkoeppe Oct 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bootstrap-conda: Refactor using sage-get-system-packages
  • Loading branch information
Matthias Koeppe committed Oct 8, 2023
commit b02ef8eb62678bde34550ab1eb9ed8458ed9b099
90 changes: 61 additions & 29 deletions bootstrap-conda
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,75 @@ STRIP_COMMENTS="sed s/#.*//;"
shopt -s extglob

DEVELOP_SPKG_PATTERN="@(_develop$(for a in $(head -n 1 build/pkgs/_develop/dependencies); do echo -n "|"$a; done))"
BOOTSTRAP_PACKAGES=$(echo $(${STRIP_COMMENTS} build/pkgs/_bootstrap/distros/conda.txt))
SYSTEM_PACKAGES=
OPTIONAL_SYSTEM_PACKAGES=
SAGELIB_SYSTEM_PACKAGES=
SAGELIB_OPTIONAL_SYSTEM_PACKAGES=
DEVELOP_SYSTEM_PACKAGES=
BOOTSTRAP_PACKAGES=_bootstrap
PACKAGES=
OPTIONAL_PACKAGES=
SAGELIB_PACKAGES=
SAGELIB_OPTIONAL_PACKAGES=
DEVELOP_PACKAGES=

for PKG_BASE in $(sage-package list --has-file distros/conda.txt --exclude _sagemath); do
PKG_SCRIPTS=build/pkgs/$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 [ -n "$PKG_SYSTEM_PACKAGES" ]; then
if [ -f $PKG_SCRIPTS/spkg-configure.m4 ]; then
if grep -q SAGE_PYTHON_PACKAGE_CHECK $PKG_SCRIPTS/spkg-configure.m4; then
# Python package that would need --enable-system-site-packages to be used
# with the Sage distribution, but we do not recommend that for conda.
PKG_SAGELIB_ONLY=yes
else
PKG_SAGELIB_ONLY=no
fi
else
# No spkg-configure, so the Sage distribution is not able to make use of this package.
PKG_SAGELIB_ONLY=yes
fi
[ -n "$BOOTSTRAP_VERBOSE" ] && echo "$PKG_BASE:$PKG_TYPE:$PKG_SAGELIB_ONLY"
if [ $PKG_SAGELIB_ONLY = no ]; then
case "$PKG_BASE:$PKG_TYPE" in
*:standard)
SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
PACKAGES+=" $PKG_BASE"
;;
$DEVELOP_SPKG_PATTERN:*)
DEVELOP_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
DEVELOP_PACKAGES+=" $PKG_BASE"
;;
*)
OPTIONAL_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
OPTIONAL_PACKAGES+=" $PKG_BASE"
;;
esac
else
case "$PKG_BASE:$PKG_TYPE" in
*:standard)
SAGELIB_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
SAGELIB_PACKAGES+=" $PKG_BASE"
;;
$DEVELOP_SPKG_PATTERN:*)
DEVELOP_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
DEVELOP_PACKAGES+=" $PKG_BASE"
;;
*)
SAGELIB_OPTIONAL_SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
SAGELIB_OPTIONAL_PACKAGES+=" $PKG_BASE"
;;
esac
fi
fi
done
unset PKG_SYSTEM_PACKAGES

[ -n "$BOOTSTRAP_VERBOSE" ] && echo "## Collected:" && set | grep PACKAGES=

# Translate to system packages
export ENABLE_SYSTEM_SITE_PACKAGES=yes # Disable filtering in sage-get-system-packages
SYSTEM_PACKAGES=$(sage-get-system-packages conda $PACKAGES)
BOOTSTRAP_SYSTEM_PACKAGES=$(sage-get-system-packages conda $BOOTSTRAP_PACKAGES)
OPTIONAL_SYSTEM_PACKAGES=$(sage-get-system-packages conda $OPTIONAL_PACKAGES)
SAGELIB_SYSTEM_PACKAGES=$(sage-get-system-packages conda $SAGELIB_PACKAGES)
SAGELIB_OPTIONAL_SYSTEM_PACKAGES=$(sage-get-system-packages conda $SAGELIB_OPTIONAL_PACKAGES)
DEVELOP_SYSTEM_PACKAGES=$(sage-get-system-packages conda $DEVELOP_PACKAGES)
unset ENABLE_SYSTEM_SITE_PACKAGES

[ -n "$BOOTSTRAP_VERBOSE" ] && echo "## Translated to system:" && set | grep SYSTEM_PACKAGES=

echo >&2 $0:$LINENO: generate conda environment files
for python_version in 3.9 3.10 3.11; do
(
Expand All @@ -63,7 +93,7 @@ for python_version in 3.9 3.10 3.11; do
echo " - $pkg"
done
echo " # Packages needed for ./bootstrap"
for pkg in $BOOTSTRAP_PACKAGES; do
for pkg in $BOOTSTRAP_SYSTEM_PACKAGES; do
echo " - $pkg"
done
) > environment-$python_version.yml
Expand All @@ -84,23 +114,25 @@ for python_version in 3.9 3.10 3.11; do
) > environment-optional-$python_version.yml

(
(
sed 's/name: sage/name: sage-dev/' src/environment-$python_version.yml
echo " # Additional dev tools"
for pkg in $DEVELOP_SYSTEM_PACKAGES; do
echo " - $pkg"
done
) >&4
(
cat src/environment-$python_version.yml
echo " # optional packages"
for pkg in $OPTIONAL_SYSTEM_PACKAGES $SAGELIB_OPTIONAL_SYSTEM_PACKAGES; do
echo " - $pkg"
done
) >&5
sed 's/name: sage/name: sage-dev/' src/environment-$python_version.yml
echo " # Additional dev tools"
for pkg in $DEVELOP_SYSTEM_PACKAGES; do
echo " - $pkg"
done
) > src/environment-dev-$python_version.yml

(
cat src/environment-$python_version.yml
echo " # optional packages"
for pkg in $OPTIONAL_SYSTEM_PACKAGES $SAGELIB_OPTIONAL_SYSTEM_PACKAGES; do
echo " - $pkg"
done
) > src/environment-optional-$python_version.yml

(
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 install-requires.txt --no-file requirements.txt --no-file distros/conda.txt --no-file src) | sort); do
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 install-requires.txt --no-file requirements.txt --no-file distros/conda.txt --no-file src); do
PKG_SCRIPTS=build/pkgs/$PKG_BASE
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/requirements.txt
if [ ! -f $SYSTEM_PACKAGES_FILE ]; then
Expand Down