Skip to content

Commit 46c056f

Browse files
Merge remote-tracking branch 'origin/main' into constraint-checking
2 parents f70fbad + f476ebc commit 46c056f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+755
-267
lines changed

.coveragerc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
[paths]
2-
source =
3-
astroid
1+
[run]
2+
relative_files = true
43

54
[report]
6-
include =
7-
astroid/*
85
omit =
96
*/tests/*
7+
*/tmp*/*
108
exclude_lines =
119
# Re-enable default pragma
1210
pragma: no cover

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
<!--
2-
32
Thank you for submitting a PR to astroid!
43
5-
To ease our work reviewing your PR, do make sure to mark the complete the following boxes.
6-
7-
-->
8-
9-
## Steps
4+
To ease the process of reviewing your PR, do make sure to complete the following boxes.
105
11-
- [ ] For new features or bug fixes, add a ChangeLog entry describing what your PR does.
126
- [ ] Write a good description on what the PR does.
13-
14-
## Description
7+
- [ ] For new features or bug fixes, add a ChangeLog entry describing what your PR does.
8+
- [ ] If you used multiple emails or multiple names when contributing, add your mails
9+
and preferred name in ``script/.contributors_aliases.json``
10+
-->
1511

1612
## Type of Changes
1713

@@ -24,11 +20,12 @@ To ease our work reviewing your PR, do make sure to mark the complete the follow
2420
|| :hammer: Refactoring |
2521
|| :scroll: Docs |
2622

27-
## Related Issue
23+
## Description
2824

29-
<!--
30-
If this PR fixes a particular issue, use the following to automatically close that issue
31-
once this PR gets merged:
25+
<!-- If this PR references an issue without fixing it: -->
3226

33-
Closes #XXX
34-
-->
27+
Refs #XXXX
28+
29+
<!-- If this PR fixes an issue, use the following to automatically close when we merge: -->
30+
31+
Closes #XXXX

.github/workflows/backport.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Backport
2+
on:
3+
pull_request_target:
4+
types:
5+
- closed
6+
- labeled
7+
8+
permissions:
9+
pull-requests: write
10+
contents: write
11+
12+
jobs:
13+
backport:
14+
name: Backport
15+
runs-on: ubuntu-latest
16+
# Only react to merged PRs for security reasons.
17+
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
18+
if: >
19+
github.event.pull_request.merged && (
20+
github.event.action == 'closed'
21+
|| (
22+
github.event.action == 'labeled'
23+
&& contains(github.event.label.name, 'backport')
24+
)
25+
)
26+
steps:
27+
- uses: tibdex/backport@2e217641d82d02ba0603f46b1aeedefb258890ac # v2.0.3
28+
with:
29+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yaml

Lines changed: 78 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ on:
88
pull_request: ~
99

1010
env:
11-
CACHE_VERSION: 2
11+
CACHE_VERSION: 3
1212
KEY_PREFIX: venv
13-
DEFAULT_PYTHON: "3.10"
13+
DEFAULT_PYTHON: "3.11"
1414
PRE_COMMIT_CACHE: ~/.cache/pre-commit
1515

1616
jobs:
@@ -20,10 +20,10 @@ jobs:
2020
timeout-minutes: 20
2121
steps:
2222
- name: Check out code from GitHub
23-
uses: actions/checkout@v3.1.0
23+
uses: actions/checkout@v3.2.0
2424
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
2525
id: python
26-
uses: actions/setup-python@v4.3.0
26+
uses: actions/setup-python@v4.4.0
2727
with:
2828
python-version: ${{ env.DEFAULT_PYTHON }}
2929
check-latest: true
@@ -36,7 +36,7 @@ jobs:
3636
'requirements_test_pre_commit.txt') }}" >> $GITHUB_OUTPUT
3737
- name: Restore Python virtual environment
3838
id: cache-venv
39-
uses: actions/cache@v3.0.11
39+
uses: actions/cache@v3.2.2
4040
with:
4141
path: venv
4242
key: >-
@@ -56,7 +56,7 @@ jobs:
5656
hashFiles('.pre-commit-config.yaml') }}" >> $GITHUB_OUTPUT
5757
- name: Restore pre-commit environment
5858
id: cache-precommit
59-
uses: actions/cache@v3.0.11
59+
uses: actions/cache@v3.2.2
6060
with:
6161
path: ${{ env.PRE_COMMIT_CACHE }}
6262
key: >-
@@ -83,10 +83,10 @@ jobs:
8383
python-key: ${{ steps.generate-python-key.outputs.key }}
8484
steps:
8585
- name: Check out code from GitHub
86-
uses: actions/checkout@v3.1.0
86+
uses: actions/checkout@v3.2.0
8787
- name: Set up Python ${{ matrix.python-version }}
8888
id: python
89-
uses: actions/setup-python@v4.3.0
89+
uses: actions/setup-python@v4.4.0
9090
with:
9191
python-version: ${{ matrix.python-version }}
9292
check-latest: true
@@ -103,7 +103,7 @@ jobs:
103103
$GITHUB_OUTPUT
104104
- name: Restore Python virtual environment
105105
id: cache-venv
106-
uses: actions/cache@v3.0.11
106+
uses: actions/cache@v3.2.2
107107
with:
108108
path: venv
109109
key: >-
@@ -120,59 +120,13 @@ jobs:
120120
- name: Run pytest
121121
run: |
122122
. venv/bin/activate
123-
pytest --cov --cov-report= tests/
123+
pytest --cov
124124
- name: Upload coverage artifact
125125
uses: actions/[email protected]
126126
with:
127-
name: coverage-${{ matrix.python-version }}
127+
name: coverage-linux-${{ matrix.python-version }}
128128
path: .coverage
129129

130-
coverage:
131-
name: tests / process / coverage
132-
runs-on: ubuntu-latest
133-
timeout-minutes: 5
134-
needs: ["tests-linux"]
135-
strategy:
136-
matrix:
137-
python-version: ["3.10"]
138-
env:
139-
COVERAGERC_FILE: .coveragerc
140-
steps:
141-
- name: Check out code from GitHub
142-
uses: actions/[email protected]
143-
- name: Set up Python ${{ matrix.python-version }}
144-
id: python
145-
uses: actions/[email protected]
146-
with:
147-
python-version: ${{ matrix.python-version }}
148-
check-latest: true
149-
- name: Restore Python virtual environment
150-
id: cache-venv
151-
uses: actions/[email protected]
152-
with:
153-
path: venv
154-
key:
155-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
156-
needs.tests-linux.outputs.python-key }}
157-
- name: Fail job if Python cache restore failed
158-
if: steps.cache-venv.outputs.cache-hit != 'true'
159-
run: |
160-
echo "Failed to restore Python venv from cache"
161-
exit 1
162-
- name: Download all coverage artifacts
163-
uses: actions/[email protected]
164-
- name: Combine coverage results
165-
run: |
166-
. venv/bin/activate
167-
coverage combine coverage*/.coverage
168-
coverage report --rcfile=${{ env.COVERAGERC_FILE }}
169-
- name: Upload coverage to Coveralls
170-
env:
171-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
172-
run: |
173-
. venv/bin/activate
174-
coveralls --rcfile=${{ env.COVERAGERC_FILE }} --service=github
175-
176130
tests-windows:
177131
name: tests / run / ${{ matrix.python-version }} / Windows
178132
runs-on: windows-latest
@@ -188,10 +142,10 @@ jobs:
188142
# Workaround to set correct temp directory on Windows
189143
# https://github.com/actions/virtual-environments/issues/712
190144
- name: Check out code from GitHub
191-
uses: actions/checkout@v3.1.0
145+
uses: actions/checkout@v3.2.0
192146
- name: Set up Python ${{ matrix.python-version }}
193147
id: python
194-
uses: actions/setup-python@v4.3.0
148+
uses: actions/setup-python@v4.4.0
195149
with:
196150
python-version: ${{ matrix.python-version }}
197151
check-latest: true
@@ -203,7 +157,7 @@ jobs:
203157
'requirements_test_brain.txt') }}" >> $env:GITHUB_OUTPUT
204158
- name: Restore Python virtual environment
205159
id: cache-venv
206-
uses: actions/cache@v3.0.11
160+
uses: actions/cache@v3.2.2
207161
with:
208162
path: venv
209163
key: >-
@@ -220,7 +174,12 @@ jobs:
220174
- name: Run pytest
221175
run: |
222176
. venv\\Scripts\\activate
223-
pytest tests/
177+
pytest --cov
178+
- name: Upload coverage artifact
179+
uses: actions/[email protected]
180+
with:
181+
name: coverage-windows-${{ matrix.python-version }}
182+
path: .coverage
224183

