Skip to content

Commit d54f927

Browse files
authored
TEST-modin-project#7316: Run a subset of CI tests with python 3.10 and 3.11 on a scheduled basis (modin-project#7289)
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
1 parent 2d46ab3 commit d54f927

File tree

4 files changed

+57
-17
lines changed

4 files changed

+57
-17
lines changed

.github/actions/python-only/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: "Prepare the environment to run simple tasks"
33
inputs:
44
python-version:
55
description: "Python version to install"
6-
default: "3.9.x"
6+
default: "3.9"
77

88
runs:
99
using: "composite"

.github/workflows/ci-required.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
fetch-depth: 1
2929
- uses: actions/setup-python@v5
3030
with:
31-
python-version: "3.9.x"
31+
python-version: "3.9"
3232
architecture: "x64"
3333
cache: "pip"
3434
cache-dependency-path: '**/requirements-doc.txt'

.github/workflows/ci.yml

+49-14
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ on:
1717
- setup.py
1818
- versioneer.py
1919
push:
20+
schedule:
21+
- cron: "30 2 * * WED"
22+
- cron: "30 2 * * THU"
2023
concurrency:
2124
# Cancel other jobs in the same branch. We don't care whether CI passes
2225
# on old commits.
@@ -26,21 +29,44 @@ env:
2629
MODIN_GITHUB_CI: true
2730

2831
jobs:
32+
python-filter:
33+
runs-on: ubuntu-latest
34+
outputs:
35+
python-version: ${{ steps.choose.outputs.python-version }}
36+
steps:
37+
- id: choose
38+
run: |
39+
if [[ "${{ github.event.schedule }}" = "30 2 * * WED" ]]
40+
then
41+
echo "python-version=3.10" >> "$GITHUB_OUTPUT"
42+
elif [[ "${{ github.event.schedule }}" = "30 2 * * THU" ]]
43+
then
44+
echo "python-version=3.11" >> "$GITHUB_OUTPUT"
45+
else
46+
echo "python-version=3.9" >> "$GITHUB_OUTPUT"
47+
fi
48+
2949
lint-mypy:
50+
needs: [python-filter]
3051
name: lint (mypy)
3152
runs-on: ubuntu-latest
3253
steps:
3354
- uses: actions/checkout@v4
3455
- uses: ./.github/actions/python-only
56+
with:
57+
python-version: ${{ needs.python-filter.outputs.python-version }}
3558
- run: pip install -r requirements-dev.txt
3659
- run: mypy --config-file mypy.ini
3760

3861
lint-flake8:
62+
needs: [python-filter]
3963
name: lint (flake8)
4064
runs-on: ubuntu-latest
4165
steps:
4266
- uses: actions/checkout@v4
4367
- uses: ./.github/actions/python-only
68+
with:
69+
python-version: ${{ needs.python-filter.outputs.python-version }}
4470
# NOTE: If you are changing the set of packages installed here, make sure that
4571
# the dev requirements match them.
4672
- run: pip install flake8 flake8-print flake8-no-implicit-concat
@@ -49,6 +75,7 @@ jobs:
4975
- run: flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py
5076

5177
test-api-and-no-engine:
78+
needs: [python-filter]
5279
name: Test API, headers and no-engine mode
5380
runs-on: ubuntu-latest
5481
defaults:
@@ -59,14 +86,15 @@ jobs:
5986
- uses: ./.github/actions/mamba-env
6087
with:
6188
environment-file: requirements/requirements-no-engine.yml
89+
python-version: ${{ needs.python-filter.outputs.python-version }}
6290
- run: python -m pytest modin/tests/pandas/test_api.py
6391
- run: python -m pytest modin/tests/test_executions_api.py
6492
- run: python -m pytest modin/tests/test_headers.py
6593
- run: python -m pytest modin/tests/core/test_dispatcher.py::test_add_option
6694
- uses: ./.github/actions/upload-coverage
6795

6896
test-clean-install:
69-
needs: [lint-flake8]
97+
needs: [lint-flake8, python-filter]
7098
strategy:
7199
matrix:
72100
os:
@@ -80,6 +108,8 @@ jobs:
80108
steps:
81109
- uses: actions/checkout@v4
82110
- uses: ./.github/actions/python-only
111+
with:
112+
python-version: ${{ needs.python-filter.outputs.python-version }}
83113
- run: python -m pip install -e ".[all]"
84114
- name: Ensure Ray and Dask engines start up
85115
run: |
@@ -94,7 +124,7 @@ jobs:
94124
if: matrix.os == 'ubuntu'
95125

96126
test-internals:
97-
needs: [lint-flake8]
127+
needs: [lint-flake8, python-filter]
98128
runs-on: ubuntu-latest
99129
defaults:
100130
run:
@@ -105,6 +135,7 @@ jobs:
105135
- uses: ./.github/actions/mamba-env
106136
with:
107137
environment-file: environment-dev.yml
138+
python-version: ${{ needs.python-filter.outputs.python-version }}
108139
- name: Internals tests
109140
run: python -m pytest modin/tests/core/test_dispatcher.py
110141
- run: python -m pytest modin/tests/config
@@ -120,7 +151,7 @@ jobs:
120151
- uses: ./.github/actions/upload-coverage
121152

