Skip to content

Commit 4a2d66d

Browse files
committed
Merge branch 'topic/default/doc' into 'branch/default'
doc install-locked-env and co See merge request fluiddyn/fluidsim!448
2 parents 0a5ff2c + fb213b5 commit 4a2d66d

File tree

4 files changed

+67
-17
lines changed

4 files changed

+67
-17
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ pip install fluidsim
3232
There are also conda packages in the conda-forge channel usable with
3333
[Pixi](https://pixi.sh) or [conda/mamba](https://github.com/conda-forge/miniforge).
3434

35+
The simplest way to get a production environment using the conda-forge packages is with
36+
37+
```sh
38+
uvx install-locked-env https://github.com/fluiddyn/fluidsim/tree/branch/default/pixi-envs/env-fluidsim-mpi
39+
```
40+
3541
Much more detailed instructions are given in
3642
[the documentation](https://fluidsim.readthedocs.io/en/latest/install.html).
3743

doc/build-from-source.md

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ Cloud](https://www.clever-cloud.com) for providing <https://foss.heptapod.net>!
4141

4242
## Installing from the repository
4343

44-
### Simple installation from source
44+
We describe few methods to install Fluidsim from source. Most developers should adopt
45+
[the method using PDM](#setup-dev-env).
4546

46-
We recommend to create a clean virtual environment, for example with:
47+
### Simple installation from source with Pip
48+
49+
When using Pip, we recommend to create a clean virtual environment, for example with:
4750

4851
```sh
4952
cd fluidsim
@@ -172,19 +175,21 @@ Note that Fluidsim builds are not sensible to the [`~/.pythranrc` file](pythranr
172175
173176
```
174177

178+
(setup-dev-env)=
179+
175180
### Setup a full developer environment with editable installation
176181

177182
Let us first present the tools used for Fluidsim development.
178183

179-
- [PDM] is a modern Python package and dependency manager,
184+
- [Pip] is the official package installer for Python,
180185

181-
- [Meson] is an open source build system (in particular used by Scipy),
186+
- [PDM] is a modern Python package and dependency manager,
182187

183188
- [Nox] is a command-line tool that automates testing in multiple Python environments,
184189

185-
- [Pytest] is the most popular testing framework for Python,
190+
- [Meson] is an open source build system (in particular used by Scipy),
186191

187-
- [pip] is the official package installer for Python,
192+
- [Pytest] is the most popular testing framework for Python,
188193

189194
- [Pythran] is an ahead of time compiler for a subset of the Python language, with a
190195
focus on scientific computing,
@@ -196,6 +201,11 @@ Fluidsim is built with [Meson]. We use [PDM] for Fluidsim development. [Pytest]
196201
are used for testing. We use [Pythran] through [Transonic] to accelerate some numerical
197202
kernels written in Python.
198203

204+
```{note}
205+
Most dependencies (Meson, Pytest, Pythran, Transonic, ...) will be installed by PDM.
206+
The developers just have to install manually PDM (and potentially Nox).
207+
```
208+
199209
#### Standard Python from Python.org
200210

201211
We present here how one can build Fluidsim from source like the main developers and
@@ -214,15 +224,33 @@ pipx install pdm -U
214224

215225
Installing in editable mode is a bit particular with Meson, since editable installations
216226
are incompatible with isolated builds, meaning that all build dependencies have to be
217-
installed in the main virtual environment! Fortunatelly, it's not too difficult with
218-
[PDM]. From the root directory of the repository, just run:
227+
installed in the main virtual environment! Fortunatelly, it's simple with [PDM].
228+
229+
##### Build-install Fluidimage with PDM
230+
231+
```{warning}
232+
You should not run the following commands from a virtual environment not related to Fluidimage.
233+
234+
No need to manually create a dedicated environment since PDM is going to do it for you.
235+
Just deactivate all Python environments.
236+
```
237+
238+
From the root directory of the repository, just run:
239+
240+
```sh
241+
pdm sync --clean -v
242+
```
243+
244+
This command creates a virtual environment, installs all build and runtime dependencies,
245+
and finally build/install Fluidsim from source.
246+
247+
Alternativelly, one can split this process in two steps. First, install all dependencies:
219248

220249
```sh
221-
pdm install --no-self
250+
pdm sync --no-self --clean
222251
```
223252

224-
This command creates a virtual environment and installs all build and runtime
225-
dependencies. You can then activate this environment and build/install Fluidsim with:
253+
You can then activate the environment and build/install Fluidsim with:
226254

227255
```sh
228256
. .venv/bin/activate

doc/install.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,22 @@ environments in the Fluidsim repository
100100
- `env-fluidsim-mpi` is for running sequential and parallel (MPI) simulations and
101101
post-process results. It is only available on Linux.
102102

103-
First, get one of these directories locally on your computer (the easiest is to clone the
104-
Mercurial repo <https://foss.heptapod.net/fluiddyn/fluidsim> or the Git mirror
105-
<https://github.com/fluiddyn/fluidsim/>). To install and to use one of these
106-
environments, enter into the directory and run `pixi shell`.
103+
The simplest solution to install one of these environment locally is to use `uv` and the
104+
tool `install-locked-env` like this:
105+
106+
```sh
107+
cd where/you/want/to/have/the/pixi/env/directory
108+
uvx install-locked-env https://github.com/fluiddyn/fluidsim/tree/branch/default/pixi-envs/env-fluidsim
109+
```
110+
111+
To use one of these environments, enter into the directory and run `pixi shell`.
112+
113+
```{admonition} Alternative method without install-locked-env
114+
Alternatively, one needs to get these directories locally on your computer
115+
(for example by cloning the Mercurial repo
116+
<https://foss.heptapod.net/fluiddyn/fluidsim> or the Git mirror
117+
<https://github.com/fluiddyn/fluidsim/>) and run `pixi shell`.
118+
```
107119

108120
````{admonition} How to activate such environment in shell scripts?
109121
@@ -115,6 +127,8 @@ eval "$(pixi shell-hook --manifest-path ~/dev/fluidsim/pixi-envs/env-fluidsim-mp
115127

116128
````{admonition} How to register a Jupyter kernel using this environment
117129
130+
(This step should already have been done if you used `install-locked-env`.)
131+
118132
```sh
119133
pixi shell --manifest-path ~/dev/fluidsim/pixi-envs/env-fluidsim-mpi
120134
python -m ipykernel install --user --name=env-fluidsim-mpi

doc/related-projects.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Related projects
22

3-
There are many CFD framework and Fourier pseudo-spectral solvers. We just list here few examples:
3+
There are many CFD framework and Fourier pseudo-spectral solvers. We just list here few
4+
examples:
45

56
## Open-source
67

@@ -20,4 +21,5 @@ There are many CFD framework and Fourier pseudo-spectral solvers. We just list h
2021

2122
## Not open-source
2223

23-
- [GESTS](https://impact.ornl.gov/en/publications/gpu-enabled-extreme-scale-turbulence-simulations-fourier-pseudo-s/) (P.K. Yeung)
24+
- [GESTS](https://impact.ornl.gov/en/publications/gpu-enabled-extreme-scale-turbulence-simulations-fourier-pseudo-s/)
25+
(P.K. Yeung)

0 commit comments

Comments
 (0)