Skip to content

Commit a53927b

Browse files
committed
Move windows-tests into tests
1 parent 7422cf3 commit a53927b

File tree

2 files changed

+46
-123
lines changed

2 files changed

+46
-123
lines changed

.github/workflows/tests.yaml

Lines changed: 24 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ on:
1212
- main
1313
- "maintenance/**"
1414

15-
env:
16-
CACHE_VERSION: 5
17-
KEY_PREFIX: venv
18-
1915
permissions:
2016
contents: read
2117

@@ -30,7 +26,7 @@ jobs:
3026
strategy:
3127
fail-fast: false
3228
matrix:
33-
os: [ubuntu-latest]
29+
os: [ubuntu-latest, windows-latest]
3430
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
3531
include:
3632
- os: macos-latest
@@ -42,56 +38,32 @@ jobs:
4238
- os: ubuntu-latest
4339
python-version: "pypy-3.11"
4440
runs-on: ${{ matrix.os }}
45-
outputs:
46-
python-key: ${{ steps.generate-python-key.outputs.key }}
4741
steps:
4842
- name: Check out code from GitHub
4943
uses: actions/[email protected]
50-
- name: Set up Python ${{ matrix.python-version }}
51-
id: python
52-
uses: actions/[email protected]
44+
- name: Set up uv with Python ${{ matrix.python-version }} on ${{ matrix.os }}
45+
uses: astral-sh/setup-uv@v5
5346
with:
47+
enable-cache: true
5448
python-version: ${{ matrix.python-version }}
55-
check-latest: true
56-
- name: Generate partial Python venv restore key
57-
id: generate-python-key
58-
run: >-
59-
echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{
60-
hashFiles('pyproject.toml', 'requirements_test.txt',
61-
'requirements_test_min.txt', 'requirements_test_pre_commit.txt') }}" >>
62-
$GITHUB_OUTPUT
63-
- name: Restore Python virtual environment
64-
id: cache-venv
65-
uses: actions/[email protected]
66-
with:
67-
path: venv
68-
key: >-
69-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
70-
steps.generate-python-key.outputs.key }}
71-
- name: Create Python virtual environment
72-
if: steps.cache-venv.outputs.cache-hit != 'true'
73-
run: |
74-
python -m venv venv
75-
. venv/bin/activate
76-
python -m pip install --upgrade pip setuptools wheel
77-
pip install --upgrade --requirement requirements_test.txt
78-
- name: Run pytest
79-
run: |
80-
. venv/bin/activate
81-
pip list | grep 'astroid\|pylint'
82-
python -m pytest --durations=10 --benchmark-disable --cov --cov-report= tests/
83-
- name: Run functional tests with minimal messages config
84-
run: |
85-
. venv/bin/activate
86-
pip list | grep 'astroid\|pylint'
87-
python -m pytest -vv --minimal-messages-config tests/test_functional.py
88-
- name: Upload coverage artifact
89-
if: runner.os == 'Linux'
90-
uses: actions/[email protected]
91-
with:
92-
name: coverage-${{ matrix.python-version }}
93-
include-hidden-files: true
94-
path: .coverage
49+
#- run: |
50+
# uv pip install --python=${{ matrix.python-version }} pip
51+
# pip --version
52+
# uv pip --version
53+
#- run: uv pip install --editable ".[dev,testutils]"
54+
#- run: pip list | grep 'astroid\|pylint'
55+
#- name: Run pytest
56+
# run: |
57+
# python -m pytest --durations=10 --benchmark-disable --cov --cov-report= tests/
58+
#- name: Run functional tests with minimal messages config
59+
# run: python -m pytest -vv --minimal-messages-config tests/test_functional.py
60+
#- name: Upload coverage artifact
61+
# if: runner.os == 'Linux'
62+
# uses: actions/[email protected]
63+
# with:
64+
# name: coverage-${{ matrix.python-version }}
65+
# include-hidden-files: true
66+
# path: .coverage
9567

