[Notes] [Git][BuildStream/buildstream][master] 8 commits: setup.cfg: Specify the pycodestyle configurations separately from pytest configuration



Title: GitLab

Tristan Van Berkom pushed to branch master at BuildStream / buildstream

Commits:

8 changed files:

Changes:

  • .gitlab-ci.yml
    ... ... @@ -151,6 +151,18 @@ tests-fedora-missing-deps:
    151 151
     
    
    152 152
         - ${TEST_COMMAND}
    
    153 153
     
    
    154
    +# Lint separately from testing
    
    155
    +lint:
    
    156
    +  stage: test
    
    157
    +
    
    158
    +  before_script:
    
    159
    +  # Diagnostics
    
    160
    +  - python3 --version
    
    161
    +
    
    162
    +  script:
    
    163
    +  - tox -e lint
    
    164
    +  except:
    
    165
    +  - schedules
    
    154 166
     
    
    155 167
     # Automatically build documentation for every commit, we want to know
    
    156 168
     # if building documentation fails even if we're not deploying it.
    

  • CONTRIBUTING.rst
    ... ... @@ -1498,6 +1498,18 @@ option when running tox::
    1498 1498
     
    
    1499 1499
       tox -e py37
    
    1500 1500
     
    
    1501
    +Linting is performed separately from testing. In order to run the linting step which
    
    1502
    +consists of running the ``pycodestyle`` and ``pylint`` tools, run the following::
    
    1503
    +
    
    1504
    +  tox -e lint
    
    1505
    +
    
    1506
    +.. tip::
    
    1507
    +
    
    1508
    +   The project specific pylint and pycodestyle configurations are stored in the
    
    1509
    +   toplevel buildstream directory in the ``.pylintrc`` file and ``setup.cfg`` files
    
    1510
    +   respectively. These configurations can be interesting to use with IDEs and
    
    1511
    +   other developer tooling.
    
    1512
    +
    
    1501 1513
     The output of all failing tests will always be printed in the summary, but
    
    1502 1514
     if you want to observe the stdout and stderr generated by a passing test,
    
    1503 1515
     you can pass the ``-s`` option to pytest as such::
    
    ... ... @@ -1532,15 +1544,6 @@ output. To run them, you can use::
    1532 1544
     
    
    1533 1545
       tox -- --integration
    
    1534 1546
     
    
    1535
    -By default, buildstream also runs pylint on all files. Should you want
    
    1536
    -to run just pylint (these checks are a lot faster), you can do so
    
    1537
    -with::
    
    1538
    -
    
    1539
    -  tox -- -m pylint
    
    1540
    -
    
    1541
    -Alternatively, any IDE plugin that uses pytest should automatically
    
    1542
    -detect the ``.pylintrc`` in the project's root directory.
    
    1543
    -
    
    1544 1547
     In case BuildStream's dependencies were updated since you last ran the
    
    1545 1548
     tests, you might see some errors like
    
    1546 1549
     ``pytest: error: unrecognized arguments: --codestyle``. If this happens, you
    

  • setup.cfg
    ... ... @@ -11,11 +11,13 @@ parentdir_prefix = BuildStream-
    11 11
     test=pytest
    
    12 12
     
    
    13 13
     [tool:pytest]
    
    14
    -addopts = --verbose --basetemp ./tmp --codestyle --pylint --pylint-rcfile=.pylintrc --cov=buildstream --cov-config .coveragerc --durations=20
    
    14
    +addopts = --verbose --basetemp ./tmp --cov=buildstream --cov-config .coveragerc --durations=20
    
    15 15
     norecursedirs = tests/integration/project integration-cache tmp __pycache__ .eggs
    
    16 16
     python_files = tests/*/*.py
    
    17
    -codestyle_max_line_length = 119
    
    18
    -codestyle_ignore = E129 E125 W504 W605
    
    19
    -codestyle_exclude = doc/source/conf.py buildstream/_fuse/fuse.py buildstream/_protos/**/*py
    
    20 17
     env =
    
    21 18
         D:BST_TEST_SUITE=True
    
    19
    +
    
    20
    +[pycodestyle]
    
    21
    +max-line-length = 119
    
    22
    +ignore = E129,E125,W504,W605
    
    23
    +exclude = .git/**,.tox/**,doc/source/conf.py,buildstream/_fuse/fuse.py,buildstream/_protos/**/*py

  • tools/dev-requirements.in
    1 1
     coverage == 4.4.0
    
    2 2
     pylint
    
    3
    +pycodestyle
    
    3 4
     pytest >= 3.9
    
    4
    -pytest-codestyle >= 1.4.0
    
    5 5
     pytest-cov >= 2.5.0
    
    6 6
     pytest-datafiles >= 2.0
    
    7 7
     pytest-env
    
    8
    -pytest-pylint
    
    9 8
     pytest-xdist
    
    10 9
     pytest-timeout
    
    11 10
     pyftpdlib

  • tools/dev-requirements.txt
    1 1
     coverage==4.4
    
    2 2
     pylint==2.2.2
    
    3
    +pycodestyle==2.4.0
    
    3 4
     pytest==4.0.2
    
    4
    -pytest-codestyle==1.4.0
    
    5 5
     pytest-cov==2.6.0
    
    6 6
     pytest-datafiles==2.0
    
    7 7
     pytest-env==0.6.2
    
    8
    -pytest-pylint==0.13.0
    
    9 8
     pytest-xdist==1.25.0
    
    10 9
     pytest-timeout==1.3.3
    
    11 10
     pyftpdlib==1.5.4
    
    ... ... @@ -21,8 +20,6 @@ mccabe==0.6.1
    21 20
     more-itertools==5.0.0
    
    22 21
     pluggy==0.8.0
    
    23 22
     py==1.7.0
    
    24
    -pycodestyle==2.4.0
    
    25 23
     pytest-forked==0.2
    
    26 24
     six==1.12.0
    
    27
    -typed-ast==1.1.1
    
    28 25
     wrapt==1.10.11

  • tools/requirements.in
    1 1
     Click
    
    2 2
     grpcio >= 1.10
    
    3
    -jinja2 >= 2.10
    
    3
    +Jinja2 >= 2.10
    
    4 4
     pluginbase
    
    5 5
     protobuf >= 3.5
    
    6 6
     psutil
    

  • tools/requirements.txt
    1 1
     Click==7.0
    
    2 2
     grpcio==1.17.1
    
    3
    +Jinja2==2.10
    
    3 4
     pluginbase==0.7
    
    4 5
     protobuf==3.6.1
    
    5 6
     psutil==5.4.8
    
    ... ... @@ -13,6 +14,5 @@ psutil==5.4.8
    13 14
     ruamel.yaml==0.15.51
    
    14 15
     setuptools==39.0.1
    
    15 16
     ## The following requirements were added by pip freeze:
    
    16
    -Jinja2==2.10
    
    17 17
     MarkupSafe==1.1.0
    
    18 18
     six==1.12.0

  • tox.ini
    ... ... @@ -13,6 +13,15 @@ passenv =
    13 13
         GI_TYPELIB_PATH
    
    14 14
         INTEGRATION_CACHE
    
    15 15
     
    
    16
    +[testenv:lint]
    
    17
    +commands =
    
    18
    +    pycodestyle
    
    19
    +    pylint buildstream
    
    20
    +deps =
    
    21
    +    -rtools/requirements.txt
    
    22
    +    -rtools/dev-requirements.txt
    
    23
    +    -rtools/plugin-requirements.txt
    
    24
    +
    
    16 25
     [testenv:docs]
    
    17 26
     commands =
    
    18 27
         make -C doc
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]