From fb5419ad5bc6125cd4b31f1f42390597f5afcb15 Mon Sep 17 00:00:00 2001 From: Adrien Cacciaguerra Date: Wed, 17 Apr 2024 14:43:35 -0400 Subject: [PATCH] feat: add CodSpeed to the project --- .github/workflows/backport.yml | 29 -- .github/workflows/benchmark.yml | 30 ++ .github/workflows/changelog.yml | 66 ----- .github/workflows/checks.yaml | 191 ------------ .github/workflows/codeql-analysis.yml | 80 ----- .github/workflows/primer-test.yaml | 98 ------- .github/workflows/primer_comment.yaml | 123 -------- .github/workflows/primer_run_main.yaml | 113 ------- .github/workflows/primer_run_pr.yaml | 205 ------------- .github/workflows/release.yml | 45 --- .github/workflows/stale.yml | 41 --- .github/workflows/tests.yaml | 307 -------------------- .gitignore | 1 + requirements_test_min.txt | 3 +- tests/benchmark/test_baseline_benchmarks.py | 21 -- 15 files changed, 32 insertions(+), 1321 deletions(-) delete mode 100644 .github/workflows/backport.yml create mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/changelog.yml delete mode 100644 .github/workflows/checks.yaml delete mode 100644 .github/workflows/codeql-analysis.yml delete mode 100644 .github/workflows/primer-test.yaml delete mode 100644 .github/workflows/primer_comment.yaml delete mode 100644 .github/workflows/primer_run_main.yaml delete mode 100644 .github/workflows/primer_run_pr.yaml delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/stale.yml delete mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml deleted file mode 100644 index 9420b7594d7..00000000000 --- a/.github/workflows/backport.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Backport -on: - pull_request_target: - types: - - closed - - labeled - -permissions: - pull-requests: write - contents: write - -jobs: - backport: - name: Backport - runs-on: ubuntu-latest - # Only react to merged PRs for security reasons. - # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target. - if: > - github.event.pull_request.merged && ( - github.event.action == 'closed' - || ( - github.event.action == 'labeled' - && contains(github.event.label.name, 'backport') - ) - ) - steps: - - uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e # v2.0.4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 00000000000..101c74cab91 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,30 @@ +name: codspeed-benchmarks + +on: + push: + branches: + - "main" # or "master" + pull_request: + # `workflow_dispatch` allows CodSpeed to trigger backtest + # performance analysis in order to generate initial data. + workflow_dispatch: + +jobs: + benchmarks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + with: + python-version: "3.12" + + - name: Install dependencies + run: | + python -m pip install -U pip setuptools wheel + pip install -U -r requirements_test_min.txt + + - name: Run benchmarks + uses: CodSpeedHQ/action@v2 + with: + token: ${{ secrets.CODSPEED_TOKEN }} + run: pytest tests/ --codspeed diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml deleted file mode 100644 index 6d7928994b1..00000000000 --- a/.github/workflows/changelog.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: changelog - -on: - pull_request: - types: [opened, synchronize, labeled, unlabeled, reopened] - branches-ignore: - - "maintenance/**" -env: - CACHE_VERSION: 1 - KEY_PREFIX: base-venv - DEFAULT_PYTHON: "3.12" - -permissions: - contents: read - -jobs: - check-changelog: - if: contains(github.event.pull_request.labels.*.name, 'skip news :mute:') != true - name: Changelog Entry Check - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.1.7 - with: - # `towncrier check` runs `git diff --name-only origin/main...`, which - # needs a non-shallow clone. - fetch-depth: 0 - - name: Set up Python ${{ env.DEFAULT_PYTHON }} - id: python - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ env.DEFAULT_PYTHON }} - check-latest: true - - name: Generate partial Python venv restore key - id: generate-python-key - run: >- - echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{ - hashFiles('pyproject.toml', 'requirements_test.txt', - 'requirements_test_min.txt', 'requirements_test_pre_commit.txt') }}" >> - $GITHUB_OUTPUT - - name: Restore Python virtual environment - id: cache-venv - uses: actions/cache@v4.0.2 - with: - path: venv - key: >- - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ - steps.generate-python-key.outputs.key }} - - name: Create Python virtual environment - if: steps.cache-venv.outputs.cache-hit != 'true' - run: | - python -m venv venv - . venv/bin/activate - python -m pip install -U pip setuptools wheel - pip install -U -r requirements_test.txt - pip install -U -r doc/requirements.txt - - name: Emit warning if news fragment is missing - env: - BASE_BRANCH: ${{ github.base_ref }} - run: | - # Fetch the pull request' base branch so towncrier will be able to - # compare the current branch with the base branch. - git fetch --no-tags origin +refs/heads/${BASE_BRANCH}:refs/remotes/origin/${BASE_BRANCH} - . venv/bin/activate - towncrier check --compare-with origin/${{ github.base_ref }} diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml deleted file mode 100644 index d3c9e01bbb2..00000000000 --- a/.github/workflows/checks.yaml +++ /dev/null @@ -1,191 +0,0 @@ -name: Checks - -on: - push: - branches: - - main - - "maintenance/**" - pull_request: - branches: - - main - - "maintenance/**" - -env: - CACHE_VERSION: 1 - KEY_PREFIX: base-venv - DEFAULT_PYTHON: "3.11" - PRE_COMMIT_CACHE: ~/.cache/pre-commit - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -permissions: - contents: read - -jobs: - prepare-base: - name: Prepare base dependencies - runs-on: ubuntu-latest - timeout-minutes: 10 - outputs: - python-key: ${{ steps.generate-python-key.outputs.key }} - pre-commit-key: ${{ steps.generate-pre-commit-key.outputs.key }} - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.1.7 - - name: Set up Python ${{ env.DEFAULT_PYTHON }} - id: python - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ env.DEFAULT_PYTHON }} - check-latest: true - - name: Generate partial Python venv restore key - id: generate-python-key - run: >- - echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{ - hashFiles('pyproject.toml', 'requirements_test.txt', - 'requirements_test_min.txt', 'requirements_test_pre_commit.txt') }}" >> - $GITHUB_OUTPUT - - name: Restore Python virtual environment - id: cache-venv - uses: actions/cache@v4.0.2 - with: - path: venv - key: >- - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ - steps.generate-python-key.outputs.key }} - - name: Create Python virtual environment - if: steps.cache-venv.outputs.cache-hit != 'true' - run: | - python -m venv venv - . venv/bin/activate - python -m pip install -U pip setuptools wheel - pip install -U -r requirements_test.txt - pip install -U -r doc/requirements.txt - pip install pre-commit - - name: Generate pre-commit restore key - id: generate-pre-commit-key - run: >- - echo "key=pre-commit-${{ env.CACHE_VERSION }}-${{ - hashFiles('.pre-commit-config.yaml') }}" >> $GITHUB_OUTPUT - - name: Restore pre-commit environment - id: cache-precommit - uses: actions/cache@v4.0.2 - with: - path: ${{ env.PRE_COMMIT_CACHE }} - key: >- - ${{ runner.os }}-${{ steps.generate-pre-commit-key.outputs.key }} - - name: Install pre-commit dependencies - if: steps.cache-precommit.outputs.cache-hit != 'true' - run: | - . venv/bin/activate - pre-commit install --install-hooks - - pylint: - name: pylint - runs-on: ubuntu-latest - timeout-minutes: 10 - needs: prepare-base - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.1.7 - - name: Set up Python ${{ env.DEFAULT_PYTHON }} - id: python - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ env.DEFAULT_PYTHON }} - check-latest: true - - name: Restore Python virtual environment - id: cache-venv - uses: actions/cache@v4.0.2 - with: - path: venv - fail-on-cache-miss: true - key: - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ - needs.prepare-base.outputs.python-key }} - - name: Restore pre-commit environment - id: cache-precommit - uses: actions/cache@v4.0.2 - with: - path: ${{ env.PRE_COMMIT_CACHE }} - fail-on-cache-miss: true - key: ${{ runner.os }}-${{ needs.prepare-base.outputs.pre-commit-key }} - - name: Install enchant and aspell - run: | - sudo apt-get update - sudo apt-get install enchant-2 aspell-en - - name: Run pylint checks - run: | - . venv/bin/activate - pip install . - pip list | grep 'astroid\|pylint' - pre-commit run --hook-stage manual pylint-with-spelling --all-files - - spelling: - name: spelling tests - runs-on: ubuntu-latest - timeout-minutes: 5 - needs: prepare-base - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.1.7 - - name: Set up Python ${{ env.DEFAULT_PYTHON }} - id: python - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ env.DEFAULT_PYTHON }} - check-latest: true - - name: Restore Python virtual environment - id: cache-venv - uses: actions/cache@v4.0.2 - with: - path: venv - fail-on-cache-miss: true - key: - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ - needs.prepare-base.outputs.python-key }} - - name: Run spelling checks - run: | - . venv/bin/activate - pytest tests/ -k unittest_spelling - - documentation: - name: documentation - runs-on: ubuntu-latest - timeout-minutes: 20 - needs: prepare-base - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.1.7 - - name: Set up Python ${{ env.DEFAULT_PYTHON }} - id: python - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ env.DEFAULT_PYTHON }} - check-latest: true - - name: Restore Python virtual environment - id: cache-venv - uses: actions/cache@v4.0.2 - with: - path: venv - fail-on-cache-miss: true - key: - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ - needs.prepare-base.outputs.python-key }} - - name: Run checks on documentation code examples - run: | - . venv/bin/activate - tox -e test_doc - - name: Check documentation build and links - run: | - . venv/bin/activate - cd doc - pre-commit run --hook-stage push sphinx-generated-doc --all-files || { - echo "git diff:" ; \ - git diff ; \ - echo "End of 'git diff'" ; \ - echo "Make sure that 'make html' succeed without any modifications locally." ; \ - exit 1; \ - } diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 61bfd28de80..00000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,80 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [main] - pull_request: - # The branches below must be a subset of the branches above - branches: [main] - schedule: - - cron: "44 16 * * 4" - -permissions: - contents: read - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - analyze: - if: - ${{ github.repository_owner == 'pylint-dev' || github.event_name != 'schedule' }} - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: ["python"] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v4.1.7 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v3 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/primer-test.yaml b/.github/workflows/primer-test.yaml deleted file mode 100644 index ed235fd9232..00000000000 --- a/.github/workflows/primer-test.yaml +++ /dev/null @@ -1,98 +0,0 @@ -name: Primer - -on: - push: - branches: - - main - pull_request: - paths: - - "pylint/**" - - "tests/primer/**" - - "requirements*" - - ".github/workflows/primer-test.yaml" - branches: - - main -env: - CACHE_VERSION: 4 - KEY_PREFIX: venv - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -permissions: - contents: read - -jobs: - prepare-tests-linux: - name: prepare / ${{ matrix.python-version }} / Linux - runs-on: ubuntu-latest - timeout-minutes: 5 - strategy: - matrix: - python-version: [3.9, "3.10", "3.11", "3.12"] - outputs: - python-key: ${{ steps.generate-python-key.outputs.key }} - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.1.7 - - name: Set up Python ${{ matrix.python-version }} - id: python - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ matrix.python-version }} - check-latest: true - - name: Generate partial Python venv restore key - id: generate-python-key - run: >- - echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{ - hashFiles('pyproject.toml', 'requirements_test.txt', - 'requirements_test_min.txt', 'requirements_test_pre_commit.txt') }}" >> - $GITHUB_OUTPUT - - name: Restore Python virtual environment - id: cache-venv - uses: actions/cache@v4.0.2 - with: - path: venv - key: >- - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ - steps.generate-python-key.outputs.key }} - - name: Create Python virtual environment - if: steps.cache-venv.outputs.cache-hit != 'true' - run: | - python -m venv venv - . venv/bin/activate - python -m pip install -U pip setuptools wheel - pip install -U -r requirements_test.txt - - pytest-primer-stdlib: - name: run on stdlib / ${{ matrix.python-version }} / Linux - runs-on: ubuntu-latest - timeout-minutes: 10 - needs: prepare-tests-linux - strategy: - matrix: - python-version: [3.9, "3.10", "3.11", "3.12"] - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.1.7 - - name: Set up Python ${{ matrix.python-version }} - id: python - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ matrix.python-version }} - check-latest: true - - name: Restore Python virtual environment - id: cache-venv - uses: actions/cache@v4.0.2 - with: - path: venv - fail-on-cache-miss: true - key: - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ - needs.prepare-tests-linux.outputs.python-key }} - - name: Run pytest - run: | - . venv/bin/activate - pip install . - pytest -m primer_stdlib --primer-stdlib -n auto -vv diff --git a/.github/workflows/primer_comment.yaml b/.github/workflows/primer_comment.yaml deleted file mode 100644 index 3bae09da111..00000000000 --- a/.github/workflows/primer_comment.yaml +++ /dev/null @@ -1,123 +0,0 @@ -# Most of this is inspired by the mypy primer -# See: https://github.com/hauntsaninja/mypy_primer -# This is the primer job that creates the comment on the PR -# It needs to trigger on workflow_run instead of pull_request -# as we need repository wide access to create a comment - -name: Primer / Comment - -on: - workflow_run: - workflows: [Primer / Run] - types: - - completed - -env: - # This needs to be the SAME as in the Main and PR job - CACHE_VERSION: 4 - KEY_PREFIX: venv-primer - DEFAULT_PYTHON: "3.12" - -permissions: - contents: read - pull-requests: write - -jobs: - primer-comment: - # Skip job if the workflow failed - if: ${{ github.event.workflow_run.conclusion == 'success' }} - name: Run - runs-on: ubuntu-latest - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.1.7 - - name: Set up Python ${{ env.DEFAULT_PYTHON }} - id: python - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ env.DEFAULT_PYTHON }} - check-latest: true - - # Restore cached Python environment - - name: Restore Python virtual environment - id: cache-venv - uses: actions/cache@v4.0.2 - with: - path: venv - key: - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ - env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{ hashFiles('pyproject.toml', - 'requirements_test.txt', 'requirements_test_min.txt', - 'requirements_test_pre_commit.txt') }} - - - name: Download outputs - uses: actions/github-script@v7.0.1 - with: - script: | - // Download workflow pylint output - const fs = require('fs'); - const artifacts_workflow = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{ github.event.workflow_run.id }}, - }); - - // Get 'main' and 'PR' outputs and PR number - const artifacts = artifacts_workflow.data.artifacts.filter((artifact) => - artifact.name.startsWith(`primer_output_main_${process.env.DEFAULT_PYTHON}`) - || artifact.name.startsWith(`primer_output_pr_${process.env.DEFAULT_PYTHON}`) - || artifact.name === 'pr_number' - ); - for (const artifact of artifacts) { - const downloaded = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: artifact.id, - archive_format: "zip", - }); - fs.writeFileSync(`${artifact.name}.zip`, Buffer.from(downloaded.data)); - } - - - name: Unzip outputs - run: | - unzip primer_output_main_${{ env.DEFAULT_PYTHON }}_batch0.zip - unzip primer_output_main_${{ env.DEFAULT_PYTHON }}_batch1.zip - unzip primer_output_main_${{ env.DEFAULT_PYTHON }}_batch2.zip - unzip primer_output_main_${{ env.DEFAULT_PYTHON }}_batch3.zip - unzip primer_output_pr_${{ env.DEFAULT_PYTHON }}_batch0.zip - unzip primer_output_pr_${{ env.DEFAULT_PYTHON }}_batch1.zip - unzip primer_output_pr_${{ env.DEFAULT_PYTHON }}_batch2.zip - unzip primer_output_pr_${{ env.DEFAULT_PYTHON }}_batch3.zip - unzip pr_number.zip - - name: Compare outputs - run: | - . venv/bin/activate - python tests/primer/__main__.py compare \ - --commit=${{ github.event.workflow_run.head_sha }} \ - --base-file=output_${{ env.DEFAULT_PYTHON }}_main_BATCHIDX.txt \ - --new-file=output_${{ env.DEFAULT_PYTHON }}_pr_BATCHIDX.txt \ - --batches=4 - - name: Post comment - id: post-comment - uses: actions/github-script@v7.0.1 - with: - script: | - const fs = require('fs') - const comment = fs.readFileSync('tests/.pylint_primer_tests/comment.txt', { encoding: 'utf8' }) - console.log("Comment to post:") - console.log(comment) - const prNumber = parseInt(fs.readFileSync("pr_number.txt", { encoding: "utf8" })) - await github.rest.issues.createComment({ - issue_number: prNumber, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment - }) - return prNumber - - name: Hide old comments - # Taken from mypy primer - uses: kanga333/comment-hider@c12bb20b48aeb8fc098e35967de8d4f8018fffdf # v0.4.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - leave_visible: 1 - issue_number: ${{ steps.post-comment.outputs.result }} diff --git a/.github/workflows/primer_run_main.yaml b/.github/workflows/primer_run_main.yaml deleted file mode 100644 index abb8c70e82b..00000000000 --- a/.github/workflows/primer_run_main.yaml +++ /dev/null @@ -1,113 +0,0 @@ -# Most of this is inspired by the mypy primer -# See: https://github.com/hauntsaninja/mypy_primer -# This is the primer job that runs on the default 'main' branch -# It is also responsible for caching the packages to prime on - -name: Primer / Main - -on: - push: - branches: - - main - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - # This needs to be the SAME as in the PR and comment job - CACHE_VERSION: 4 - KEY_PREFIX: venv-primer - -permissions: - contents: read - -jobs: - run-primer: - name: Run / ${{ matrix.python-version }} / batch index ${{ matrix.batchIdx }} - runs-on: ubuntu-latest - timeout-minutes: 45 - strategy: - matrix: - python-version: ["3.9", "3.12"] - batches: [4] - batchIdx: [0, 1, 2, 3] - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.1.7 - - name: Set up Python ${{ matrix.python-version }} - id: python - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ matrix.python-version }} - check-latest: true - - # Create a re-usable virtual environment - - name: Create Python virtual environment cache - id: cache-venv - uses: actions/cache@v4.0.2 - with: - path: venv - key: - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ - env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{ hashFiles('pyproject.toml', - 'requirements_test.txt', 'requirements_test_min.txt', - 'requirements_test_pre_commit.txt') }} - - name: Create Python virtual environment - if: steps.cache-venv.outputs.cache-hit != 'true' - run: | - python -m venv venv - . venv/bin/activate - python -m pip install -U pip setuptools wheel - pip install -U -r requirements_test.txt - - # Cache primer packages - - name: Get commit string - id: commitstring - run: | - . venv/bin/activate - python tests/primer/__main__.py prepare --make-commit-string - output=$(python tests/primer/__main__.py prepare --read-commit-string) - echo "commitstring=$output" >> $GITHUB_OUTPUT - - name: Restore projects cache - id: cache-projects - uses: actions/cache@v4.0.2 - with: - path: tests/.pylint_primer_tests/ - key: >- - ${{ runner.os }}-${{ matrix.python-version }}-${{ - steps.commitstring.outputs.commitstring }}-primer - - name: Regenerate cache - if: steps.cache-projects.outputs.cache-hit != 'true' - run: | - . venv/bin/activate - python tests/primer/__main__.py prepare --clone - - name: Upload commit string - uses: actions/upload-artifact@v4.3.4 - if: matrix.batchIdx == 0 - with: - name: primer_commitstring_${{ matrix.python-version }} - path: - tests/.pylint_primer_tests/commit_string_${{ matrix.python-version }}.txt - - # Run primer - - name: Run pylint primer - run: | - . venv/bin/activate - pip install . - python tests/primer/__main__.py run --type=main --batches=${{ matrix.batches }} --batchIdx=${{ matrix.batchIdx }} 2>warnings.txt - - name: Echo warnings - if: success() || failure() - run: | - WARNINGS=$(head -c 65000 < warnings.txt) - if [[ $WARNINGS ]] - then echo "::warning ::$WARNINGS" - fi - - name: Upload output - uses: actions/upload-artifact@v4.3.4 - with: - name: - primer_output_main_${{ matrix.python-version }}_batch${{ matrix.batchIdx }} - path: >- - tests/.pylint_primer_tests/output_${{ matrix.python-version }}_main_batch${{ - matrix.batchIdx }}.txt diff --git a/.github/workflows/primer_run_pr.yaml b/.github/workflows/primer_run_pr.yaml deleted file mode 100644 index 514e0f525ab..00000000000 --- a/.github/workflows/primer_run_pr.yaml +++ /dev/null @@ -1,205 +0,0 @@ -# Most of this is inspired by the mypy primer -# See: https://github.com/hauntsaninja/mypy_primer -# This is the primer job that runs on every PR - -name: Primer / Run - -on: - pull_request: - paths: - - "pylint/**" - - "tests/primer/**" - - "requirements*" - - ".github/workflows/**" - # We ignore these specific files because they need to be changed - # on 'main' and will always fail the PR run. - - "!.github/workflows/primer_run_main.yaml" - - "!.github/workflows/primer_comment.yaml" - - "!tests/primer/packages_to_prime.json" - branches: - - main - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - # This needs to be the SAME as in the Main and comment job - CACHE_VERSION: 4 - KEY_PREFIX: venv-primer - -permissions: - contents: read - -jobs: - run-primer: - name: Run / ${{ matrix.python-version }} / batch index ${{ matrix.batchIdx }} - runs-on: ubuntu-latest - timeout-minutes: 45 - strategy: - matrix: - python-version: ["3.9", "3.12"] - batches: [4] - batchIdx: [0, 1, 2, 3] - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.1.7 - with: - fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - id: python - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ matrix.python-version }} - check-latest: true - - # Restore cached Python environment - - name: Restore Python virtual environment - id: cache-venv - uses: actions/cache@v4.0.2 - with: - path: venv - key: - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ - env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{ hashFiles('pyproject.toml', - 'requirements_test.txt', 'requirements_test_min.txt', - 'requirements_test_pre_commit.txt') }} - # Create environment must match step in 'Primer / Main' - - name: Create Python virtual environment - if: steps.cache-venv.outputs.cache-hit != 'true' - run: | - python -m venv venv - . venv/bin/activate - python -m pip install -U pip setuptools wheel - pip install -U -r requirements_test.txt - - # Cache primer packages - - name: Download last 'main' run info - id: download-main-run - uses: actions/github-script@v7.0.1 - env: - COMMIT_STRING_ARTIFACT: primer_commitstring_${{ matrix.python-version }} - OUTPUT_ARTIFACT: - primer_output_main_${{ matrix.python-version }}_batch${{ matrix.batchIdx }} - with: - script: | - const { COMMIT_STRING_ARTIFACT, OUTPUT_ARTIFACT } = process.env - // Download 'main' pylint output - const fs = require('fs'); - const runs = await github.rest.actions.listWorkflowRuns({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: ".github/workflows/primer_run_main.yaml", - status: "success" - }); - const lastRunMain = runs.data.workflow_runs.reduce(function(prev, current) { - return (prev.run_number > current.run_number) ? prev : current - }) - console.log("Last run on main:") - console.log(lastRunMain.html_url) - const artifacts_main = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: lastRunMain.id, - }); - - // Get commitstring - const [matchArtifactMain] = artifacts_main.data.artifacts.filter((artifact) => - artifact.name === COMMIT_STRING_ARTIFACT); - const downloadWorkflow = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifactMain.id, - archive_format: "zip", - }); - fs.writeFileSync(`${COMMIT_STRING_ARTIFACT}.zip`, Buffer.from(downloadWorkflow.data)); - - // Get output - const [matchArtifactMainOutput] = artifacts_main.data.artifacts.filter((artifact) => - artifact.name === OUTPUT_ARTIFACT); - const downloadWorkflowTwo = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifactMainOutput.id, - archive_format: "zip", - }); - fs.writeFileSync(`${OUTPUT_ARTIFACT}.zip`, Buffer.from(downloadWorkflowTwo.data)); - return lastRunMain.head_sha; - - name: Copy and unzip the commit string - run: | - unzip primer_commitstring_${{ matrix.python-version }}.zip - cp commit_string_${{ matrix.python-version }}.txt tests/.pylint_primer_tests/commit_string_${{ matrix.python-version }}.txt - - name: Unzip the output of 'main' - run: | - unzip primer_output_main_${{ matrix.python-version }}_batch${{ matrix.batchIdx }}.zip - - name: Get commit string - id: commitstring - run: | - . venv/bin/activate - output=$(python tests/primer/__main__.py prepare --read-commit-string) - echo "commitstring=$output" >> $GITHUB_OUTPUT - - name: Restore projects cache - id: cache-projects - uses: actions/cache@v4.0.2 - with: - path: tests/.pylint_primer_tests/ - key: >- - ${{ runner.os }}-${{ matrix.python-version }}-${{ - steps.commitstring.outputs.commitstring }}-primer - - name: Regenerate cache - if: steps.cache-projects.outputs.cache-hit != 'true' - run: | - . venv/bin/activate - python tests/primer/__main__.py prepare --clone - - name: Check cache - run: | - . venv/bin/activate - python tests/primer/__main__.py prepare --check - - # Merge the 'main' commit of last successful run - - name: Pull 'main' - shell: bash - run: | - git config --global user.email "primer@example.com" - git config --global user.name "Pylint Primer" - git pull origin ${{ steps.download-main-run.outputs.result }} --no-edit --no-commit --no-rebase - - # Run primer - - name: Run pylint primer - run: | - . venv/bin/activate - pip install . - python tests/primer/__main__.py run --type=pr --batches=${{ matrix.batches }} --batchIdx=${{ matrix.batchIdx }} 2>warnings.txt - - name: Echo warnings - if: success() || failure() - run: | - WARNINGS=$(head -c 65000 < warnings.txt) - if [[ $WARNINGS ]] - then echo "::warning ::$WARNINGS" - fi - - name: Upload output of PR - uses: actions/upload-artifact@v4.3.4 - with: - name: - primer_output_pr_${{ matrix.python-version }}_batch${{ matrix.batchIdx }} - path: - tests/.pylint_primer_tests/output_${{ matrix.python-version }}_pr_batch${{ - matrix.batchIdx }}.txt - - name: Upload output of 'main' - uses: actions/upload-artifact@v4.3.4 - with: - name: - primer_output_main_${{ matrix.python-version }}_batch${{ matrix.batchIdx }} - path: output_${{ matrix.python-version }}_main_batch${{ matrix.batchIdx }}.txt - - # Save PR number so we know which PR to comment on - - name: Save PR number - run: | - echo ${{ github.event.pull_request.number }} | tee pr_number.txt - - name: Upload PR number - if: - startsWith(steps.python.outputs.python-version, '3.9') && matrix.batchIdx == 0 - uses: actions/upload-artifact@v4.3.4 - with: - name: pr_number - path: pr_number.txt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index b6237aac799..00000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Release - -on: - release: - types: - - published - -env: - DEFAULT_PYTHON: "3.12" - -permissions: - contents: read - -jobs: - release-pypi: - name: Upload release to PyPI - runs-on: ubuntu-latest - environment: - name: PyPI - url: https://pypi.org/project/pylint/ - steps: - - name: Check out code from Github - uses: actions/checkout@v4.1.7 - - name: Set up Python ${{ env.DEFAULT_PYTHON }} - id: python - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ env.DEFAULT_PYTHON }} - check-latest: true - - name: Install requirements - run: | - # Remove dist, build, and pylint.egg-info - # when building locally for testing! - python -m pip install twine build - - name: Build distributions - run: | - python -m build - - name: Upload to PyPI - if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags') - env: - TWINE_REPOSITORY: pypi - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - run: | - twine upload --verbose dist/* diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index e7a2b172d92..00000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: close stale issues and pr -on: - schedule: - - cron: "30 1 * * *" - workflow_dispatch: - -jobs: - close-issues: - if: github.repository_owner == 'pylint-dev' - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - steps: - - uses: actions/stale@v9 - with: - days-before-issue-stale: 28 - days-before-issue-close: 7 - any-of-issue-labels: - "Waiting on author,Cannot reproduce 🤷,python past end of life,Won't fix/not - planned" - exempt-issue-labels: "High priority,Blocked 🚧,Needs decision 🔒" - stale-issue-message: - "This issue is stale because it has been open 4 weeks with no activity. - Remove 'Stale' label or comment or this will be closed in a week." - close-issue-message: - "This issue was closed because it has been stalled for five weeks with no - activity." - - any-of-pr-labels: - "Waiting on author,python past end of life,Won't fix/not planned" - exempt-pr-labels: "High priority,Blocked 🚧,Needs review 🔍" - days-before-pr-stale: 56 - days-before-pr-close: -1 - stale-pr-label: "Needs take over 🛎ī¸" - close-pr-message: - "This PR was closed because it needed to be taken over for 16 weeks with no - one stepping up." - stale-pr-message: - "This PR needs take over because because it has been open 8 weeks with no - activity." diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml deleted file mode 100644 index ad6731eb5f5..00000000000 --- a/.github/workflows/tests.yaml +++ /dev/null @@ -1,307 +0,0 @@ -name: Tests - -on: - push: - branches: - - main - - "maintenance/**" - paths-ignore: - - doc/data/messages/** - pull_request: - branches: - - main - - "maintenance/**" - -env: - CACHE_VERSION: 4 - KEY_PREFIX: venv - -permissions: - contents: read - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - tests-linux: - name: run / ${{ matrix.python-version }} / Linux - runs-on: ubuntu-latest - timeout-minutes: 25 - strategy: - fail-fast: false - matrix: - python-version: [3.9, "3.10", "3.11", "3.12"] - outputs: - python-key: ${{ steps.generate-python-key.outputs.key }} - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.1.7 - - name: Set up Python ${{ matrix.python-version }} - id: python - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ matrix.python-version }} - check-latest: true - - name: Generate partial Python venv restore key - id: generate-python-key - run: >- - echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{ - hashFiles('pyproject.toml', 'requirements_test.txt', - 'requirements_test_min.txt', 'requirements_test_pre_commit.txt') }}" >> - $GITHUB_OUTPUT - - name: Restore Python virtual environment - id: cache-venv - uses: actions/cache@v4.0.2 - with: - path: venv - key: >- - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ - steps.generate-python-key.outputs.key }} - - name: Create Python virtual environment - if: steps.cache-venv.outputs.cache-hit != 'true' - run: | - python -m venv venv - . venv/bin/activate - python -m pip install -U pip setuptools wheel - pip install -U -r requirements_test.txt - - name: Run pytest - run: | - . venv/bin/activate - pip list | grep 'astroid\|pylint' - python -m pytest --durations=10 --benchmark-disable --cov --cov-report= tests/ - - name: Run functional tests with minimal messages config - run: | - . venv/bin/activate - pip list | grep 'astroid\|pylint' - python -m pytest -vv --minimal-messages-config tests/test_functional.py - - name: Upload coverage artifact - uses: actions/upload-artifact@v4.3.4 - with: - name: coverage-${{ matrix.python-version }} - path: .coverage - - coverage: - name: process / coverage - runs-on: ubuntu-latest - timeout-minutes: 5 - needs: tests-linux - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.1.7 - - name: Set up Python 3.12 - id: python - uses: actions/setup-python@v5.1.0 - with: - python-version: "3.12" - check-latest: true - - name: Restore Python virtual environment - id: cache-venv - uses: actions/cache@v4.0.2 - with: - path: venv - fail-on-cache-miss: true - key: - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ - needs.tests-linux.outputs.python-key }} - - name: Download all coverage artifacts - uses: actions/download-artifact@v4.1.8 - - name: Combine coverage results - run: | - . venv/bin/activate - coverage combine coverage*/.coverage - coverage xml - - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - verbose: true - - benchmark-linux: - name: run benchmark / ${{ matrix.python-version }} / Linux - runs-on: ubuntu-latest - timeout-minutes: 10 - needs: tests-linux - strategy: - fail-fast: false - matrix: - python-version: ["3.12"] - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.1.7 - - name: Set up Python ${{ matrix.python-version }} - id: python - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ matrix.python-version }} - check-latest: true - - name: Restore Python virtual environment - id: cache-venv - uses: actions/cache@v4.0.2 - with: - path: venv - fail-on-cache-miss: true - key: - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ - needs.tests-linux.outputs.python-key }} - - name: Run pytest - run: | - . venv/bin/activate - pip install pygal - pip install . - pip list | grep 'astroid\|pylint' - 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 "datetime="$(date "+%Y%m%d_%H%M") >> $GITHUB_OUTPUT - - name: Upload benchmark artifact - uses: actions/upload-artifact@v4.3.4 - with: - name: - benchmark-${{ runner.os }}-${{ matrix.python-version }}_${{ - steps.artifact-name-suffix.outputs.datetime }} - path: .benchmarks/ - - tests-windows: - name: run / ${{ matrix.python-version }} / Windows - runs-on: windows-latest - timeout-minutes: 25 - needs: tests-linux - strategy: - fail-fast: false - matrix: - python-version: [3.9, "3.10", "3.11", "3.12"] - steps: - - name: Set temp directory - run: echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV - # Workaround to set correct temp directory on Windows - # https://github.com/actions/virtual-environments/issues/712 - - name: Check out code from GitHub - uses: actions/checkout@v4.1.7 - - name: Set up Python ${{ matrix.python-version }} - id: python - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ matrix.python-version }} - check-latest: true - - name: Generate partial Python venv restore key - id: generate-python-key - run: >- - echo "key=venv-${{ env.CACHE_VERSION }}-${{ - hashFiles('pyproject.toml', 'requirements_test_min.txt') - }}" >> $env:GITHUB_OUTPUT - - name: Restore Python virtual environment - id: cache-venv - uses: actions/cache@v4.0.2 - with: - path: venv - key: >- - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ - steps.generate-python-key.outputs.key }} - - name: Create Python virtual environment - if: steps.cache-venv.outputs.cache-hit != 'true' - run: | - python -m venv venv - . venv\\Scripts\\activate - python -m pip install -U pip setuptools wheel - pip install -U -r requirements_test_min.txt - - name: Run pytest - run: | - . venv\\Scripts\\activate - pip list | grep 'astroid\|pylint' - python -m pytest --durations=10 --benchmark-disable tests/ - - tests-macos: - name: run / ${{ matrix.python-version }} / macOS - runs-on: macos-latest - timeout-minutes: 25 - needs: tests-linux - strategy: - fail-fast: false - matrix: - # We only run on the oldest supported version on Mac - python-version: [3.9] - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.1.7 - - name: Set up Python ${{ matrix.python-version }} - id: python - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ matrix.python-version }} - check-latest: true - - name: Generate partial Python venv restore key - id: generate-python-key - run: >- - echo "key=venv-${{ env.CACHE_VERSION }}-${{ - hashFiles('pyproject.toml', 'requirements_test_min.txt') - }}" >> $GITHUB_OUTPUT - - name: Restore Python virtual environment - id: cache-venv - uses: actions/cache@v4.0.2 - with: - path: venv - key: >- - ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ - steps.generate-python-key.outputs.key }} - - name: Create Python virtual environment - if: steps.cache-venv.outputs.cache-hit != 'true' - run: | - python -m venv venv - . venv/bin/activate - python -m pip install -U pip setuptools wheel - pip install -U -r requirements_test_min.txt - - name: Run pytest - run: | - . venv/bin/activate - pip list | grep 'astroid\|pylint' - python -m pytest --durations=10 --benchmark-disable tests/ - - tests-pypy: - name: run / ${{ matrix.python-version }} / Linux - runs-on: ubuntu-latest - timeout-minutes: 25 - strategy: - fail-fast: false - matrix: - python-version: ["pypy-3.9", "pypy-3.10"] - steps: - - name: Check out code from GitHub - uses: actions/checkout@v4.1.7 - - name: Set up Python ${{ matrix.python-version }} - id: python - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ matrix.python-version }} - check-latest: true - - name: Generate partial Python venv restore key - id: generate-python-key - run: >- - echo "key=venv-${{ env.CACHE_VERSION }}-${{ - hashFiles('pyproject.toml', 'requirements_test_min.txt') - }}" >> $GITHUB_OUTPUT - - name: Restore Python virtual environment - id: cache-venv - uses: actions/cache@v4.0.2 - with: - path: venv - key: >- - ${{ runner.os }}-${{ matrix.python-version }}-${{ - steps.generate-python-key.outputs.key }} - - name: Create Python virtual environment - if: steps.cache-venv.outputs.cache-hit != 'true' - run: | - python -m venv venv - . venv/bin/activate - python -m pip install -U pip setuptools wheel - pip install -U -r requirements_test_min.txt - - name: Run pytest - run: | - . venv/bin/activate - pip list | grep 'astroid\|pylint' - python -m pytest --durations=10 --benchmark-disable tests/ diff --git a/.gitignore b/.gitignore index d8076095652..e8ec590f5b3 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ build-stamp .pytest_cache/ .mypy_cache/ .benchmarks/ +venv diff --git a/requirements_test_min.txt b/requirements_test_min.txt index b8d46bd2e3c..990c9d685db 100644 --- a/requirements_test_min.txt +++ b/requirements_test_min.txt @@ -5,8 +5,7 @@ typing-extensions~=4.12 py~=1.11.0 pytest~=8.2 pytest-benchmark~=4.0 +pytest-codspeed~=2.2.1 pytest-timeout~=2.3 towncrier~=23.11 requests -# Voluntary for test purpose, not actually used in prod, see #8904 -setuptools==41.6.0 diff --git a/tests/benchmark/test_baseline_benchmarks.py b/tests/benchmark/test_baseline_benchmarks.py index e663aa4b089..b50446ce6a5 100644 --- a/tests/benchmark/test_baseline_benchmarks.py +++ b/tests/benchmark/test_baseline_benchmarks.py @@ -176,9 +176,6 @@ def test_baseline_lots_of_files_j1(self, benchmark: BenchmarkFixture) -> None: We do not register any checkers except the default 'main', so the cost is just that of the system with a lot of files registered """ - if benchmark.disabled: - benchmark(print, "skipping, only benchmark large file counts") - return # _only_ run this test is profiling linter = PyLinter(reporter=Reporter()) linter.config.jobs = 1 fileinfos = [self.empty_filepath for _ in range(self.lot_of_files)] @@ -197,9 +194,6 @@ def test_baseline_lots_of_files_j2(self, benchmark: BenchmarkFixture) -> None: register any checkers except the default 'main', so the cost is just that of the check_parallel system across 2 workers, plus the overhead of PyLinter """ - if benchmark.disabled: - benchmark(print, "skipping, only benchmark large file counts") - return # _only_ run this test is profiling linter = PyLinter(reporter=Reporter()) linter.config.jobs = 2 fileinfos = [self.empty_filepath for _ in range(self.lot_of_files)] @@ -218,9 +212,6 @@ def test_baseline_lots_of_files_j1_empty_checker( We use a checker that does no work, so the cost is just that of the system at scale """ - if benchmark.disabled: - benchmark(print, "skipping, only benchmark large file counts") - return # _only_ run this test is profiling linter = PyLinter(reporter=Reporter()) linter.config.jobs = 1 linter.register_checker(NoWorkChecker(linter)) @@ -241,9 +232,6 @@ def test_baseline_lots_of_files_j2_empty_checker( We use a checker that does no work, so the cost is just that of the system at scale, across workers """ - if benchmark.disabled: - benchmark(print, "skipping, only benchmark large file counts") - return # _only_ run this test is profiling linter = PyLinter(reporter=Reporter()) linter.config.jobs = 2 linter.register_checker(NoWorkChecker(linter)) @@ -266,9 +254,6 @@ def test_baseline_benchmark_j1_single_working_checker( We expect this benchmark to take very close to `numfiles*SleepingChecker.sleep_duration` """ - if benchmark.disabled: - benchmark(print, "skipping, do not want to sleep in main tests") - return # _only_ run this test is profiling linter = PyLinter(reporter=Reporter()) linter.register_checker(SleepingChecker(linter)) @@ -295,9 +280,6 @@ def test_baseline_benchmark_j2_single_working_checker( Because of the cost of the framework and system the performance difference will *not* be 1/2 of -j1 versions. """ - if benchmark.disabled: - benchmark(print, "skipping, do not want to sleep in main tests") - return # _only_ run this test is profiling linter = PyLinter(reporter=Reporter()) linter.config.jobs = 2 linter.register_checker(SleepingChecker(linter)) @@ -334,9 +316,6 @@ def test_baseline_benchmark_j1_all_checks_lots_of_files( ... that's the intent at least. """ - if benchmark.disabled: - benchmark(print, "skipping, only benchmark large file counts") - return # _only_ run this test is profiling linter = PyLinter() # Register all checkers/extensions and enable them