Skip to content

Commit

Permalink
Fix benchmark test (#4138)
Browse files Browse the repository at this point in the history
* Don't check directories starting with '.' when using register_plugins

* CI - Add benchmark job
  • Loading branch information
cdce8p authored Feb 23, 2021
1 parent 80da123 commit 646be6d
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ What's New in Pylint 2.8.0?
===========================


* Don't check directories starting with '.' when using register_plugins

Closes #4119


What's New in Pylint 2.7.0?
===========================
Expand Down
6 changes: 5 additions & 1 deletion pylint/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 646be6d

Please sign in to comment.