225184
tests-pypy:
226185
name: tests / run / ${{ matrix.python-version }} / Linux
@@ -232,10 +191,10 @@ jobs:
232191
python-version: ["pypy3.7", "pypy3.8", "pypy3.9"]
233192
steps:
234193
- name: Check out code from GitHub
235-
uses: actions/checkout@v3.1.0
194+
uses: actions/checkout@v3.2.0
236195
- name: Set up Python ${{ matrix.python-version }}
237196
id: python
238-
uses: actions/setup-python@v4.3.0
197+
uses: actions/setup-python@v4.4.0
239198
with:
240199
python-version: ${{ matrix.python-version }}
241200
check-latest: true
@@ -247,7 +206,7 @@ jobs:
247206
}}" >> $GITHUB_OUTPUT
248207
- name: Restore Python virtual environment
249208
id: cache-venv
250-
uses: actions/cache@v3.0.11
209+
uses: actions/cache@v3.2.2
251210
with:
252211
path: venv
253212
key: >-
@@ -264,4 +223,58 @@ jobs:
264223
- name: Run pytest
265224
run: |
266225
. venv/bin/activate
267-
pytest tests/
226+
pytest --cov
227+
- name: Upload coverage artifact
228+
uses: actions/[email protected]
229+
with:
230+
name: coverage-pypy-${{ matrix.python-version }}
231+
path: .coverage
232+
233+
coverage:
234+
name: tests / process / coverage
235+
runs-on: ubuntu-latest
236+
timeout-minutes: 10
237+
needs: ["tests-linux", "tests-windows", "tests-pypy"]
238+
steps:
239+
- name: Check out code from GitHub
240+
uses: actions/[email protected]
241+
- name: Set up Python 3.11
242+
id: python
243+
uses: actions/[email protected]
244+
with:
245+
python-version: "3.11"
246+
check-latest: true
247+
- name: Install dependencies
248+
run: pip install -U -r requirements_test_min.txt
249+
- name: Download all coverage artifacts
250+
uses: actions/[email protected]
251+
- name: Combine Linux coverage results
252+
run: |
253+
coverage combine coverage-linux*/.coverage
254+
coverage xml -o coverage-linux.xml
255+
- uses: codecov/codecov-action@v3
256+
with:
257+
fail_ci_if_error: true
258+
verbose: true
259+
flags: linux
260+
files: coverage-linux.xml
261+
- name: Combine Windows coverage results
262+
run: |
263+
coverage combine coverage-windows*/.coverage
264+
coverage xml -o coverage-windows.xml
265+
- uses: codecov/codecov-action@v3
266+
with:
267+
fail_ci_if_error: true
268+
verbose: true
269+
flags: windows
270+
files: coverage-windows.xml
271+
- name: Combine PyPy coverage results
272+
run: |
273+
coverage combine coverage-pypy*/.coverage
274+
coverage xml -o coverage-pypy.xml
275+
- uses: codecov/codecov-action@v3
276+
with:
277+
fail_ci_if_error: true
278+
verbose: true
279+
flags: pypy
280+
files: coverage-pypy.xml

