Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/PyCQA/pylint into issue-4354
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielNoord committed Sep 2, 2022
2 parents 30d85df + 880095c commit 68ea2d5
Show file tree
Hide file tree
Showing 369 changed files with 2,832 additions and 1,982 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

env:
# Also change CACHE_VERSION in the other workflows
CACHE_VERSION: 20
CACHE_VERSION: 23
DEFAULT_PYTHON: "3.10"

jobs:
Expand All @@ -24,7 +24,7 @@ jobs:
fetch-depth: 0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v4.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Generate partial Python venv restore key
Expand All @@ -35,7 +35,7 @@ jobs:
}}"
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected].5
uses: actions/[email protected].8
with:
path: venv
key: >-
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request: ~

env:
CACHE_VERSION: 20
CACHE_VERSION: 23
DEFAULT_PYTHON: "3.10"
PRE_COMMIT_CACHE: ~/.cache/pre-commit

Expand All @@ -29,7 +29,7 @@ jobs:
uses: actions/[email protected]
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v4.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Generate partial Python venv restore key
Expand All @@ -40,7 +40,7 @@ jobs:
}}"
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected].5
uses: actions/[email protected].8
with:
path: venv
key: >-
Expand All @@ -63,7 +63,7 @@ jobs:
hashFiles('.pre-commit-config.yaml') }}"
- name: Restore pre-commit environment
id: cache-precommit
uses: actions/[email protected].5
uses: actions/[email protected].8
with:
path: ${{ env.PRE_COMMIT_CACHE }}
key: >-
Expand All @@ -86,12 +86,12 @@ jobs:
uses: actions/[email protected]
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v4.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected].5
uses: actions/[email protected].8
with:
path: venv
key:
Expand All @@ -104,7 +104,7 @@ jobs:
exit 1
- name: Restore pre-commit environment
id: cache-precommit
uses: actions/[email protected].5
uses: actions/[email protected].8
with:
path: ${{ env.PRE_COMMIT_CACHE }}
key: ${{ runner.os }}-${{ needs.prepare-base.outputs.pre-commit-key }}
Expand Down Expand Up @@ -133,12 +133,12 @@ jobs:
uses: actions/[email protected]
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v4.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected].5
uses: actions/[email protected].8
with:
path: venv
key:
Expand All @@ -164,12 +164,12 @@ jobs:
uses: actions/[email protected]
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v4.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected].5
uses: actions/[email protected].8
with:
path: venv
key:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/primer-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- ".github/workflows/primer-test.yaml"

env:
CACHE_VERSION: 20
CACHE_VERSION: 23

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -34,7 +34,7 @@ jobs:
uses: actions/[email protected]
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v4.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Generate partial Python venv restore key
Expand All @@ -45,7 +45,7 @@ jobs:
}}"
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected].5
uses: actions/[email protected].8
with:
path: venv
key: >-
Expand Down Expand Up @@ -74,12 +74,12 @@ jobs:
uses: actions/[email protected]
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v4.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected].5
uses: actions/[email protected].8
with:
path: venv
key:
Expand Down Expand Up @@ -109,12 +109,12 @@ jobs:
uses: actions/[email protected]
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v4.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected].5
uses: actions/[email protected].8
with:
path: venv
key:
Expand Down
38 changes: 12 additions & 26 deletions .github/workflows/primer_comment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ on:
- completed

env:
CACHE_VERSION: 20
# This needs to be the SAME as in the Main and PR job
CACHE_VERSION: 23

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:
Expand All @@ -32,34 +35,24 @@ jobs:
uses: actions/[email protected]
- name: Set up Python 3.10
id: python
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v4.2.0
with:
python-version: "3.10"

# Restore cached Python environment
- name: Generate partial Python venv restore key
id: generate-python-key
run: >-
echo "::set-output name=key::venv-${{ env.CACHE_VERSION }}-${{
hashFiles('setup.cfg', 'requirements_test.txt', 'requirements_test_min.txt')
}}"
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected].5
uses: actions/[email protected].8
with:
path: venv
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
steps.generate-python-key.outputs.key }}
restore-keys: |
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{ env.CACHE_VERSION }}-
- name: Create Python virtual environment
key:
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-primer-${{
env.CACHE_VERSION }}
- name: Fail job if Python cache restore failed
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
echo "Failed to restore Python venv from cache"
exit 1
- name: Download outputs
uses: actions/github-script@v6
Expand Down Expand Up @@ -141,10 +134,3 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
leave_visible: 1
issue_number: ${{ steps.post-comment.outputs.result }}
- name: Warn about failure
if: ${{ failure() }}
run: |
echo "🤖 **Comment workflow failed**. 🤖" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Please investigate:" >> $GITHUB_STEP_SUMMARY
echo "@DanielNoord" >> $GITHUB_STEP_SUMMARY
28 changes: 11 additions & 17 deletions .github/workflows/primer_run_main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ concurrency:
cancel-in-progress: true

