Skip to content

Commit

Permalink
Make sage-conf optional
Browse files Browse the repository at this point in the history
As noted in #37024 and in #36489, `sage-conf` is actually not needed on a few systems now. For this reason, we make the installation of it optional (as there are no optional install requires as far as I know, this means we remove it from `pyproject.toml` and `setup.cfg`). We also remove it from "install all dependencies via conda" as its not needed there.
  • Loading branch information
tobiasdiez authored Apr 14, 2024
1 parent f16eb4b commit 5f74854
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 14 deletions.
3 changes: 1 addition & 2 deletions .devcontainer/onCreate-conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ conda init bash

# Build sage
conda run -n sage-dev ./bootstrap
conda run -n sage-dev ./configure --with-python=/opt/conda/envs/sage-dev/bin/python --prefix=/opt/conda/envs/sage-dev
conda run -n sage-dev pip install --no-build-isolation -v -v -e ./pkgs/sage-conf ./pkgs/sage-setup
conda run -n sage-dev pip install --no-build-isolation -v -v -e ./pkgs/sage-setup
conda run -n sage-dev pip install --no-build-isolation -v -v -e ./src
8 changes: 2 additions & 6 deletions .github/workflows/ci-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,17 @@ jobs:
conda info
conda list
- name: Configure
- name: Bootstrap
shell: bash -l {0}
continue-on-error: true
run: |
./bootstrap
echo "::add-matcher::.github/workflows/configure-systempackage-problem-matcher.json"
./configure --enable-build-as-root --with-python=$CONDA_PREFIX/bin/python --prefix=$CONDA_PREFIX --enable-system-site-packages $(for pkg in $(./sage -package list :standard: --has-file spkg-configure.m4 --has-file distros/conda.txt --exclude rpy2); do echo --with-system-$pkg=force; done)
echo "::remove-matcher owner=configure-system-package-warning::"
echo "::remove-matcher owner=configure-system-package-error::"
- name: Build
shell: bash -l {0}
run: |
# Use --no-deps and pip check below to verify that all necessary dependencies are installed via conda.
pip install --no-build-isolation --no-deps -v -v -e ./pkgs/sage-conf ./pkgs/sage-setup
pip install --no-build-isolation --no-deps -v -v -e ./pkgs/sage-setup
pip install --no-build-isolation --no-deps --config-settings editable_mode=compat -v -v -e ./src
env:
SAGE_NUM_THREADS: 2
Expand Down
3 changes: 1 addition & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ tasks:
&& conda config --append envs_dirs $(pwd)
&& conda activate $(pwd)/venv
&& ./bootstrap
&& ./configure --enable-build-as-root --with-python=$CONDA_PREFIX/bin/python --prefix=$CONDA_PREFIX
&& pip install --no-build-isolation -v -v -e ./pkgs/sage-conf ./pkgs/sage-setup
&& pip install --no-build-isolation -v -v -e ./pkgs/sage-setup
&& pip install --no-build-isolation -v -v -e ./src
# Activate conda environment, set up Trac remote
# RestructuredText extension recommends python extension, although we have already installed it
Expand Down
2 changes: 1 addition & 1 deletion pkgs/sage-conf/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ sage_conf for conda

The version of the distribution package in the directory
`pkgs/sage-conf_conda <https://github.com/sagemath/sage/tree/develop/pkgs/sage-conf_conda/>`_
is used in an experimental installation method of SageMath, where all packages
may be used in an installation method of SageMath, where all packages
are provided by conda. This method is described in
https://doc.sagemath.org/html/en/installation/conda.html#using-conda-to-provide-all-dependencies-for-the-sage-library-experimental

Expand Down
8 changes: 7 additions & 1 deletion src/doc/en/installation/conda.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,15 @@ Here we assume that you are using a git checkout.
- Bootstrap the source tree and install the build prerequisites and the Sage library::

$ ./bootstrap
$ pip install --no-build-isolation -v -v --editable ./pkgs/sage-conf_conda ./pkgs/sage-setup
$ pip install --no-build-isolation -v -v --editable ./pkgs/sage-setup
$ pip install --no-build-isolation --config-settings editable_mode=compat -v -v --editable ./src

If you encounter any errors, try to install the ``sage-conf`` package first::

$ pip install --no-build-isolation -v -v --editable ./pkgs/sage-conf_conda

and then run the last command again.

- Verify that Sage has been installed::

$ sage -c 'print(version())'
Expand Down
1 change: 0 additions & 1 deletion src/pyproject.toml.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ requires = [
# Note that PEP517/518 have no notion of optional sage_spkg dependencies:
# https://github.com/pypa/pip/issues/6144
esyscmd(`sage-get-system-packages install-requires-toml \
sage_conf \
setuptools \
wheel \
sage_setup \
Expand Down
1 change: 0 additions & 1 deletion src/setup.cfg.m4
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ include(`setup_cfg_metadata.m4')dnl'
[options]
python_requires = >=3.9, <3.13
install_requires =
SPKG_INSTALL_REQUIRES_sage_conf
SPKG_INSTALL_REQUIRES_six
dnl From build/pkgs/sagelib/dependencies
SPKG_INSTALL_REQUIRES_conway_polynomials
Expand Down

0 comments on commit 5f74854

Please sign in to comment.