Skip to content

Commit

Permalink
Merge branch 'develop' into nb_7_packages_m4
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpase authored Mar 1, 2024
2 parents 31028cd + 4ac7152 commit 016fc0e
Show file tree
Hide file tree
Showing 67 changed files with 362 additions and 241 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
uses: ./.github/workflows/macos.yml
with:
stage: "1"
timeout: 14400

stage-2:
uses: ./.github/workflows/macos.yml
Expand Down Expand Up @@ -90,7 +91,7 @@ jobs:
run: |
git config --global user.email "nobody@example.com"
git config --global user.name "Sage GitHub CI"
SAGE_ROOT=. SAGE_SRC=./src src/bin/sage-update-version $(git describe --tags) || echo "(ignoring error)"
SAGE_ROOT=. SAGE_SRC=./src src/bin/sage-update-version $(cat src/VERSION.txt).dev0 || echo "(ignoring error)"
- name: make dist
run: |
./configure --enable-download-from-upstream-url && make dist
Expand All @@ -108,7 +109,7 @@ jobs:
fail-fast: false
max-parallel: 4
matrix:
os: [ macos-11, macos-12 ]
os: [ macos-11, macos-12, macos-14 ]
tox_system_factor: [macos-nobootstrap]
tox_packages_factor: [minimal]
xcode_version_factor: [default]
Expand All @@ -129,7 +130,7 @@ jobs:
if: contains(matrix.tox_system_factor, 'nobootstrap')
- name: Move homebrew away
run: |
(cd /usr/local && for a in bin etc include lib opt sbin share; do sudo mv $a $a-moved; done)
(cd $(brew --prefix) && for a in bin etc include lib opt sbin share; do sudo mv $a $a-moved; done)
- name: Select Xcode version
run: |
if [ ${{ matrix.xcode_version_factor }} != default ]; then sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode_version_factor }}.app; fi
Expand All @@ -140,7 +141,8 @@ jobs:
# We use a high parallelization on purpose in order to catch possible parallelization bugs in the build scripts.
# For doctesting, we use a lower parallelization to avoid timeouts.
run: |
MAKE="make -j12" tox -e $TOX_ENV -- SAGE_NUM_THREADS=4 $TARGETS
(sleep 20000; pkill make) &
MAKE="make -j12" tox -e $TOX_ENV -- SAGE_NUM_THREADS=6 $TARGETS
- name: Prepare logs artifact
run: |
mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; cp -r .tox/*/log "artifacts/$LOGS_ARTIFACT_NAME"
Expand Down
33 changes: 24 additions & 9 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,21 @@ on:
type: string
# System configuration
osversion_xcodeversion_toxenv_tuples:
# As of 2024-02, "runs-on: macos-latest" is macos-12.
# and "runs-on: macos-14" selects the new M1 runners.
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
description: 'Stringified JSON object'
default: >-
[["latest", "", "homebrew-macos-usrlocal-minimal"],
["latest", "", "homebrew-macos-usrlocal-standard"],
["11", "xcode_13.2.1", "homebrew-macos-usrlocal-minimal"],
[["11", "xcode_13.2.1", "homebrew-macos-usrlocal-minimal"],
["12", "", "homebrew-macos-usrlocal-minimal"],
["12", "", "homebrew-macos-usrlocal-standard"],
["12", "", "homebrew-macos-usrlocal-python3_xcode-standard"],
["12", "", "homebrew-macos-usrlocal-maximal"],
["13", "xcode_15.0", "homebrew-macos-usrlocal-standard"],
["latest", "", "homebrew-macos-usrlocal-maximal"],
["latest", "", "homebrew-macos-usrlocal-python3_xcode-standard"],
["14", "", "homebrew-macos-opthomebrew-standard"],
["latest", "", "conda-forge-macos-minimal"],
["latest", "", "conda-forge-macos-standard"]]
["latest", "", "conda-forge-macos-standard"],
["14", "", "conda-forge-macos-standard"]]
type: string
extra_sage_packages:
description: 'Extra Sage packages to install as system packages'
Expand All @@ -41,6 +45,10 @@ on:
free_disk_space:
default: false
type: boolean
timeout:
description: 'Elapsed time (seconds) at which to kill the build'
default: 20000
type: number
#
# For use in upstream CIs.
#
Expand Down Expand Up @@ -74,10 +82,16 @@ jobs:
repository: ${{ inputs.sage_repo }}
ref: ${{ inputs.sage_ref }}
fetch-depth: 10000

- uses: actions/setup-python@v5
# As of 2024-02-03, the macOS M1 runners do not have preinstalled python or pipx.
# Installing pipx follows the approach of https://github.com/pypa/cibuildwheel/pull/1743
id: python
with:
python-version: "3.8 - 3.12"
update-environment: false
- name: Install test prerequisites
run: |
brew install tox
"${{ steps.python.outputs.python-path }}" -m pip install pipx
- name: Download upstream artifact
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -129,7 +143,8 @@ jobs:
*) export TARGETS_PRE="${{ inputs.targets_pre }}" TARGETS="${{ inputs.targets }} TARGETS_OPTIONAL="${{ inputs.targets_optional }}
;;
esac
MAKE="make -j12" tox -e $TOX_ENV -- SAGE_NUM_THREADS=4 $TARGETS
(sleep ${{ inputs.timeout }}; pkill make) &
MAKE="make -j12" EXTRA_SAGE_PACKAGES="${{ inputs.extra_sage_packages }}" "${{ steps.python.outputs.python-path }}" -m pipx run tox -e $TOX_ENV -- SAGE_NUM_THREADS=6 $TARGETS
- name: Prepare logs artifact
run: |
mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; cp -r .tox/*/log "artifacts/$LOGS_ARTIFACT_NAME"
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ title: SageMath
abstract: SageMath is a free open-source mathematics software system.
authors:
- name: "The SageMath Developers"
version: 10.3.rc0
version: 10.3.rc1
doi: 10.5281/zenodo.593563
date-released: 2024-02-25
date-released: 2024-02-29
repository-code: "https://github.com/sagemath/sage"
url: "https://www.sagemath.org/"
45 changes: 38 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,16 +420,47 @@ in the Installation Guide.
Alternative Installation using PyPI
---------------

