Preliminaries

Linux (Debian / Ubuntu)

Depending on your preferences, you may install the dependencies through APT, or through PIP. Please see the following steps if you want to use APT dependencies.

  • Install poetry:

sudo apt update
sudo apt install python3-poetry python3-trove-classifiers
  • Install the APT dependencies:

sudo apt install git graphviz python3 python3-notebook python3-numpy python3-pytest
  • If you are a developer, please also install the following dependencies:

sudo apt install python3-pip bumpversion python3-coverage python3-pytest python3-pytest-cov python3-pytest-runner python3-sphinx python3-sphinx-rtd-theme
sudo pip3 install sphinx_mdinclude --break-system-packages

Windows

Installation from PIP

There are several possible ways to install the package:

  • In a `virtual environment <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/>`_: this is the recommended approach.

python3 -m venv env      # Create your virtual environment
source env/bin/activate  # Activate the "env" virtual environment
which python             # Check you use the venv python interpret (i.e., not /usr/bin/python3)
pip install regexp-learner
deactivate               # Leave the  "env" virtual environment
  • System-wide: modern pip3 version prevents to install packages system-wide. You must either use a virtual environment, or either pass the --break-system-packages options:

sudo pip3 install regexp-learner --break-system-packages

Installation from sources

  • Clone the repository and install the package:

git clone https://github.com/nokia/regexp-learner.git
cd regexp-learner
  • Install the missing dependencies and build the wheel of the project:

poetry install  # Install the core dependencies. Pass --with docs,test,dev to get the whole set of dependencies.
poetry build    # Build the wheel (see dist/*whl)
  • Install the wheel you just built, according to one of the following method, that affects the installation scope:

    • In the ``poetry`` environment: this imposes to run your python-related commands through poetry run.

poetry run pip3 install dist/*whl
python3 -m venv env      # Create your virtual environment
source env/bin/activate  # Activate the "env" virtual environment
which python             # Should be your "env" python interpreter (not /usr/bin/python3)
pip install dist/*whl    # Install your wheel
deactivate               # Leave the  "env" virtual environment
  • System-wide (Linux):

sudo pip3 install dist/*whl --break-system-packages