Skip to content

Commit 7f72795

Browse files
committed
Refactor GitHub Actions workflow: streamline dependency installation and add support for extracting project dependencies
1 parent 47b1e5f commit 7f72795

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/test_pyqt5.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ jobs:
3737
python -m pip install ruff pytest
3838
pip install PyQt5 setuptools numpy Cython
3939
python setup.py build_ext --inplace
40-
pip install .[test]
4140
if [ "${{ github.ref_name }}" = "develop" ]; then
4241
pip uninstall -y guidata PythonQwt
4342
cd ..
@@ -46,7 +45,16 @@ jobs:
4645
cd PlotPy
4746
pip install -e ../guidata
4847
pip install -e ../PythonQwt
49-
fi
48+
# Install tomli for TOML parsing (safe if already present)
49+
pip install tomli
50+
# Extract dependencies and save to file, then install
51+
python -c "import tomli; f=open('pyproject.toml','rb'); data=tomli.load(f); deps=[d for d in data['project']['dependencies'] if not any(p in d for p in ['guidata', 'PythonQwt'])]; open('deps.txt','w').write('\n'.join(deps))"
52+
pip install -r deps.txt
53+
# Install PlotPy without dependencies
54+
pip install --no-deps .
55+
else
56+
# Install from PyPI normally for main branch
57+
pip install .[test]
5058
- name: Lint with Ruff
5159
run: ruff check --output-format=github plotpy
5260
- name: Test with pytest

0 commit comments

Comments
 (0)