diff --git a/README.md b/README.md index 0eb3dd8a7..7d5037f8b 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,27 @@ Please visit the project's documentation [page](https://reframe-hpc.readthedocs. ReFrame is fairly easy to install as PyPI package. +### Installing using `pip` + +```bash +pip install reframe-hpc +``` + +This will also install the manpages and the shell completions under your pip's virtual environment: + +| | | +|---|---| +| `reframe` executable | `${VIRTUAL_ENV}/bin` | +| Man pages | `${VIRTUAL_ENV}/share/man` | +| Bash/Zsh completions | `${VIRTUAL_ENV}/share/bash-completion/completions/reframe` | +| Fish completions | `${VIRTUAL_ENV}/share/fish/vendor_completions.d/reframe.fish` | + + +### Installing using `uv` + +You can use any package manager that understands `pyproject.toml`-based Python projects to install ReFrame. +In this section we describe in more detail handling an installation using `uv`. + ```bash # Fetch uv curl -LsSf https://astral.sh/uv/install.sh | sh @@ -52,7 +73,7 @@ reframe -V This will place the `reframe` executable under `$HOME/.local/bin` and the package under `$HOME/.local/share/uv/tools/reframe-hpc`. To make available the manpage and the shell completions add the following lines in your shell's profile script: -### Bash/Zsh +#### Bash/Zsh Add the following lines to your `$HOME/.profile`: @@ -61,7 +82,7 @@ export MANPATH=${HOME}/.local/share/uv/tools/reframe-hpc/share/man:${MANPATH}: source ${HOME}/.local/share/uv/tools/reframe-hpc/share/bash-completion/completions/reframe ``` -### Fish +#### Fish Add the following lines to your `$HOME/.config/fish/config.fish`: @@ -70,10 +91,7 @@ set -apgx MANPATH ${HOME}/.local/share/uv/tools/reframe-hpc/share/man "" source ${HOME}/.local/share/uv/tools/reframe-hpc/share/fish/vendor_completions.d/reframe.fish ``` -> NOTE: Using `uv` is not required to install ReFrame. -> You can use any modern Python build system that recognizes the `pyproject.toml` file. - -### Multi-architecture installations on shared filesystem +#### Multi-architecture installations on shared filesystem If you plan to install ReFrame for multiple platforms in a shared installation, you should make sure each installation resides in a different prefix. You can achieve this with `uv` as follows: @@ -97,6 +115,29 @@ It also caches them, so that the next time you invoke it, it will not download a The only "downside" of this method is that you have to always invoke ReFrame through `uvx`, as opposed to the `uv tool install` method, where the `reframe` executable is installed in a standard path. +### Installation extras + +When installing ReFrame you can opt-in or opt-out from certain features. +For example, using `pip` you can use the brackets syntax: + +```bash +# Opt-in for an extra +pip install reframe-hpc[extra] + +# Opt-out from a feature +pip install reframe-hpc[no-feature] +``` + +With `uv` you can either use the brackets notation or use the `--extra` option. + +Here is a list of the available extras during installation: + +| Extra | Description | +|---|---| +| `graylog` | Install Graylog bindings | +| `no-analytics` | Do not install the analytics layers; this will disable results storage feature but will make the installation more compact. | + + ## Running from source If you want to run the latest ReFrame directly from the repo, you can simply clone the repo and `uv run` ReFrame: diff --git a/ci-scripts/dockerfiles/reframe-envmodules.dockerfile b/ci-scripts/dockerfiles/reframe-envmodules.dockerfile index b57656b76..2fad4a2cb 100644 --- a/ci-scripts/dockerfiles/reframe-envmodules.dockerfile +++ b/ci-scripts/dockerfiles/reframe-envmodules.dockerfile @@ -29,4 +29,4 @@ RUN uv sync --group dev && \ echo ". $BASH_ENV" >> /home/rfmuser/.profile ENV BASH_ENV=/home/rfmuser/.profile -CMD ["/bin/bash", "-c", "uv run coverage run --source=reframe ./test_reframe.py --rfm-user-config=ci-scripts/configs/envmod.py; uv run coverage xml -o coverage.xml"] +CMD ["/bin/bash", "-c", "uv run coverage run --source=reframe ./test_reframe.py --rfm-user-config=ci-scripts/configs/envmod.py; rv=$?; uv run coverage xml -o coverage.xml; exit $rv"] diff --git a/ci-scripts/dockerfiles/reframe-lmod.dockerfile b/ci-scripts/dockerfiles/reframe-lmod.dockerfile index d112a577d..4b67354eb 100644 --- a/ci-scripts/dockerfiles/reframe-lmod.dockerfile +++ b/ci-scripts/dockerfiles/reframe-lmod.dockerfile @@ -28,4 +28,4 @@ RUN uv sync --group dev && \ echo ". $BASH_ENV" >> /home/rfmuser/.profile ENV BASH_ENV=/home/rfmuser/.profile -CMD ["/bin/bash", "-c", "uv run coverage run --source=reframe ./test_reframe.py -v --rfm-user-config=ci-scripts/configs/lmod.py; uv run coverage xml -o coverage.xml"] +CMD ["/bin/bash", "-c", "uv run coverage run --source=reframe ./test_reframe.py -v --rfm-user-config=ci-scripts/configs/lmod.py; rv=$?; uv run coverage xml -o coverage.xml; exit $rv"] diff --git a/ci-scripts/dockerfiles/reframe-spack.dockerfile b/ci-scripts/dockerfiles/reframe-spack.dockerfile index a671ac74c..e9b1aafbe 100644 --- a/ci-scripts/dockerfiles/reframe-spack.dockerfile +++ b/ci-scripts/dockerfiles/reframe-spack.dockerfile @@ -34,4 +34,4 @@ RUN uv sync --group dev && \ echo '. /home/rfmuser/spack/share/spack/setup-env.sh' >> /home/rfmuser/.profile ENV BASH_ENV=/home/rfmuser/.profile -CMD ["/bin/bash", "-c", "uv run coverage run --source=reframe ./test_reframe.py -v --rfm-user-config=ci-scripts/configs/spack.py; uv run coverage xml -o coverage.xml"] +CMD ["/bin/bash", "-c", "uv run coverage run --source=reframe ./test_reframe.py -v --rfm-user-config=ci-scripts/configs/spack.py; rv=$?; uv run coverage xml -o coverage.xml; exit $rv"] diff --git a/docs/started.rst b/docs/started.rst index ca4a2cd58..ed84977d3 100644 --- a/docs/started.rst +++ b/docs/started.rst @@ -142,6 +142,36 @@ This will install the man pages as well as the `Graylog str: '''Strip aggregation suffix from column''' return self._agg_names.get(col, col) - def col_spec(self, extra_cols: List[str]) -> List[pl.Expr]: + def col_spec(self, extra_cols: List[str]): '''Return a list of polars expressions for this aggregation''' + import polars as pl + def _expr_from_op(col, op): if op == 'min': return pl.col(col).min().alias(f'{col} (min)')