Skip to content

Commit

Permalink
chore: update README installation instructions
Browse files Browse the repository at this point in the history
with Nix and Poetry
  • Loading branch information
minijackson committed Dec 6, 2023
1 parent 3131e93 commit 8de967f
Showing 1 changed file with 44 additions and 47 deletions.
91 changes: 44 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,101 +7,98 @@ WeTest reads YAML files describing tests targeting EPICS PV,
executes these tests in CLI with or without a GUI,
and generates a report in PDF.

Installation
------------
## Installation

### Python and Tkinter

WeTest is implemented in Python 2.7, which therefore needs to be installed
on your machine (support for Python 3.x is planned but not yet available).
WeTest is implemented in Python 3, which needs to be installed.

Usually the `Tkinter` module should be included in your python installation,
if it is not the case you will also need to install the corresponding package.
The `Tkinter` module should be included in your python installation.
If not, you need to also install the corresponding package.
This module is needed for the graphical interface.

For example in Ubuntu:

```bash
sudo apt-get install python-tk
```

For example in CentOS:

```bash
sudo yum install tkinter
```

WeTest is currently successfully running on CentOS 7 and Ubuntu 18.04
(support for Windows is planned but not yet available).

### Install using virtualenv
### Build using Nix

To install virtualenv, if it's not already installed:
First, install Nix.
Refer to the [Download Nix] page for instructions.

```bash
sudo pip install virtualenv
```
Then, run:

And to use virtualenv, first go in the clone repository:

```bash
cd WeTest
virtualenv --python=<path-to-pyton-version> venv # creates the virtual environment in the folder ./venv
eg: $ virtualenv --python=/usr/bin/python2.7 venv
source ./venv/bin/activate # activates the environment
``` bash
nix-build
```

To install WeTest go inside the cloned repository folder and type:
This builds WeTest and its dependencies,
and puts the compilation result under `./result`.

```bash
pip install .
```
After running the build, you can run WeTest by running:

You can use `wetest` as a regular command line utility after that.
``` bash
./result/bin/wetest
```

To deactivate the environment:
If you want WeTest available in your global user environment,
then you can run:

```bash
deactivate
``` bash
nix-env -i -f default.nix
```

[Download Nix]: https://nixos.org/download#download-nix

### Install using conda
### Build using Poetry

To install conda if it's not already installed see:
https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html
First, install Poetry.
Refer to the [Poetry documentation] for instructions.

Once installed, create a python 2.7 environment for WeTest and activate it:
To build the project,
you can run:

```bash
conda create -yn wetest python=2.7
conda activate wetest
``` bash
poetry install
poetry build
```

To install WeTest go inside the cloned repository folder and type:
Running WeTest can be done with:

```bash
cd WeTest
python setup.py install
``` bash
poetry run wetest [other arguments]
```

You can use `wetest` as a regular command line utility after that.
[Poetry documentation]: https://python-poetry.org/docs/

To deactivate the environment:
### Set up pyepics

```bash
conda deactivate
```

### Setup pyepics
Setting up pyepics is *not* needed for the Nix build.

WeTest relies on the `pyepics` module, and therefore depending on your EPICS installation
WeTest relies on the `pyepics` module,
and depending on your EPICS installation
you might need to set up the `PYEPICS_LIBCA` environment variable manually.

For instance:
```bash

``` bash
export PYEPICS_LIBCA=/opt/epics/bases/base-3.14.12.5/lib/centos7-x86_64/libca.so
```

You can find full explanation [here](http://cars9.uchicago.edu/software/python/pyepics3/installation.html#getting-started-setting-up-the-epics-environment).
You can find full explanation in the [pyepics installation] page.

[pyepics installation]: http://cars9.uchicago.edu/software/python/pyepics3/installation.html#getting-started-setting-up-the-epics-environment

Run WeTest
----------
Expand Down

0 comments on commit 8de967f

Please sign in to comment.