env:
CACHE_VERSION: 20
# This needs to be the SAME as in the PR and comment job
CACHE_VERSION: 23

jobs:
run-primer:
Expand All @@ -30,7 +31,7 @@ jobs:
uses: actions/[email protected]
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v4.2.0
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -40,25 +41,18 @@ jobs:
curl https://api.github.com/repos/PyCQA/astroid/commits |
python -c "import json, sys; print(json.load(sys.stdin)[0]['sha'])" > astroid_sha.txt
# Restore cached Python environment
- name: Generate partial Python venv restore key
id: generate-python-key
run: >-
echo "::set-output name=key::venv-${{ env.CACHE_VERSION }}-${{
hashFiles('setup.cfg', 'requirements_test.txt', 'requirements_test_min.txt',
'astroid_sha.txt') }}"
- name: Restore Python virtual environment
# Create a re-usable virtual environment
- name: Create Python virtual environment cache
id: cache-venv
uses: actions/[email protected].5
uses: actions/[email protected].8
with:
path: venv
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
steps.generate-python-key.outputs.key }}
key:
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-primer-${{
env.CACHE_VERSION }}
restore-keys: |
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{ env.CACHE_VERSION }}-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-primer-${{ env.CACHE_VERSION }}
- name: Create Python virtual environment
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
python -m venv venv
. venv/bin/activate
Expand All @@ -77,7 +71,7 @@ jobs:
echo "::set-output name=commitstring::$output"
- name: Restore projects cache
id: cache-projects
uses: actions/[email protected].5
uses: actions/[email protected].8
with:
path: tests/.pylint_primer_tests/
key: >-
Expand Down
39 changes: 11 additions & 28 deletions .github/workflows/primer_run_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ concurrency:
cancel-in-progress: true

env:
CACHE_VERSION: 20
# This needs to be the SAME as in the Main and comment job
CACHE_VERSION: 23

jobs:
run-primer:
Expand All @@ -41,46 +42,28 @@ jobs:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v4.2.0
with:
python-version: ${{ matrix.python-version }}
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install @octokit/rest

- name: Get latest astroid commit
id: get-astroid-sha
run: |
curl https://api.github.com/repos/PyCQA/astroid/commits |
python -c "import json, sys; print(json.load(sys.stdin)[0]['sha'])" > astroid_sha.txt
# Restore cached Python environment
- name: Generate partial Python venv restore key
id: generate-python-key
run: >-
echo "::set-output name=key::venv-${{ env.CACHE_VERSION }}-${{
hashFiles('setup.cfg', 'requirements_test.txt', 'requirements_test_min.txt',
'astroid_sha.txt') }}"
- name: Restore Python virtual environment
id: cache-venv
uses: actions/[email protected].5
uses: actions/[email protected].8
with:
path: venv
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
steps.generate-python-key.outputs.key }}
restore-keys: |
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{ env.CACHE_VERSION }}-
- name: Create Python virtual environment
key:
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-primer-${{
env.CACHE_VERSION }}
- name: Fail job if Python cache restore failed
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
# Use bleeding-edge astroid
pip install git+https://github.com/PyCQA/astroid.git
echo "Failed to restore Python venv from cache"
exit 1
# Cache primer packages
- name: Download last 'main' run info
Expand Down Expand Up @@ -145,7 +128,7 @@ jobs:
echo "::set-output name=commitstring::$output"
- name: Restore projects cache
id: cache-projects
uses: actions/[email protected].5
uses: actions/[email protected].8
with:
path: tests/.pylint_primer_tests/
key: >-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/[email protected]
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.1.0
uses: actions/setup-python@v4.2.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Install requirements
Expand Down
Loading

0 comments on commit 68ea2d5

Please sign in to comment.