Requirements
------------

* At least Python 3.9

If not mentioned otherwise, Python packages are available from PyPI
(https://pypi.python.org/pypi).

* NICOS specific Python packages (available from http://forge.frm2.tum.de/simple):

  - nicos-pyctl
  - nicos-quickyaml

* Required Python packages:

  - numpy
  - pyzmq version >= 2
  - rsa
  - toml
  - lttb version >= 0.2.2

* For the provided SysV compatible init script and nicos-demo:

  - psutil version >= 0.4 (recommended >= 2.0)

* For running on Linux under systemd:

  - python-systemd

* For hardware access (optional):

  - PyTango 9.x (for TANGO interface, needs TANGO libraries)
  - EPICSv3 and pyepics or p4p/caproto (for Epics interface)
  - a working installation of omniORBpy 4.2.X (http://omniorb.sourceforge.net/) (for CARESS interface)
  - pyserial (for direct serial line communication)

* Optional for the basic system:

  - scipy (for data fitting)
  - docutils (for formatting interactive help nicely)
  - matplotlib (for resolution plots)
  - gnuplot (for plots in the electronic logbook)
  - astropy or pyfits (for the handling of FITS formatted files)
  - ldap3 (for ldap authentication)
  - sendsms tool to use the SMS notifier (See: http://smslink.sourceforge.net/)
  - keyring, keyrings.alt, pycryptodomex for encrypted password storage (note: using
    the keystore commandline program may require additional system dependent
    dependencies)
  - requests-oauthlib to use the OAuth authentication
  - slackclient python package to use the Slack notifier
  - opencv python package for the sharpness calculation of an image

* For the GUI and status monitor:

  - PyQt5 (^5.13) or PyQt6 (^6.3.1)
  - PyQtWebEngine (^5.13) or PyQt6-WebEngine (^6.3.1)
  - gr (optional, for plots, see: http://gr-framework.org/c.html#linux-packages)
  - QScintilla-python (optional, for the script editor component)
    (not installable with pip)
  - scipy (optional, for fitting)
  - cfitsio (optional, required by nicos-livewidget, this not a Python package)
  - python-redmine (optional, for the bug reporting dialog)
  - sshtunnel (optional, for the ssh tunneling between GUI and server)
  - dvipng (optional, for the hklplot command, this is not a Python package)

* For development (running tests, generating documentation):

  - pytest
  - coverage (optional)
  - sphinx (for generating doc)
  - pyftpdlib

* Under Windows:

  - pyreadline (optional, for the console to work)
  - colorama (optional, for colored console output)

Detailed version requirements can always be found in the requirements.txt
file in the root of the source tree.

If not supplied by the distribution (see below), most dependencies (except
GR) can be installed from the Python package repository::

  pip install -r requirements.txt

Development and documentation build dependencies can be installed with::

  pip install -r requirements-dev.txt

pip can be obtained from https://pip.pypa.io/en/stable/

For Debian/Ubuntu::

  apt-get install python3-pip


Packages to install for common distributions
--------------------------------------------

GR runtime packages (`gr` and `python-gr`) are available in the repositories
linked at:
https://software.opensuse.org/download.html?project=science:gr-framework&package=gr

Generic Debian/Ubuntu
^^^^^^^^^^^^^^^^^^^^^

Please add the local repository via:

     echo "deb [trusted=yes] https://forge.frm2.tum.de/repos distro/"| sudo tee /etc/apt/sources.list.d/mlz.list
     apt update

where 'distro' stands for:

     - focal (Ubuntu 20.04)
     - jammy (Ubunut 22.04)
     - bullseye (Debian 11)
     - bookworm (Debian 12)

* Basic system::

     apt-get install python3-{dev,zmq,numpy,scipy,psutil,rsa,systemd,toml} gnuplot
     apt-get install python3-{keyring,keyrings.alt,html2text}
     apt-get install python3-{lttb,nicos-pyctl,nicos-quickyaml}

* Optional components::

     apt-get install python3-{ldap3,docutils,serial,matplotlib,astropy,h5py,markdown,opencv,pika,tz}
     apt-get install frappy-core
     apt-get install python3-{kafka,confluent-kafka,pyepics}

* GUI and status monitor::

     apt-get install python3-{pyqt5,pyqt5.qsci,pyqt5.qtwebengine,gr}
     apt-get install dvipng texlive-{latex-extra,fonts-recommended} cm-super

* Development and documentation build::

     apt-get install python3-{sip-dev,pytest,pytest-cov,pytest-timeout,coverage}
     apt-get install python3-{sphinx,sphinx-rtd-theme}
     apt-get install python3-pyqt5-{dev,dev-tools}

* GR library repository

     To add the GR repository the gpg and curl tools are needed

     apt-get install gpg curl


Debian 11/12 (Bullseye/Bookworm)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

An additional plugin for pytest is required (which was formerly included).

* Development and documentation build::

     apt-get install python3-pytest-timeout
