-
Notifications
You must be signed in to change notification settings - Fork 95
140 lines (117 loc) · 4 KB
/
build.yml
File metadata and controls
140 lines (117 loc) · 4 KB
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
138
139
140
name: Python package
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
timeout-minutes: 30
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
# NOTE(stes): We test against the oldest still supported version of python (3.10),
# the python version of the latest Ubuntu LTS release (3.12)
# and the latest python version CEBRA supports fully (3.13).
#
# Python version chart:
# https://devguide.python.org/versions/
# Python Ubuntu LTS:
# https://documentation.ubuntu.com/ubuntu-for-developers/reference/availability/python/
python-version: ["3.10", "3.12", "3.13"]
# We aim to support the versions on pytorch.org
# as well as selected previous versions on
# https://pytorch.org/get-started/previous-versions/
torch-version: ["2.6.0", "2.10.0"]
sklearn-version: ["latest"]
numpy-version: ["latest"]
include:
# windows test with standard config
- os: windows-latest
torch-version: 2.6.0
python-version: "3.12"
sklearn-version: "latest"
numpy-version: "latest"
# legacy sklearn (several API differences)
- os: ubuntu-latest
torch-version: 2.6.0
python-version: "3.12"
sklearn-version: "legacy"
numpy-version: "latest"
- os: ubuntu-latest
torch-version: 2.6.0
python-version: "3.12"
sklearn-version: "latest"
numpy-version: "legacy"
# TODO(stes): latest torch and python
# requires a PyTables release compatible with
# python 3.14. Update when new version is released.
#- os: ubuntu-latest
# torch-version: 2.9.1
# python-version: "3.14"
# sklearn-version: "latest"
# legacy support
- os: ubuntu-latest
torch-version: 2.4.0
python-version: "3.10"
sklearn-version: "legacy"
numpy-version: "latest"
runs-on: ${{ matrix.os }}
env:
MPLBACKEND: Agg
steps:
- name: Cache dependencies
id: pip-cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-os_${{ runner.os }}-python_${{ matrix.python-version }}-torch_${{ matrix.torch-version }}-sklearn_${{ matrix.sklearn-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install package
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/cpu
pip install '.[dev,datasets,integrations]'
- name: Check sklearn legacy version
if: matrix.sklearn-version == 'legacy'
run: |
pip install scikit-learn==1.4.2 '.[dev,datasets,integrations]'
- name: Check numpy legacy version
if: matrix.numpy-version == 'legacy'
run: |
pip install "numpy<2" '.[dev,datasets,integrations]'
- name: Run the formatter
run: |
make format
- name: Run the spelling detector
run: |
make codespell
- name: Check the documentation coverage
run: |
make interrogate
- name: Check CITATION.cff validity
run: |
cffconvert --validate
- name: Check that no binary files have been added to repo
if: matrix.os == 'ubuntu-latest'
run: |
make check_for_binary
- name: Run pytest tests
timeout-minutes: 15
run: |
make test
- name: Build package
run: |
make build
- name: Check reinstall script
timeout-minutes: 10
run: |
./reinstall.sh