9668
coverage:
9769
name: process / coverage
@@ -101,26 +73,14 @@ jobs:
10173
steps:
10274
- name: Check out code from GitHub
10375
uses: actions/[email protected]
104-
- name: Set up Python 3.13
105-
id: python
76+
- name: Set up Python 3.x
10677
uses: actions/[email protected]
10778
with:
108-
python-version: "3.13"
109-
check-latest: true
110-
- name: Restore Python virtual environment
111-
id: cache-venv
112-
uses: actions/[email protected]
113-
with:
114-
path: venv
115-
fail-on-cache-miss: true
116-
key:
117-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
118-
needs.tests-linux.outputs.python-key }}
79+
python-version: "3.x"
11980
- name: Download all coverage artifacts
12081
uses: actions/[email protected]
12182
- name: Combine coverage results
12283
run: |
123-
. venv/bin/activate
12484
coverage combine coverage*/.coverage
12585
coverage xml
12686
- uses: codecov/codecov-action@v5
@@ -147,18 +107,8 @@ jobs:
147107
with:
148108
python-version: ${{ matrix.python-version }}
149109
check-latest: true
150-
- name: Restore Python virtual environment
151-
id: cache-venv
152-
uses: actions/[email protected]
153-
with:
154-
path: venv
155-
fail-on-cache-miss: true
156-
key:
157-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
158-
needs.tests-linux.outputs.python-key }}
159110
- name: Run pytest
160111
run: |
161-
. venv/bin/activate
162112
pip install pygal
163113
pip install .
164114
pip list | grep 'astroid\|pylint'
@@ -179,52 +129,3 @@ jobs:
179129
steps.artifact-name-suffix.outputs.datetime }}
180130
include-hidden-files: true
181131
path: .benchmarks/
182-
183-
tests-windows:
184-
name: run / ${{ matrix.python-version }} / Windows
185-
runs-on: windows-latest
186-
timeout-minutes: 25
187-
needs: tests
188-
strategy:
189-
fail-fast: false
190-
matrix:
191-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
192-
steps:
193-
- name: Set temp directory
194-
run: echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
195-
# Workaround to set correct temp directory on Windows
196-
# https://github.com/actions/virtual-environments/issues/712
197-
- name: Check out code from GitHub
198-
uses: actions/[email protected]
199-
- name: Set up Python ${{ matrix.python-version }}
200-
id: python
201-
uses: actions/[email protected]
202-
with:
203-
python-version: ${{ matrix.python-version }}
204-
check-latest: true
205-
- name: Generate partial Python venv restore key
206-
id: generate-python-key
207-
run: >-
208-
echo "key=venv-${{ env.CACHE_VERSION }}-${{
209-
hashFiles('pyproject.toml', 'requirements_test_min.txt')
210-
}}" >> $env:GITHUB_OUTPUT
211-
- name: Restore Python virtual environment
212-
id: cache-venv
213-
uses: actions/[email protected]
214-
with:
215-
path: venv
216-
key: >-
217-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
218-
steps.generate-python-key.outputs.key }}
219-
- name: Create Python virtual environment
220-
if: steps.cache-venv.outputs.cache-hit != 'true'
221-
run: |
222-
python -m venv venv
223-
. venv\\Scripts\\activate
224-
python -m pip install --upgrade pip setuptools wheel
225-
pip install --upgrade --requirement requirements_test_min.txt
226-
- name: Run pytest
227-
run: |
228-
. venv\\Scripts\\activate
229-
pip list | grep 'astroid\|pylint'
230-
python -m pytest --durations=10 --benchmark-disable tests/

pyproject.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,28 @@ dependencies = [
5151
"tomlkit>=0.10.1",
5252
"typing-extensions>=3.10; python_version<'3.10'",
5353
]
54+
optional-dependencies.dev = [
55+
# A combination of requirements_test.txt and requirements_test_min.txt
56+
"astroid==4.0.0a0", # Pinned to a specific version for tests
57+
"contributors-txt>=1",
58+
"coverage~=7.7",
59+
"py~=1.11.0",
60+
"pytest~=8.3",
61+
"pytest-benchmark~=5.1",
62+
"pytest-cov~=6.0",
63+
"pytest-timeout~=2.3",
64+
"pytest-xdist~=3.6",
65+
"requests",
66+
# Voluntary for test purpose, not actually used in prod, see #8904
67+
"setuptools; python_version>='3.12'",
68+
"six",
69+
"tbump~=6.11.0",
70+
"towncrier~=24.8",
71+
"tox>=3",
72+
# Type packages for mypy
73+
"types-setuptools==76.0.0.20250313",
74+
"typing-extensions~=4.12",
75+
]
5476
optional-dependencies.spelling = [ "pyenchant~=3.2" ]
5577
optional-dependencies.testutils = [ "gitpython>3" ]
5678
urls."Bug Tracker" = "https://github.com/pylint-dev/pylint/issues"

0 commit comments

Comments
 (0)