122153
test-defaults:
123-
needs: [lint-flake8]
154+
needs: [lint-flake8, python-filter]
124155
runs-on: ubuntu-latest
125156
defaults:
126157
run:
@@ -130,12 +161,13 @@ jobs:
130161
execution: [BaseOnPython]
131162
env:
132163
MODIN_TEST_DATASET_SIZE: "small"
133-
name: Test ${{ matrix.execution }} execution, Python 3.9
164+
name: Test ${{ matrix.execution }} execution, Python ${{ needs.python-filter.outputs.python-version }}"
134165
steps:
135166
- uses: actions/checkout@v4
136167
- uses: ./.github/actions/mamba-env
137168
with:
138169
environment-file: environment-dev.yml
170+
python-version: ${{ needs.python-filter.outputs.python-version }}
139171
- name: Install HDF5
140172
run: sudo apt update && sudo apt install -y libhdf5-dev
141173
- name: xgboost tests
@@ -240,15 +272,15 @@ jobs:
240272
"${{ steps.filter.outputs.ray }}" "${{ steps.filter.outputs.dask }}" >> $GITHUB_OUTPUT
241273
242274
test-all-unidist:
243-
needs: [lint-flake8, execution-filter]
275+
needs: [lint-flake8, execution-filter, python-filter]
244276
if: github.event_name == 'push' || needs.execution-filter.outputs.unidist == 'true'
245277
runs-on: ubuntu-latest
246278
defaults:
247279
run:
248280
shell: bash -l {0}
249281
strategy:
250282
matrix:
251-
python-version: ["3.9"]
283+
python-version: [ "${{ needs.python-filter.outputs.python-version }}" ]
252284
unidist-backend: ["mpi"]
253285
env:
254286
MODIN_ENGINE: "Unidist"
@@ -314,13 +346,13 @@ jobs:
314346
- uses: ./.github/actions/upload-coverage
315347

316348
test-all:
317-
needs: [lint-flake8, execution-filter]
349+
needs: [lint-flake8, execution-filter, python-filter]
318350
strategy:
319351
matrix:
320352
os:
321353
- ubuntu
322354
- windows
323-
python-version: ["3.9"]
355+
python-version: [ "${{ needs.python-filter.outputs.python-version }}" ]
324356
engine: ${{ fromJSON( github.event_name == 'push' && '["python", "ray", "dask"]' || needs.execution-filter.outputs.engines ) }}
325357
test_task:
326358
- group_1
@@ -446,14 +478,14 @@ jobs:
446478
if: matrix.os == 'windows'
447479

448480
test-sanity:
449-
needs: [lint-flake8, execution-filter]
481+
needs: [lint-flake8, execution-filter, python-filter]
450482
if: github.event_name == 'pull_request'
451483
strategy:
452484
matrix:
453485
os:
454486
- ubuntu
455487
- windows
456-
python-version: ["3.9"]
488+
python-version: [ "${{ needs.python-filter.outputs.python-version }}" ]
457489
execution:
458490
- name: ray
459491
shell-ex: "python -m pytest"
@@ -579,7 +611,7 @@ jobs:
579611
- uses: ./.github/actions/upload-coverage
580612

581613
test-experimental:
582-
needs: [lint-flake8]
614+
needs: [lint-flake8, python-filter]
583615
runs-on: ubuntu-latest
584616
defaults:
585617
run:
@@ -601,6 +633,7 @@ jobs:
601633
- uses: ./.github/actions/mamba-env
602634
with:
603635
environment-file: environment-dev.yml
636+
python-version: ${{ needs.python-filter.outputs.python-version }}
604637
- name: Install HDF5
605638
run: sudo apt update && sudo apt install -y libhdf5-dev
606639
- run: python -m pytest -n 2 modin/tests/pandas/dataframe/test_map_metadata.py
@@ -610,14 +643,14 @@ jobs:
610643
- uses: ./.github/actions/upload-coverage
611644

612645
test-spreadsheet:
613-
needs: [lint-flake8]
646+
needs: [lint-flake8, python-filter]
614647
runs-on: ubuntu-latest
615648
defaults:
616649
run:
617650
shell: bash -l {0}
618651
strategy:
619652
matrix:
620-
python-version: ["3.9"]
653+
python-version: [ "${{ needs.python-filter.outputs.python-version }}" ]
621654
engine: ["ray", "dask"]
622655
env:
623656
MODIN_EXPERIMENTAL: "True"
@@ -647,7 +680,7 @@ jobs:
647680
delete-merged: true
648681

649682
upload-coverage:
650-
needs: [merge-coverage-artifacts]
683+
needs: [merge-coverage-artifacts, python-filter]
651684
if: always() # we need to run it regardless of some job being skipped, like in PR
652685
runs-on: ubuntu-latest
653686
defaults:
@@ -656,6 +689,8 @@ jobs:
656689
steps:
657690
- uses: actions/checkout@v4
658691
- uses: ./.github/actions/python-only
692+
with:
693+
python-version: ${{ needs.python-filter.outputs.python-version }}
659694
- name: Download coverage data
660695
uses: actions/download-artifact@v4
661696
with:

modin/tests/pandas/test_series.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import datetime
1717
import itertools
1818
import json
19+
import sys
1920
import unittest.mock as mock
2021

2122
import matplotlib
@@ -4879,11 +4880,15 @@ def set_categories(ser):
48794880

48804881
# pandas 2.0.0: Removed setting Categorical.categories directly (GH47834)
48814882
# Just check the exception
4883+
expected_exception = AttributeError("can't set attribute")
4884+
if sys.version_info >= (3, 10):
4885+
# The exception message varies across different versions of Python
4886+
expected_exception = False
48824887
eval_general(
48834888
modin_series,
48844889
pandas_series,
48854890
set_categories,
4886-
expected_exception=AttributeError("can't set attribute"),
4891+
expected_exception=expected_exception,
48874892
)
48884893

48894894

0 commit comments

Comments
 (0)