summaryrefslogtreecommitdiff
path: root/doc/development_guide/contributor_guide/tests/install.rst
blob: c150d0b91b5f23b25f32dd7f50f72aa2042aad47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
.. _contributor_install:

Contributor installation
========================

Basic installation
------------------

Pylint is developed using the git_ distributed version control system.

You can clone Pylint using ::

  git clone https://github.com/PyCQA/pylint

Before you start testing your code, you need to install your source-code package locally.
Suppose you just cloned pylint with the previous ``git clone`` command. To set up your
environment for testing, open a terminal and run::

    cd pylint
    python3 -m venv venv
    source venv/bin/activate
    pip install -r requirements_test_min.txt

This ensures your testing environment is similar to Pylint's testing environment on GitHub.

**Optionally** (Because there's an auto-fix if you open a merge request): We have
pre-commit hooks which should take care of the autoformatting for you before each
commit. To enable it, run ``pre-commit install`` in the ``pylint`` root directory.

Astroid installation
--------------------

If you're testing new changes in astroid you need to also clone astroid_ and install
with an editable installation alongside pylint as follows::

    # Suppose you're in the pylint directory
    git clone https://github.com/PyCQA/astroid.git
    python3 -m pip install -e astroid/

You're now using the local astroid in pylint and can control the version with git for example::

    cd astroid/
    git switch my-astroid-dev-branch

.. _pytest-cov: https://pypi.org/project/pytest-cov/
.. _astroid: https://github.com/pycqa/astroid
.. _git: https://git-scm.com/