Skip to content

Commit

Permalink
Recommend using pipx to install ansible-lint (#1520)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Apr 8, 2021
1 parent 48b8324 commit 1dc3533
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions docs/installing.rst
Expand Up @@ -11,7 +11,7 @@ Installing
Installing on Windows is not supported because we use symlinks inside Python
packages.

While our project does not directly ships a container, the
While our project does not directly ship a container, the
tool is part of the toolset_ container. Please avoid raising any bugs
related to containers and use the discussions_ forum instead.

Expand All @@ -25,32 +25,40 @@ related to containers and use the discussions_ forum instead.

.. note::

The default installation of ansible-lint package no longer installs any
specific version of ansible. You need to either install the desired version
The default installation of the ansible-lint package no longer installs any
specific version of Ansible. You need to either install the desired version
of Ansible yourself or mention one of the helper extras:

* ``core`` - will install latest version of ansible-base 2.10
* ``community`` - will install latest version of ansible 2.10 with community collections
* ``core`` - will install the latest version of ansible-base 2.10
* ``community`` - will install the latest version of ansible 2.10 with community collections

Using Pip
---------
Using pip or pipx
-----------------

You can use either pip3_ or pipx_ to install it, the former one
automatically isolates the linter from your current python environment.
That approach may avoid having to deal with particularities of installing
python packages, like creating a virtual environment, activating it, installing
using ``--user`` or fixing potential conflicts if not using virtualenvs.

.. code-block:: bash
# Assuming you already installed ansible and you also want the optional
# Assuming you already installed Ansible and you also want the optional
# yamllint support:
pip install "ansible-lint[yamllint]"
pip3 install "ansible-lint[yamllint]"
# If you want to install and use latest ansible (w/o community collections)
pip install "ansible-lint[core,yamllint]"
# If you want to install and use the latest Ansible (w/o community collections)
pip3 install "ansible-lint[core,yamllint]"
# If you want to install and use latest ansible with community collections
pip install "ansible-lint[community,yamllint]"
# If you want to install and use the latest Ansible with community collections
pip3 install "ansible-lint[community,yamllint]"
# If you want to install an older version of Ansible 2.9
pip install ansible-lint "ansible>=2.9,<2.10"
pip3 install ansible-lint "ansible>=2.9,<2.10"
.. _installing_from_source:
.. _pip3: https://pypi.org/project/pip/
.. _pipx: https://pipxproject.github.io/pipx/

From Source
-----------
Expand All @@ -60,6 +68,6 @@ From Source

.. code-block:: bash
pip install git+https://github.com/ansible-community/ansible-lint.git
pip3 install git+https://github.com/ansible-community/ansible-lint.git
.. _PyPA User Guide: https://packaging.python.org/tutorials/installing-packages/#ensure-pip-setuptools-and-wheel-are-up-to-date

0 comments on commit 1dc3533

Please sign in to comment.