Skip to content

Commit

Permalink
Document how to enable tab completion in conda (#2316)
Browse files Browse the repository at this point in the history
  • Loading branch information
ltalirz authored and sphuber committed Dec 7, 2018
1 parent 77a5dd3 commit 05fae57
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 19 deletions.
9 changes: 5 additions & 4 deletions docs/source/backup/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,10 @@ where PROFILENAME is the name of the profile you want to use (if you don't speci

You should put this line into the actions performed at start-up (under gnome you
can access them by typing ``gnome-session-properties`` in a terminal), so that the
remote directory is mounted automatically after a reboot (but do not put it in
your ``.bashrc`` file otherwise each time you open a new terminal, your
computer will complain that the mount point is not empty...).
remote directory is mounted automatically after a reboot.
Do **not** put it in your shell's startup file (e.g. ``.bashrc``) -
otherwise each time you open a new terminal, your computer will complain that
the mount point is not empty...


A template backup configuration file (``backup_info.json.tmpl``) will be copied
Expand Down Expand Up @@ -305,4 +306,4 @@ day) to backup new changes.
command -- from ``mailutils`` -- is configured appropriately).

Finally, do not forget to exclude the repository folder from the normal backup
of your home directory!
of your home directory!
4 changes: 2 additions & 2 deletions docs/source/developer_guide/devel_tutorial/cmdline_plugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ Example test in ``test_float_cmd.py``::

BACKEND = os.environ.get('TEST_BACKEND')
# load the backend to be tested from the environment variable
# on bash, simply prepend the test command with TEST_BACKEND='django' or TEST_BACKEND='sqlalchemy'
# or set the TEST_BACKEND in your CI configuration
# in your shell, simply prepend the test command with TEST_BACKEND='django' or TEST_BACKEND='sqlalchemy'
# or set the TEST_BACKEND variable in your CI configuration

def setUp(self):
from aiida.orm import DataFactory
Expand Down
8 changes: 6 additions & 2 deletions docs/source/get_started/computers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ Remote computer requirements
Requirements for a computer are:

* It must run a Unix-like operating system
* The default shell must be ``bash``
* It must have ``bash`` installed
* It should have a batch scheduler installed (see :doc:`here <../scheduler/index>`
for a list of supported batch schedulers)
* It must be accessible from the machine that runs AiiDA using one of the
available transports (see below).

.. note::
AiiDA will use ``bash`` on the remote computer, regardless of the default shell.
Please ensure that your remote ``bash`` configuration does not load a different shell.

The first step is to choose the transport to connect to the computer. Typically,
you will want to use the SSH transport, apart from a few special cases where
Expand Down Expand Up @@ -69,7 +73,7 @@ should show you a prompt without errors (possibly with a message saying

.. note:: If the ``ssh`` command works, but the ``sftp`` command does not
(e.g. it just prints ``Connection closed``), a possible reason can be
that there is a line in your ``~/.bashrc`` that either produces an output,
that there is a line in your ``~/.bashrc`` that either produces text output,
or an error. Remove/comment it until no output or error is produced: this
should make ``sftp`` working again.

Expand Down
5 changes: 2 additions & 3 deletions docs/source/install/details/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
Operating Systems
=================

This page provides some installation instructions for installing the prerequisite software necessary to run AiiDA.
Note that we do not officially support all platforms and cannot therefore provide instructions for all possible operating systems.


Ubuntu
Expand Down Expand Up @@ -37,7 +35,7 @@ If you run into trouble, please refer to the RabbitMQ :ref:`troubleshooting sect
Mac OS X
--------

For Mac OS it is adviced to use the `Homebrew`_ package manager.
For Mac OS we recommend using the `Homebrew`_ package manager.
If you have not installed Homebrew yet, you can do so with the following command:

.. code-block:: bash
Expand Down Expand Up @@ -119,3 +117,4 @@ The guide for Ubuntu above can be followed but there are a few things to note:
dpkg-reconfigure tzdata

#. The file open limit may need to be raised using ``sudo ulimit -n 2048`` (default is 1024), when running tests.

27 changes: 19 additions & 8 deletions docs/source/install/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
Installation
************

This section of the manual will guide you through the process of installing AiiDA on your system.
AiiDA has been tested to run on the following platforms:
AiiDA is designed to run on `Unix <https://en.wikipedia.org/wiki/Unix>`_ operating systems,
and has been tested on the following platforms:

* Ubuntu 14.04, 16.04
* Mac OS X

We expect that AiiDA should also run on these other platforms:
We expect that AiiDA should also run on:

* Older and newer Ubuntu versions
* Other Linux distributions
* Windows subsystem for Linux

The installation procedure can generally be split into four separate steps:

Expand All @@ -31,6 +32,8 @@ Install prerequisites
The installation procedure itself requires certain software, which therefore will have to be installed first.
The following software is required to continue with the installation:

* `bash <https://en.wikipedia.org/wiki/Bash_(Unix_shell)>`_ or
`zsh <https://en.wikipedia.org/wiki/Z_shell>`_ (The shell)
* `git`_ (To download the ``aiida-core`` repository)
* `python-2.7.x`_ (The programming language used for AiiDA)
* `python-pip`_ (Python package manager)
Expand Down Expand Up @@ -197,16 +200,24 @@ Configure AiiDA

Verdi tab-completion
--------------------
The ``verdi`` command line interface has many commands and options.
To simplify its usage, there is a way to enable tab-completion for it in your shell.
To do so, simply add the following line to the activation script of your virtual environment (or to your shell config, e.g. ``.bashrc``)::
The ``verdi`` command line interface has many commands and options,
which can be tab-completed to simplify your life.
Enable tab-completion with the following shell command::

eval "$(_VERDI_COMPLETE=source verdi)"

For the changes to apply to your current shell, make sure to source the activation script or ``.bashrc`` (depending the approach you chose).
Place this command in your startup file, i.e. one of

* the startup file of your shell (``.bashrc``, ``.zsh``, ...), if aiida is installed system-wide
* the `activate script <https://virtualenv.pypa.io/en/latest/userguide/#activate-script>`_ of your virtual environment
* a `startup file <https://conda.io/docs/user-guide/tasks/manage-environments.html#saving-environment-variables>`_ for your conda environment

In order to enable tab completion in your current shell,
make sure to source the startup file once.

.. note::
This line replaces the ``eval "$(verdi completioncommand)"`` line that was used in ``aiida-core<1.0.0``.
This line replaces the ``eval "$(verdi completioncommand)"`` line that was used in ``aiida-core<1.0.0``. While this continues to work, support for the old line may be dropped in the future.


Adding AiiDA to the PATH
------------------------
Expand Down

0 comments on commit 05fae57

Please sign in to comment.