Skip to content

Commit 5ff7aa1

Browse files
tobiasdiezsaraedum
andcommitted
Update conda instructions
Co-authored-by: Julian Rüth <[email protected]>
1 parent 2d9ecff commit 5ff7aa1

File tree

2 files changed

+11
-105
lines changed

2 files changed

+11
-105
lines changed

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@
7070
"mathrm",
7171
"Michal",
7272
"micjung",
73+
"Miniconda",
74+
"Miniforge",
7375
"Minkowski",
7476
"Möbius",
7577
"mpfr",

src/doc/en/installation/conda.rst

Lines changed: 9 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,17 @@ SageMath can be installed on Linux and macOS via Conda from the
99
Both the ``x86_64`` (Intel) architecture and the ``arm64``/``aarch64``
1010
architectures (including Apple Silicon, M1, M2, M3, M4) are supported.
1111

12-
You will need a working Conda installation: either Miniforge (or Mambaforge),
13-
Miniconda or Anaconda. If you don't have one yet, we recommend installing
14-
`Miniforge <https://github.com/conda-forge/miniforge>`_ as
15-
follows. In a terminal,
12+
You will need a working Conda installation: either Miniforge, Miniconda or
13+
Anaconda. If you don't have one yet, we recommend installing `Miniforge
14+
<https://github.com/conda-forge/miniforge>`_ as follows. In a terminal,
1615

1716
.. code-block:: shell
1817
19-
$ curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
20-
$ bash Miniforge3-$(uname)-$(uname -m).sh
18+
$ curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
19+
$ bash Miniforge3-$(uname)-$(uname -m).sh
2120
22-
* Miniforge (and Mambaforge) use conda-forge as the default channel.
23-
24-
* If you are using Miniconda or Anaconda, set it up to use conda-forge:
21+
* Miniforge uses conda-forge as the default channel. However, if you are using
22+
Miniconda or Anaconda, set it up to use conda-forge:
2523

2624
* Add the conda-forge channel: ``conda config --add channels conda-forge``
2725

@@ -42,15 +40,13 @@ Create a new conda environment containing SageMath, either with ``mamba`` or ``c
4240

4341
.. code-block:: shell
4442
45-
$ mamba create -n sage sage python=X
43+
$ mamba create -n sage sage
4644
4745
.. tab:: conda
4846

4947
.. code-block:: shell
5048
51-
$ conda create -n sage sage python=X
52-
53-
where ``X`` is version of Python, e.g. ``3.12``.
49+
$ conda create -n sage sage
5450
5551
To use Sage from there,
5652

@@ -60,95 +56,3 @@ To use Sage from there,
6056
If there are any installation failures, please report them to
6157
the conda-forge maintainers by opening a `GitHub Issue for
6258
conda-forge/sage-feedstock <https://github.com/conda-forge/sage-feedstock/issues>`_.
63-
64-
.. _sec-installation-conda-develop:
65-
66-
Using conda to provide all dependencies for the Sage library
67-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68-
69-
You can build and install the Sage library from source, using conda to
70-
provide all of its dependencies. This bypasses most of the build
71-
system of the Sage distribution and is the fastest way to set up an
72-
environment for Sage development.
73-
74-
Here we assume that you are using a git checkout.
75-
76-
- Optionally, set the build parallelism for the Sage library. Use
77-
whatever the meaningful value for your machine is - no more than
78-
the number of cores::
79-
80-
$ export SAGE_NUM_THREADS=24
81-
82-
- Create and activate a new conda environment with the dependencies of Sage
83-
and a few additional developer tools:
84-
85-
.. tab:: mamba
86-
87-
.. code-block:: shell
88-
89-
$ mamba env create --file environment-3.12-linux.yml --name sage-dev
90-
$ conda activate sage-dev
91-
92-
.. tab:: conda
93-
94-
.. code-block:: shell
95-
96-
$ conda env create --file environment-3.12-linux.yml --name sage-dev
97-
$ conda activate sage-dev
98-
99-
Alternatively, you can use ``environment-3.12-linux.yml`` or
100-
``environment-optional-3.12-linux.yml``, which will only install standard
101-
(and optional) packages without any additional developer tools.
102-
103-
A different Python version can be selected by replacing ``3.12`` with the
104-
desired version.
105-
106-
- Bootstrap the source tree and install the build prerequisites and the Sage library::
107-
108-
$ ./bootstrap
109-
$ pip install --no-build-isolation --config-settings editable_mode=compat -v -v --editable ./src
110-
111-
- Verify that Sage has been installed::
112-
113-
$ sage -c 'print(version())'
114-
SageMath version 10.2.beta4, Release Date: 2023-09-24
115-
116-
Note that ``make`` is not used at all. All dependencies
117-
(including all Python packages) are provided by conda.
118-
119-
Thus, you will get a working version of Sage much faster. However,
120-
note that this will invalidate the use of any Sage-the-distribution
121-
commands such as ``sage -i``. Do not use them.
122-
123-
By using ``pip install --editable`` in the above steps, the Sage
124-
library is installed in editable mode. This means that when you only
125-
edit Python files, there is no need to rebuild the library; it
126-
suffices to restart Sage.
127-
128-
After editing any Cython files, rebuild the Sage library using::
129-
130-
$ pip install --no-build-isolation --config-settings editable_mode=compat -v -v --editable src
131-
132-
In order to update the conda environment later, you can run::
133-
134-
$ mamba env update --file environment-3.12-linux.yml --name sage-dev
135-
136-
To build the documentation, use::
137-
138-
$ pip install --no-build-isolation -v -v --editable ./pkgs/sage-docbuild
139-
$ sage --docbuild all html
140-
141-
.. NOTE::
142-
143-
The switch ``--config-settings editable_mode=compat`` restores the
144-
`legacy setuptools implementation of editable installations
145-
<https://setuptools.pypa.io/en/latest/userguide/development_mode.html>`_.
146-
Adventurous developers may omit this switch to try the modern,
147-
PEP-660 implementation of editable installations, see :issue:`34209`.
148-
149-
.. NOTE::
150-
151-
You can update the conda lock files by running
152-
``.github/workflows/conda-lock-update.py`` or by running
153-
``conda-lock --platform linux-64 --filename environment-3.12-linux.yml --lockfile environment-3.12-linux.lock``
154-
manually.

0 commit comments

Comments
 (0)