forked from cleanlab/cleanlab
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (137 loc) · 4.21 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: CI
on:
push:
pull_request:
schedule:
- cron: '0 12 * * 1'
jobs:
test-windows:
name: "Test: Python ${{ matrix.python }} on windows"
runs-on: windows-latest
strategy:
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Download cleanvision test data
run: |
git clone https://github.com/cleanlab/assets.git
mv assets\cleanlab_test_data tests\datalab\data
- name: Install cleanlab
run: pip install -e ".[all]"
- name: Install development dependencies
run: pip install -r requirements-dev.txt
- name: Overwrite tensorflow version on Windows
run: |
pip uninstall -y tensorflow
pip install tensorflow-cpu<2.16
- name: Test with coverage
run: pytest --verbose --maxfail=3 --order-tests --cov=cleanlab/ --cov-config .coveragerc --cov-report=xml
env:
TEST_FASTTEXT: true
- uses: codecov/codecov-action@v3
test-macos-linux:
name: "Test: Python ${{ matrix.python }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-12
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Download cleanvision test data
run: |
git clone https://github.com/cleanlab/assets.git
mv assets/cleanlab_test_data ./tests/datalab/data
- name: Install cleanlab
run: pip install -e ".[all]"
- name: Install development dependencies
run: pip install -r requirements-dev.txt
- name: Install fasttext for non-Windows machines
run: |
pip install "fasttext==0.9.2"
- name: Test with coverage
run: pytest --verbose --maxfail=3 --order-tests --cov=cleanlab/ --cov-config .coveragerc --cov-report=xml
env:
TEST_FASTTEXT: true
- uses: codecov/codecov-action@v3
test-without-extras-min-versions:
name: Test without optional dependencies and with minimum compatible versions of dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install cleanlab
run: |
python -m pip install --upgrade pip
pip install .
- name: Install test dependencies
run: |
pip install pytest pipdeptree hypothesis
pipdeptree -j > deps.json
- name: Install minimum versions
run: |
python ./.github/get_min_dependencies.py
pip install -r requirements-min.txt
- name: Run tests
run: |
pytest tests/test_multilabel_classification.py tests/test_multiannotator.py tests/test_filter_count.py
typecheck:
name: Type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[all]" # install dependencies
pip install -r requirements-dev.txt # install development dependencies and type stubs
- name: Type check
run: mypy --install-types --non-interactive cleanlab
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
flake8:
name: Check for unused/wildcard imports
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install flake8
run: pip install flake8
- name: Lint with flake8
run: flake8 cleanlab tests
nblint:
name: Lint Notebooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cleanlab/nblint-action@v1
with:
directory: 'docs'