diff options
author | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2021-02-23 19:09:24 +0100 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-02-23 19:35:24 +0100 |
commit | 818bc5b2437a5ed6c1db32452386a8d0b820a29b (patch) | |
tree | a6d3765d73d7d893991e863a14ebd48414cd9d1c | |
parent | 3cd5fd1248cc3d48890d8528cf662803fa548dbf (diff) | |
download | pylint-git-818bc5b2437a5ed6c1db32452386a8d0b820a29b.tar.gz |
Fix benchmark test (#4138)
* Don't check directories starting with '.' when using register_plugins
* CI - Add benchmark job
-rw-r--r-- | .github/workflows/ci.yaml | 49 | ||||
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | pylint/utils/utils.py | 6 |
3 files changed, 59 insertions, 1 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4929ce467..d0b13c259 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -319,6 +319,55 @@ jobs: . venv/bin/activate coveralls --rcfile=${{ env.COVERAGERC_FILE }} --service=github + benchmark-linux: + name: Run benchmark tests Python ${{ matrix.python-version }} (Linux) + runs-on: ubuntu-latest + needs: prepare-tests-linux + strategy: + fail-fast: false + matrix: + python-version: [3.8, 3.9] + steps: + - name: Check out code from GitHub + uses: actions/checkout@v2.3.4 + - name: Set up Python ${{ matrix.python-version }} + id: python + uses: actions/setup-python@v2.2.1 + with: + python-version: ${{ matrix.python-version }} + - name: Restore Python virtual environment + id: cache-venv + uses: actions/cache@v2.1.4 + with: + path: venv + key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ + needs.prepare-tests-linux.outputs.python-key }} + - name: Fail job if Python cache restore failed + if: steps.cache-venv.outputs.cache-hit != 'true' + run: | + echo "Failed to restore Python venv from cache" + exit 1 + - name: Run pytest + run: | + . venv/bin/activate + pip install pygal + pip install -e . + pytest --exitfirst \ + --benchmark-only \ + --benchmark-autosave \ + --benchmark-save-data \ + --benchmark-group-by="group" + - name: Create partial artifact name suffix + id: artifact-name-suffix + run: >- + echo "::set-output name=datetime::"$(date "+%Y%m%d_%H%M") + - name: Upload benchmark artifact + uses: actions/upload-artifact@v2.2.2 + with: + name: benchmark-${{ runner.os }}-${{ matrix.python-version }}_${{ + steps.artifact-name-suffix.outputs.datetime }} + path: .benchmarks/ + pytest-windows: name: Run tests Python ${{ matrix.python-version }} (Windows) @@ -7,6 +7,11 @@ What's New in Pylint 2.7.1? * Expose `UnittestLinter` in pylint.testutils +* Don't check directories starting with '.' when using register_plugins + + Closes #4119 + + What's New in Pylint 2.7.0? =========================== diff --git a/pylint/utils/utils.py b/pylint/utils/utils.py index 981bfb91b..35a74bfcd 100644 --- a/pylint/utils/utils.py +++ b/pylint/utils/utils.py @@ -248,7 +248,11 @@ def register_plugins(linter, directory): if ( extension in PY_EXTS and base != "__init__" - or (not extension and os.path.isdir(os.path.join(directory, base))) + or ( + not extension + and os.path.isdir(os.path.join(directory, base)) + and not filename.startswith(".") + ) ): try: module = modutils.load_module_from_file( |