Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention pipx as alternative installer #1520

Merged
merged 1 commit into from Apr 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.grammarly.com/blog/former-vs-latter/

Suggested change
You can use either pip3_ or pipx_ to install it, the former one
You can use either pip3_ or pipx_ to install it, the latter one

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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