cheikhaidev-ui commited on
Commit ·
6277f27
1
Parent(s): a408d59
fix(ci): mock streamlit for headless CI, add missing dependencies
Browse files- fix(ci): add streamlit and plotly to pip install in ci.yml
- fix(tests): mock streamlit module before import to fix headless CI failure
- .github/workflows/ci.yml +3 -1
- tests/test_features.py +4 -0
.github/workflows/ci.yml
CHANGED
|
@@ -19,7 +19,9 @@ jobs:
|
|
| 19 |
python-version: "3.12"
|
| 20 |
|
| 21 |
- name: Install dependencies
|
| 22 |
-
run:
|
|
|
|
|
|
|
| 23 |
|
| 24 |
- name: Run tests
|
| 25 |
run: pytest tests/ -v
|
|
|
|
| 19 |
python-version: "3.12"
|
| 20 |
|
| 21 |
- name: Install dependencies
|
| 22 |
+
run: |
|
| 23 |
+
python -m pip install --upgrade pip
|
| 24 |
+
pip install pytest pandas numpy scikit-learn lightgbm streamlit plotly
|
| 25 |
|
| 26 |
- name: Run tests
|
| 27 |
run: pytest tests/ -v
|
tests/test_features.py
CHANGED
|
@@ -1,6 +1,10 @@
|
|
| 1 |
import sys
|
| 2 |
from pathlib import Path
|
| 3 |
from datetime import datetime
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
sys.path.insert(0, str(Path(__file__).parent.parent))
|
| 6 |
|
|
|
|
| 1 |
import sys
|
| 2 |
from pathlib import Path
|
| 3 |
from datetime import datetime
|
| 4 |
+
from unittest.mock import MagicMock
|
| 5 |
+
|
| 6 |
+
# Mock streamlit avant tout import pour le CI headless
|
| 7 |
+
sys.modules['streamlit'] = MagicMock()
|
| 8 |
|
| 9 |
sys.path.insert(0, str(Path(__file__).parent.parent))
|
| 10 |
|