For installation of `sage` in python using `pip` you need to install `sagemath-standard`. First, activate your python virtual environment and follow these steps:
For installing Sage in a Python environment from PyPI, Sage provides the
`pip`-installable package [sagemath-standard](https://pypi.org/project/sagemath-standard/).

$ python3 -m pip install sage_conf
$ ls $(sage-config SAGE_SPKG_WHEELS)
$ python3 -m pip install $(sage-config SAGE_SPKG_WHEELS)/*.whl sage_setup
$ python3 -m pip install --no-build-isolation sagemath-standard
Unless you need to install Sage into a specific existing environment, we recommend
to create and activate a fresh virtual environment, for example `~/sage-venv/`:

You need to install `sage_conf`, a wheelhouse of various python packages. You can list the wheels using `ls $(sage-config SAGE_SPKG_WHEELS)`. After manual installation of these wheels, you can install the sage library, `sagemath-standard`.
$ python3 -m venv ~/sage-venv
$ source ~/sage-venv/bin/activate

**NOTE:** You can find `sage` and `sagemath` pip packages but with these packages, you will encounter `ModuleNotFoundError`.
As the first installation step, install [sage_conf](https://pypi.org/project/sage-conf/),
which builds various prerequisite packages in a subdirectory of `~/.sage/`:

(sage-venv) $ python3 -m pip install -v sage_conf

After a successful installation, a wheelhouse provides various Python packages.
You can list the wheels using the command:

(sage-venv) $ ls $(sage-config SAGE_SPKG_WHEELS)

If this gives an error saying that `sage-config` is not found, check any messages
that the `pip install` command may have printed. You may need to adjust your `PATH`,
for example by:

$ export PATH="$(python3 -c 'import sysconfig; print(sysconfig.get_path("scripts", "posix_user"))'):$PATH"

Now install the packages from the wheelhouse and the [sage_setup](https://pypi.org/project/sage-conf/)
package, and finally install the Sage library:

(sage-venv) $ python3 -m pip install $(sage-config SAGE_SPKG_WHEELS)/*.whl sage_setup
(sage-venv) $ python3 -m pip install --no-build-isolation -v sagemath-standard

The above instructions install the latest stable release of Sage.
To install the latest development version instead, add the switch `--pre` to all invocations of
`python3 -m pip install`.

**NOTE:** PyPI has various other `pip`-installable packages with the word "sage" in their names.
Some of them are maintained by the SageMath project, some are provided by SageMath users for
various purposes, and others are entirely unrelated to SageMath. Do not use the packages
`sage` and `sagemath`. For a curated list of packages, see the chapter
[Packages and Features](https://doc.sagemath.org/html/en/reference/spkg/index.html) of the
Sage Reference Manual.

SageMath Docker images
----------------------
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SageMath version 10.3.rc0, Release Date: 2024-02-25
SageMath version 10.3.rc1, Release Date: 2024-02-29
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=a3fc8c3bf9198d28a8f2d5a08cffdcf519150b77
md5=32f4f1763765232dc7e7431d5e48e129
cksum=708121316
sha1=b0dfc1d5886366b5c58354527810c1dbeffd78a3
md5=c2f9837bcf2823d5b2f36063ebeedb38
cksum=3535625335
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0fb793fa91a0b46de452036b521cbbaeee878340
686e933eb32ade977ed51836a33424e2095e5408
1 change: 1 addition & 0 deletions build/pkgs/dsdp/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cd src
cp ../patches/CMakeLists.txt .
sdh_cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DBUILD_SHARED_LIBS=ON \
-DBLA_VENDOR=OpenBLAS \
-DBLAS_LIBRARIES="$(pkg-config --libs blas)" \
Expand Down
10 changes: 5 additions & 5 deletions build/pkgs/meson/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=meson-VERSION.tar.gz
sha1=97e766951553ec35315712f0a27d5554a010d4c3
md5=69da4c63ef06c9d3bcc00ce89abb306f
cksum=2424401184
upstream_url=https://pypi.io/packages/source/m/meson/meson-VERSION.tar.gz
tarball=meson-VERSION-py3-none-any.whl
sha1=baf5b9bc9ca97f18c7dc87cfaf0e1dc4d617a4cf
md5=d418e644c04e55872ce3d7b6de007dbe
cksum=559088366
upstream_url=https://pypi.io/packages/py3/m/meson/meson-VERSION-py3-none-any.whl
2 changes: 1 addition & 1 deletion build/pkgs/meson/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.3
1.3.1
28 changes: 17 additions & 11 deletions build/pkgs/meson/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
SAGE_SPKG_CONFIGURE(
[meson], [
dnl scipy 1.11.2 needs meson >= 1.1.0
dnl contourpy needs meson >= 1.2.0
AC_CACHE_CHECK([for meson >= 1.2.0], [ac_cv_path_MESON], [
AC_PATH_PROGS_FEATURE_CHECK([MESON], [meson], [
meson_version=`$ac_path_MESON --version 2>&1`
AS_IF([test -n "$meson_version"], [
AX_COMPARE_VERSION([$meson_version], [ge], [1.2.0], [
ac_cv_path_MESON="$ac_path_MESON"
ac_path_MESON_found=:
SAGE_SPKG_CONFIGURE([meson], [dnl
dnl scipy 1.11.2 needs meson >= 1.1.0
dnl contourpy needs meson >= 1.2.0
dnl meson_python needs meson >= 1.2.3 for Python >= 3.12
AC_CACHE_CHECK([for meson >= 1.2.3], [ac_cv_path_MESON], [dnl
dnl Do not accept meson installed in the default user scheme;
dnl it will not work in our venv because we set PYTHONUSERBASE
dnl in sage-env.
WITH_SAGE_PYTHONUSERBASE([dnl
AC_PATH_PROGS_FEATURE_CHECK([MESON], [meson], [dnl
AS_IF([meson_version=$($ac_path_MESON --version 2>&1)], [dnl
AS_IF([test -n "$meson_version"], [dnl
AX_COMPARE_VERSION([$meson_version], [ge], [1.2.3], [dnl
ac_cv_path_MESON="$ac_path_MESON"
ac_path_MESON_found=:
])
])
])
])
])
Expand Down
2 changes: 0 additions & 2 deletions build/pkgs/meson/spkg-install.in

This file was deleted.

2 changes: 1 addition & 1 deletion build/pkgs/sage_conf/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file is updated on every release by the sage-update-version script
sage-conf ~= 10.3rc0
sage-conf ~= 10.3rc1
2 changes: 1 addition & 1 deletion build/pkgs/sage_docbuild/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file is updated on every release by the sage-update-version script
sage-docbuild ~= 10.3rc0
sage-docbuild ~= 10.3rc1
2 changes: 1 addition & 1 deletion build/pkgs/sage_setup/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file is updated on every release by the sage-update-version script
sage-setup ~= 10.3rc0
sage-setup ~= 10.3rc1
2 changes: 1 addition & 1 deletion build/pkgs/sage_sws2rst/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file is updated on every release by the sage-update-version script
sage-sws2rst ~= 10.3rc0
sage-sws2rst ~= 10.3rc1
2 changes: 1 addition & 1 deletion build/pkgs/sagelib/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file is updated on every release by the sage-update-version script
sagemath-standard ~= 10.3rc0
sagemath-standard ~= 10.3rc1
2 changes: 1 addition & 1 deletion build/pkgs/sagemath_bliss/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file is updated on every release by the sage-update-version script
sagemath-bliss ~= 10.3rc0
sagemath-bliss ~= 10.3rc1
2 changes: 1 addition & 1 deletion build/pkgs/sagemath_categories/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file is updated on every release by the sage-update-version script
sagemath-categories ~= 10.3rc0
sagemath-categories ~= 10.3rc1
2 changes: 1 addition & 1 deletion build/pkgs/sagemath_coxeter3/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file is updated on every release by the sage-update-version script
sagemath-coxeter3 ~= 10.3rc0
sagemath-coxeter3 ~= 10.3rc1
2 changes: 1 addition & 1 deletion build/pkgs/sagemath_environment/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file is updated on every release by the sage-update-version script
sagemath-environment ~= 10.3rc0
sagemath-environment ~= 10.3rc1
2 changes: 1 addition & 1 deletion build/pkgs/sagemath_mcqd/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file is updated on every release by the sage-update-version script
sagemath-mcqd ~= 10.3rc0
sagemath-mcqd ~= 10.3rc1
2 changes: 1 addition & 1 deletion build/pkgs/sagemath_meataxe/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file is updated on every release by the sage-update-version script
sagemath-meataxe ~= 10.3rc0
sagemath-meataxe ~= 10.3rc1
2 changes: 1 addition & 1 deletion build/pkgs/sagemath_objects/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file is updated on every release by the sage-update-version script
sagemath-objects ~= 10.3rc0
sagemath-objects ~= 10.3rc1
2 changes: 1 addition & 1 deletion build/pkgs/sagemath_repl/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file is updated on every release by the sage-update-version script
sagemath-repl ~= 10.3rc0
sagemath-repl ~= 10.3rc1
2 changes: 1 addition & 1 deletion build/pkgs/sagemath_sirocco/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file is updated on every release by the sage-update-version script
sagemath-sirocco ~= 10.3rc0
sagemath-sirocco ~= 10.3rc1
2 changes: 1 addition & 1 deletion build/pkgs/sagemath_tdlib/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file is updated on every release by the sage-update-version script
sagemath-tdlib ~= 10.3rc0
sagemath-tdlib ~= 10.3rc1
56 changes: 31 additions & 25 deletions m4/sage_python_package_check.m4
Original file line number Diff line number Diff line change
Expand Up @@ -71,32 +71,19 @@ AC_DEFUN([SAGE_PYTHON_PACKAGE_CHECK], [
)
AC_MSG_CHECKING([for python package $1 ("${SAGE_PKG_VERSPEC}")])
dnl To prevent user-site (pip install --user) packages from being
dnl detected as "system" packages, we poison PYTHONUSERBASE. The
dnl sage-env script also does this at runtime; we mimic that
dnl implementation to ensure that the behaviors at ./configure and
dnl runtime are identical. Beware that (as in sage-env) the poisoning
dnl is skipped if PYTHONUSERBASE is non-empty. In particular, if the
dnl user points PYTHONUSERBASE to any path (even the default), then
dnl his local pip packages will be detected.
PYTHONUSERBASE_SAVED="${PYTHONUSERBASE}"
AS_IF([test -z "${PYTHONUSERBASE}"], [
PYTHONUSERBASE="${HOME}/.sage/local"
WITH_SAGE_PYTHONUSERBASE([dnl
dnl double-quote SAGE_PKG_VERSPEC because platform-specific
dnl dependencies like python_version<'3.11' will have single
dnl quotes in them. (We normalized the quotes earlier with sed.)
AS_IF(
[config.venv/bin/python3 -c dnl
"import pkg_resources; dnl
pkg_resources.require(\"${SAGE_PKG_VERSPEC}\".splitlines())" dnl
2>&AS_MESSAGE_LOG_FD],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no); sage_spkg_install_$1=yes]
)
])
dnl double-quote SAGE_PKG_VERSPEC because platform-specific
dnl dependencies like python_version<'3.11' will have single
dnl quotes in them. (We normalized the quotes earlier with sed.)
AS_IF(
[PYTHONUSERBASE="${PYTHONUSERBASE}" config.venv/bin/python3 -c dnl
"import pkg_resources; dnl
pkg_resources.require(\"${SAGE_PKG_VERSPEC}\".splitlines())" dnl
2>&AS_MESSAGE_LOG_FD],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no); sage_spkg_install_$1=yes]
)
PYTHONUSERBASE="${PYTHONUSERBASE_SAVED}"
], [
dnl failed to create a venv for some reason
AC_MSG_RESULT(no)
Expand Down Expand Up @@ -128,3 +115,22 @@ AC_DEFUN([SAGE_PYTHON_PACKAGE_CHECK], [
AS_IF([test "${sage_use_system_$1}" = "yes"],[sage_use_system_$1=no])
])
])


AC_DEFUN([WITH_SAGE_PYTHONUSERBASE], [dnl
dnl To prevent user-site (pip install --user) packages from being
dnl detected as "system" packages, we poison PYTHONUSERBASE. The
dnl sage-env script also does this at runtime; we mimic that
dnl implementation to ensure that the behaviors at ./configure and
dnl runtime are identical. Beware that (as in sage-env) the poisoning
dnl is skipped if PYTHONUSERBASE is non-empty. In particular, if the
dnl user points PYTHONUSERBASE to any path (even the default), then
dnl his local pip packages will be detected.
PYTHONUSERBASE_SAVED="${PYTHONUSERBASE}"
AS_IF([test -z "${PYTHONUSERBASE}"], [dnl
PYTHONUSERBASE="${HOME}/.sage/local"
export PYTHONUSERBASE
])
$1
PYTHONUSERBASE="${PYTHONUSERBASE_SAVED}"
])
2 changes: 1 addition & 1 deletion pkgs/sage-conf/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.3.rc0
10.3.rc1
Loading

0 comments on commit 016fc0e

Please sign in to comment.