.github/workflows/codeql-analysis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ on:
1818
# The branches below must be a subset of the branches above
1919
branches: [main]
2020
schedule:
21-
- cron: "30 21 * * 2"
21+
- cron: "44 16 * * 4"
22+
23+
permissions:
24+
contents: read
2225

2326
jobs:
2427
analyze:
@@ -39,7 +42,7 @@ jobs:
3942

4043
steps:
4144
- name: Checkout repository
42-
uses: actions/checkout@v3.1.0
45+
uses: actions/checkout@v3.2.0
4346

4447
# Initializes the CodeQL tools for scanning.
4548
- name: Initialize CodeQL

.github/workflows/release-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
timeout-minutes: 5
1414
steps:
1515
- name: Check out code from GitHub
16-
uses: actions/checkout@v3.1.0
16+
uses: actions/checkout@v3.2.0
1717
- name: Set up Python 3.9
1818
id: python
19-
uses: actions/setup-python@v4.3.0
19+
uses: actions/setup-python@v4.4.0
2020
with:
2121
# virtualenv 15.1.0 cannot be installed on Python 3.10+
2222
python-version: 3.9

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- published
77

88
env:
9-
DEFAULT_PYTHON: "3.10"
9+
DEFAULT_PYTHON: "3.11"
1010

1111
permissions:
1212
contents: read
@@ -20,10 +20,10 @@ jobs:
2020
url: https://pypi.org/project/astroid/
2121
steps:
2222
- name: Check out code from Github
23-
uses: actions/checkout@v3.1.0
23+
uses: actions/checkout@v3.2.0
2424
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
2525
id: python
26-
uses: actions/setup-python@v4.3.0
26+
uses: actions/setup-python@v4.4.0
2727
with:
2828
python-version: ${{ env.DEFAULT_PYTHON }}
2929
check-latest: true

0 commit comments

Comments
 (0)