Skip to content

Commit 103f973

Browse files
author
Release Manager
committed
sagemathgh-40124: Update Meson and Conda install instructions <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Make the Meson build instructions independent from the Conda and sage- the-distro instructions (previously it was linking to the relevant section for the basic setup). Also includes now how to use `uv` to setup a python env. The conda instructions have been also updated, based on the work in sagemath#39515. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#40124 Reported by: Tobias Diez Reviewer(s):
2 parents 742031f + 1462fff commit 103f973

File tree

5 files changed

+206
-207
lines changed

5 files changed

+206
-207
lines changed

.devcontainer/onCreate-meson.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ uv venv
2020
uv pip install \
2121
meson-python \
2222
"cypari2 >=2.2.1" \
23-
"cysignals >=1.11.2, != 1.12.0" \
23+
"cython >=3.0, != 3.0.3, != 3.1.0" \
2424
"cython >=3.0, != 3.0.3" \
2525
"gmpy2 ~=2.1.b999" \
2626
memory_allocator \
2727
"numpy >=1.25" \
28-
jinja2
29-
uv sync --frozen --inexact --no-build-isolation-package=sagemath
28+
jinja2 \
29+
setuptool
30+
uv sync --frozen --inexact --no-build-isolation

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,16 @@ jobs:
6262
run: |
6363
# Install build dependencies manually as workaround for https://github.com/astral-sh/uv/issues/1516
6464
uv pip install \
65-
meson-python \
66-
"cypari2 >=2.2.1" \
67-
"cysignals >=1.11.2, != 1.12.0" \
68-
"cython >=3.0, != 3.0.3" \
69-
"gmpy2 ~=2.1.b999" \
70-
memory_allocator \
71-
"numpy >=1.25" \
72-
jinja2
73-
74-
uv sync --frozen --inexact --no-build-isolation-package=sagemath
65+
meson-python \
66+
"cypari2 >=2.2.1" \
67+
"cython >=3.0, != 3.0.3, != 3.1.0" \
68+
"cython >=3.0, != 3.0.3" \
69+
"gmpy2 ~=2.1.b999" \
70+
memory_allocator \
71+
"numpy >=1.25" \
72+
jinja2 \
73+
setuptool
74+
uv sync --frozen --inexact --no-build-isolation
7575
7676
- name: Test
7777
run: |

.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)