Installation of NUTS
====================
Installation Instructions
-------------------------
Nuts requires Python 3.8 or higher.
Installation via pip
....................
NUTS is published on the Python Package Index (`PyPI `_), therefore you can install nuts using ``pip``:
.. code:: shell
pip install nuts
Installation via poetry
.......................
Nuts uses `poetry `__ as a dependency manager.
#. `Install poetry `__.
#. Clone the `nuts repository `__
#. Change into the cloned folder, then install all necessary dependencies: ``$ poetry install``
#. Install nuts: ``$ pip install .``
Installation via container
..........................
Nuts is also available in a dockerized version. It uses the GitHub registry.
.. code:: shell
docker pull ghcr.io/network-unit-testing-system/nuts:latest
docker run -it ghcr.io/network-unit-testing-system/nuts
Parsing with ntc-templates
--------------------------
In order to parse answers from network devices, some NUTS test classes use `netmiko in combination with ntc-templates `__ (ntc-templates: TextFSM Templates for Network Devices). These NUTS tests rely on ntc-templates:
* ``TestNetmikoCdpNeighbors``
* ``TestNetmikoOspfNeighborsCount``
* ``TestNetmikoOspfNeighbors``
If you run these test classes, please make sure to configure access to ntc-templates correctly:
1. Clone the `ntc-templates repository `__ into your project root, on the same hierarchical level as your ``inventory`` and ``tests`` folder.
2. Set environment variable:
.. code:: shell
$ export NET_TEXTFSM=/path/to/ntc-templates/templates/
`More on Netmiko and TextFSM `__
Deinstallation
--------------
.. code:: shell
pip uninstall nuts
If you installed everything in a virtual environment, you can delete the folder that contains the virtual environment.