Skip to content

Commit 818bc5b

Browse files
cdce8pPierre-Sassoulas
authored andcommitted
Fix benchmark test (#4138)
* Don't check directories starting with '.' when using register_plugins * CI - Add benchmark job
1 parent 3cd5fd1 commit 818bc5b

File tree

3 files changed

+59
-1
lines changed

3 files changed

+59
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,55 @@ jobs:
319319
. venv/bin/activate
320320
coveralls --rcfile=${{ env.COVERAGERC_FILE }} --service=github
321321
322+
benchmark-linux:
323+
name: Run benchmark tests Python ${{ matrix.python-version }} (Linux)
324+
runs-on: ubuntu-latest
325+
needs: prepare-tests-linux
326+
strategy:
327+
fail-fast: false
328+
matrix:
329+
python-version: [3.8, 3.9]
330+
steps:
331+
- name: Check out code from GitHub
332+
uses: actions/[email protected]
333+
- name: Set up Python ${{ matrix.python-version }}
334+
id: python
335+
uses: actions/[email protected]
336+
with:
337+
python-version: ${{ matrix.python-version }}
338+
- name: Restore Python virtual environment
339+
id: cache-venv
340+
uses: actions/[email protected]
341+
with:
342+
path: venv
343+
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
344+
needs.prepare-tests-linux.outputs.python-key }}
345+
- name: Fail job if Python cache restore failed
346+
if: steps.cache-venv.outputs.cache-hit != 'true'
347+
run: |
348+
echo "Failed to restore Python venv from cache"
349+
exit 1
350+
- name: Run pytest
351+
run: |
352+
. venv/bin/activate
353+
pip install pygal
354+
pip install -e .
355+
pytest --exitfirst \
356+
--benchmark-only \
357+
--benchmark-autosave \
358+
--benchmark-save-data \
359+
--benchmark-group-by="group"
360+
- name: Create partial artifact name suffix
361+
id: artifact-name-suffix
362+
run: >-
363+
echo "::set-output name=datetime::"$(date "+%Y%m%d_%H%M")
364+
- name: Upload benchmark artifact
365+
uses: actions/[email protected]
366+
with:
367+
name: benchmark-${{ runner.os }}-${{ matrix.python-version }}_${{
368+
steps.artifact-name-suffix.outputs.datetime }}
369+
path: .benchmarks/
370+
322371

323372
pytest-windows:
324373
name: Run tests Python ${{ matrix.python-version }} (Windows)

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ What's New in Pylint 2.7.1?
77

88
* Expose `UnittestLinter` in pylint.testutils
99

10+
* Don't check directories starting with '.' when using register_plugins
11+
12+
Closes #4119
13+
14+
1015
What's New in Pylint 2.7.0?
1116
===========================
1217

pylint/utils/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,11 @@ def register_plugins(linter, directory):
248248
if (
249249
extension in PY_EXTS
250250
and base != "__init__"
251-
or (not extension and os.path.isdir(os.path.join(directory, base)))
251+
or (
252+
not extension
253+
and os.path.isdir(os.path.join(directory, base))
254+
and not filename.startswith(".")
255+
)
252256
):
253257
try:
254258
module = modutils.load_module_from_file(

0 commit comments

Comments
 (0)