Skip to content

Commit af00f18

Browse files
committed
Fix Python dependency management in CI workflows
- Add comprehensive requirements.txt with all necessary packages including pytest - Remove redundant package installations from CI workflows - Add package verification steps in CI for better debugging - Include testing, linting, and build dependencies in requirements.txt - Ensure consistent dependency management across all workflows Fixes CI failure: No module named pytest
1 parent b4f4778 commit af00f18

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ jobs:
3030
run: |
3131
python -m pip install --upgrade pip
3232
pip install -r requirements.txt
33-
# Install additional testing dependencies
34-
pip install pytest pytest-cov flake8
33+
echo "Python dependencies installed successfully"
34+
35+
# Verify key packages are installed
36+
python -c "import pytest; print('pytest version:', pytest.__version__)"
37+
python -c "import numpy; print('numpy version:', numpy.__version__)"
38+
python -c "import flake8; print('flake8 installed successfully')"
3539
3640
- name: Lint with flake8
3741
run: |
@@ -60,7 +64,6 @@ jobs:
6064
6165
- name: Generate coverage report
6266
run: |
63-
pip install coverage
6467
coverage run -m pytest tests/
6568
coverage xml
6669
@@ -87,7 +90,7 @@ jobs:
8790
- name: Install dependencies
8891
run: |
8992
python -m pip install --upgrade pip
90-
pip install build twine
93+
pip install -r requirements.txt
9194
9295
- name: Build package
9396
run: |

.github/workflows/docs.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,16 @@ jobs:
3434

3535
- name: Install Python dependencies
3636
run: |
37+
Write-Host "Installing Python dependencies..."
3738
python -m pip install --upgrade pip
3839
pip install -r requirements.txt
39-
pip install matplotlib seaborn pandas
40+
Write-Host "Python dependencies installed successfully"
41+
42+
# Verify key packages are installed
43+
python -c "import pytest; print('pytest version:', pytest.__version__)"
44+
python -c "import numpy; print('numpy version:', numpy.__version__)"
45+
python -c "import matplotlib; print('matplotlib version:', matplotlib.__version__)"
46+
Write-Host "Package verification completed"
4047
4148
- name: Install Doxygen and Graphviz
4249
run: |

requirements.txt

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
1+
# Core dependencies
12
numpy>=1.20.0
2-
matplotlib>=3.3.0
3+
matplotlib>=3.3.0
4+
5+
# Testing dependencies
6+
pytest>=6.0.0
7+
pytest-cov>=2.10.0
8+
unittest-xml-reporting>=3.0.0
9+
coverage>=5.0.0
10+
11+
# Data analysis and visualization
12+
seaborn>=0.11.0
13+
pandas>=1.3.0
14+
15+
# Code quality and linting
16+
flake8>=3.8.0
17+
18+
# Development and CI dependencies
19+
setuptools>=40.0.0
20+
wheel>=0.34.0
21+
build>=0.7.0
22+
twine>=3.4.0

0 commit comments

Comments
 (0)