@@ -10,132 +10,122 @@ jobs:
1010 runs-on : ubuntu-latest
1111 steps :
1212 - name : " Clone repository"
13- uses : actions/checkout@v4
13+ uses : actions/checkout@v6
1414
15- - name : " Set up Python 3.10 "
16- uses : actions/setup-python@v5
15+ - name : " Set up Python 3.11 "
16+ uses : actions/setup-python@v6
1717 with :
18- python-version : ' 3.10'
18+ python-version : ' 3.11'
19+
20+ - name : " Install uv"
21+ uses : astral-sh/setup-uv@v8.1.0
22+ with :
23+ version : " 0.11.7"
24+ python-version : ' 3.11'
1925
2026 - name : " Install Dev Dependencies"
2127 run : |
22- python -m pip install --upgrade pip
23- pip install -r requirements/ dev.txt
28+ # Testing against latest compatible versions
29+ uv sync --group dev
2430
2531 - name : " Lint"
2632 run : |
27- pre-commit run --all-files
28-
33+ uv run pre-commit run --all-files
2934
3035 tests :
3136 runs-on : ${{ matrix.os }}
3237 strategy :
3338 matrix :
3439 os : [macos-14, ubuntu-latest]
35- python-version : ['3.10 ']
40+ python-version : ['3.11 ']
3641 flavour : ['all']
3742
3843 steps :
3944 - name : " Clone repository"
40- uses : actions/checkout@v4
45+ uses : actions/checkout@v6
4146
4247 - name : " Set up Python ${{ matrix.python-version }}"
43- uses : actions/setup-python@v5
48+ uses : actions/setup-python@v6
4449 with :
4550 python-version : ${{ matrix.python-version }}
4651
47- # use `uv` to retrieve the latest dependency versions
48- - name : " Compile Dependency Versions"
49- run : |
50- curl -LsSf https://astral.sh/uv/install.sh | sh
51- uv pip compile requirements/dev-all.txt requirements/optional.txt > requirements-latest.txt
52-
53- - name : " Cache python environment"
54- uses : actions/cache@v4
55- id : pythonenv-cache
52+ - name : " Install uv"
53+ uses : astral-sh/setup-uv@v8.1.0
5654 with :
57- path : ${{ env.pythonLocation }}
58- key : ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements/*.txt', 'requirements-latest.txt') }}
59-
60- - name : " Setup Pip"
61- run : |
62- python -m pip install --upgrade pip
55+ version : " 0.11.7"
56+ enable-cache : true
57+ python-version : ${{ matrix.python-version }}
6358
6459 - name : " Install Dependencies"
6560 run : |
66- # install latest dependencies (potentially updating cached dependencies)
67- pip install -U -r requirements/dev-all.txt -r requirements/optional.txt
61+ # Testing against latest compatible versions
62+ # dev-all group includes everything: dev, optional, release, torch, notorch
63+ # --group torch-cpu uses CPU-only PyTorch from the configured index
64+ uv sync --group dev-all --group torch-cpu
6865
6966 - name : " Install libomp (for LightGBM)"
7067 run : |
7168 chmod +x ./.github/scripts/libomp-${{ runner.os }}.sh
7269 ./.github/scripts/libomp-${{ runner.os }}.sh
7370
74- - name : " Install Darts Locally"
75- run : |
76- pip install .
77-
7871 - name : " Run tests"
7972 run : |
80- pytest --durations=50 --cov=darts --cov-config=.coveragerc --cov-report=xml darts/tests
73+ uv run pytest --durations=50 --timeout=900 --cov=darts --cov-config=.coveragerc --cov-report=xml darts/tests
8174
8275 - name : " Codecov upload"
8376 if : ${{ matrix.flavour == 'all' }}
84- uses : codecov/codecov-action@v4
77+ uses : codecov/codecov-action@v6
8578 with :
8679 fail_ci_if_error : true
8780 token : ${{ secrets.CODECOV_TOKEN }}
8881
82+ - name : " Optimize cache for CI"
83+ run : |
84+ # Remove pre-built wheels but keep source-built wheels
85+ # This reduces cache size while retaining expensive-to-rebuild packages
86+ uv cache prune --ci
87+
8988 docs :
9089 runs-on : ubuntu-latest
9190 steps :
9291 - name : " Clone repository"
93- uses : actions/checkout@v4
92+ uses : actions/checkout@v6
9493
95- - name : " Set up Python 3.10 "
96- uses : actions/setup-python@v5
94+ - name : " Set up Python 3.11 "
95+ uses : actions/setup-python@v6
9796 with :
98- python-version : ' 3.10'
99-
100- # use `uv` to retrieve the latest dependency versions
101- - name : " Compile Dependency Versions"
102- run : |
103- curl -LsSf https://astral.sh/uv/install.sh | sh
104- uv pip compile requirements/dev-all.txt requirements/optional.txt > requirements-latest.txt
97+ python-version : ' 3.11'
10598
106- # only restore cache but do not upload
107- - name : " Restore cached python environment"
108- uses : actions/cache/restore@v4
109- id : pythonenv-cache
99+ - name : " Install uv"
100+ uses : astral-sh/setup-uv@v8.1.0
110101 with :
111- path : ${{ env.pythonLocation }}
112- key : ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements/*.txt', 'requirements-latest.txt') }}
102+ version : " 0.11.7"
103+ enable-cache : true
104+ python-version : ' 3.11'
113105
114106 - name : " Install pandoc"
115107 run : |
116108 sudo apt-get install -y pandoc
117109
118- - name : " Setup Pip"
119- run : |
120- python -m pip install --upgrade pip
121-
122110 - name : " Install Dependencies"
123111 run : |
124- # install latest dependencies (potentially updating cached dependencies)
125- pip install -U -r requirements/ dev-all.txt -r requirements/optional.txt
112+ # Testing against latest compatible versions
113+ uv sync --group dev-all --group torch-cpu
126114
127115 - name : " Install libomp (for LightGBM)"
128116 run : |
129117 chmod +x ./.github/scripts/libomp-${{ runner.os }}.sh
130118 ./.github/scripts/libomp-${{ runner.os }}.sh
131119
132- - name : " Install Darts Locally "
120+ - name : " Build docs "
133121 run : |
134- pip install .
122+ uv run make --directory ./docs build-all-docs
135123
136- - name : " Build docs "
124+ - name : " Optimize cache for CI "
137125 run : |
138- make --directory ./docs build-all-docs
126+ # Remove pre-built wheels but keep source-built wheels
127+ # This reduces cache size while retaining expensive-to-rebuild packages
128+ uv cache prune --ci
139129
140130 check-examples :
141131 runs-on : ubuntu-latest
@@ -144,46 +134,37 @@ jobs:
144134 example-name : [03-FFT-examples.ipynb, 04-RNN-examples.ipynb, 00-quickstart.ipynb, 02-data-processing.ipynb, 01-multi-time-series-and-covariates.ipynb]
145135 steps :
146136 - name : " Clone repository"
147- uses : actions/checkout@v4
137+ uses : actions/checkout@v6
148138
149- - name : " Set up Python 3.10 "
150- uses : actions/setup-python@v5
139+ - name : " Set up Python 3.11 "
140+ uses : actions/setup-python@v6
151141 with :
152- python-version : ' 3.10'
153-
154- # use `uv` to retrieve the latest dependency versions
155- - name : " Compile Dependency Versions"
156- run : |
157- curl -LsSf https://astral.sh/uv/install.sh | sh
158- uv pip compile requirements/dev-all.txt requirements/optional.txt > requirements-latest.txt
142+ python-version : ' 3.11'
159143
160- # only restore cache but do not upload
161- - name : " Restore cached python environment"
162- uses : actions/cache/restore@v4
163- id : pythonenv-cache
144+ - name : " Install uv"
145+ uses : astral-sh/setup-uv@v8.1.0
164146 with :
165- path : ${{ env.pythonLocation }}
166- key : ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements/*.txt', 'requirements-latest.txt') }}
167-
168- - name : " Setup Pip"
169- run : |
170- python -m pip install --upgrade pip
147+ version : " 0.11.7"
148+ enable-cache : true
149+ python-version : ' 3.11'
171150
172151 - name : " Install Dependencies"
173152 run : |
174- # install latest dependencies (potentially updating cached dependencies)
175- pip install -U -r requirements/ dev-all.txt -r requirements/optional.txt
153+ # Testing against latest compatible versions
154+ uv sync --group dev-all --group torch-cpu
176155
177156 - name : " Install libomp (for LightGBM)"
178157 run : |
179158 chmod +x ./.github/scripts/libomp-${{ runner.os }}.sh
180159 ./.github/scripts/libomp-${{ runner.os }}.sh
181160
182- - name : " Install Darts Locally"
183- run : |
184- pip install .
185-
186161 - name : " Run example ${{matrix.example-name}}"
187162 working-directory : ./examples
188163 run : |
189- papermill ${{matrix.example-name}} ${{matrix.example-name}}
164+ uv run papermill ${{matrix.example-name}} ${{matrix.example-name}}
165+
166+ - name : " Optimize cache for CI"
167+ run : |
168+ # Remove pre-built wheels but keep source-built wheels
169+ # This reduces cache size while retaining expensive-to-rebuild packages
170+ uv cache prune --ci
0 commit comments