Skip to content

Commit 603307a

Browse files
Merge pull request #8 from SilverLabUCL/restructure
pyNM restructure : separate GUI dependencies from core package
2 parents 7c4364b + 349b566 commit 603307a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1221
-214
lines changed

.github/workflows/tests-core.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Test Core (No GUI)
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
- development
9+
pull_request:
10+
branches:
11+
- master
12+
- main
13+
- development
14+
15+
jobs:
16+
test-core:
17+
name: Core Tests - Python ${{ matrix.python-version }} on ${{ matrix.os }}
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [ubuntu-latest, macos-latest, windows-latest]
23+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
33+
- name: Install core dependencies only
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install -e .
37+
pip install pytest pytest-cov
38+
39+
- name: Verify GUI not imported
40+
run: |
41+
python -c "import pyneuromatic; print('✓ Core imported successfully')"
42+
python -c "import sys; import pyneuromatic; assert 'PyQt6' not in sys.modules, 'PyQt6 should not be imported'"
43+
44+
- name: Run core tests
45+
run: |
46+
pytest tests/test_core/ tests/test_analysis/ -v --cov=pyneuromatic --cov-report=xml --cov-report=term -m "not gui"
47+
48+
- name: Upload coverage to Codecov
49+
uses: codecov/codecov-action@v3
50+
with:
51+
file: ./coverage.xml
52+
flags: core
53+
name: core-${{ matrix.os }}-${{ matrix.python-version }}
54+
continue-on-error: true
55+
56+
- name: Lint with flake8
57+
run: |
58+
pip install flake8
59+
flake8 pyneuromatic/core/ pyneuromatic/analysis/ --count --show-source --max-line-length=127 --statistics

.github/workflows/tests-gui.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Test GUI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
- development
9+
pull_request:
10+
branches:
11+
- master
12+
- main
13+
- development
14+
15+
jobs:
16+
test-gui:
17+
name: GUI Tests - Python ${{ matrix.python-version }}
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
python-version: ["3.9", "3.10", "3.11", "3.12"]
23+
24+
steps:
25+
- uses: actions/checkout@v3
26+
27+
- name: Set up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@v4
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Install system dependencies for Qt
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install -y \
36+
xvfb \
37+
libxkbcommon-x11-0 \
38+
libxcb-icccm4 \
39+
libxcb-image0 \
40+
libxcb-keysyms1 \
41+
libxcb-randr0 \
42+
libxcb-render-util0 \
43+
libxcb-xinerama0 \
44+
libxcb-xfixes0 \
45+
x11-utils
46+
47+
- name: Install GUI dependencies
48+
run: |
49+
python -m pip install --upgrade pip
50+
pip install -e ".[gui]"
51+
pip install pytest pytest-qt pytest-cov
52+
53+
- name: Verify GUI available
54+
run: |
55+
python -c "from pyneuromatic.gui import check_gui_available; check_gui_available(); print('✓ GUI dependencies available')"
56+
57+
- name: Run GUI tests with xvfb
58+
run: |
59+
xvfb-run -a pytest tests/test_gui/ -v --cov=pyneuromatic.gui --cov-report=xml --cov-report=term -m "gui or not core"
60+
61+
- name: Upload coverage to Codecov
62+
uses: codecov/codecov-action@v3
63+
with:
64+
file: ./coverage.xml
65+
flags: gui
66+
name: gui-${{ matrix.python-version }}
67+
continue-on-error: true

.gitignore

Lines changed: 165 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,171 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
13
*.pyc
2-
*.*~
3-
*.egg-info
4-
build
5-
dist
4+
*.py[cod]
5+
*$py.class
66

7-
.venv/
7+
# C extensions
8+
*.so
89

10+
# Distribution / packaging
11+
.Python
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.nox/
42+
.coverage
43+
.coverage.*
44+
.cache
45+
nosetests.xml
46+
coverage.xml
47+
*.cover
48+
*.py,cover
49+
.hypothesis/
50+
.pytest_cache/
51+
cover/
52+
53+
# Translations
54+
*.mo
55+
*.pot
56+
57+
# Django stuff:
58+
*.log
59+
local_settings.py
60+
db.sqlite3
61+
db.sqlite3-journal
62+
63+
# Flask stuff:
64+
instance/
65+
.webassets-cache
66+
67+
# Scrapy stuff:
68+
.scrapy
69+
70+
# Sphinx documentation
71+
docs/_build/
72+
docs/_static/
73+
docs/_templates/
74+
75+
# PyBuilder
76+
.pybuilder/
77+
target/
78+
79+
# Jupyter Notebook
80+
.ipynb_checkpoints
81+
82+
# IPython
83+
profile_default/
84+
ipython_config.py
85+
86+
# pyenv
87+
.python-version
88+
89+
# pipenv
90+
Pipfile.lock
91+
92+
# poetry
93+
poetry.lock
94+
95+
# pdm
96+
.pdm.toml
97+
98+
# PEP 582
99+
__pypackages__/
100+
101+
# Celery stuff
102+
celerybeat-schedule
103+
celerybeat.pid
104+
105+
# SageMath parsed files
106+
*.sage.py
107+
108+
# Environments
109+
.env
110+
.venv
111+
env/
112+
venv/
113+
ENV/
114+
env.bak/
115+
venv.bak/
116+
117+
# Spyder project settings
118+
.spyderproject
119+
.spyproject
120+
121+
# Rope project settings
122+
.ropeproject
123+
124+
# mkdocs documentation
125+
/site
126+
127+
# mypy
9128
.mypy_cache/
10-
/.coverage
129+
.dmypy.json
130+
dmypy.json
131+
132+
# Pyre type checker
133+
.pyre/
134+
135+
# pytype static type analyzer
136+
.pytype/
137+
138+
# Cython debug symbols
139+
cython_debug/
11140

141+
# IDEs
142+
.vscode/
143+
.idea/
144+
*.swp
145+
*.swo
146+
*~
147+
*.bak
148+
149+
# OS
12150
.DS_Store
151+
.DS_Store?
152+
._*
153+
.Spotlight-V100
154+
.Trashes
155+
ehthumbs.db
156+
Thumbs.db
157+
158+
# Project-specific
159+
data/
160+
results/
161+
logs/
162+
*.hdf5
163+
*.h5
164+
*.abf
165+
*.axgx
166+
*.dat
167+
168+
# Temporary files
169+
tmp/
170+
temp/
171+
*.tmp

0 commit comments

Comments
 (0)