Skip to content

Commit cb5859d

Browse files
BeckettFreyCopilot
andauthored
Fix alignment button rendering, metadata updates, and dataset state (#84)
* fix: render View button in alignment action cells (#74) * Initial plan * fix: add layout.addWidget(view_btn) in _create_alignment_action_buttons Agent-Logs-Url: https://github.com/BrainBehaviorAnalyticsLab/voxkit-desktop/sessions/fd065a62-0e2c-4934-aae9-9420824c8957 Co-authored-by: BeckettFrey <83560790+BeckettFrey@users.noreply.github.com> * fix: correct alignment dict key references in _view_alignment --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: BeckettFrey <83560790+BeckettFrey@users.noreply.github.com> * fix: update_dataset_metadata handles partial update dicts without KeyError (#76) * Initial plan * fix: update_dataset_metadata handles partial update dicts without KeyError Agent-Logs-Url: https://github.com/BrainBehaviorAnalyticsLab/voxkit-desktop/sessions/26ca3ecd-bd76-4725-a6cc-05070880986d Co-authored-by: BeckettFrey <83560790+BeckettFrey@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: BeckettFrey <83560790+BeckettFrey@users.noreply.github.com> * Fix empty-state never shown on Datasets page (#77) * Initial plan * Fix empty-state bug in refresh_datasets: check metadata_list not the datasets module Agent-Logs-Url: https://github.com/BrainBehaviorAnalyticsLab/voxkit-desktop/sessions/9a9edc69-7179-41de-9459-9a6f265a0cf3 Co-authored-by: BeckettFrey <83560790+BeckettFrey@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: BeckettFrey <83560790+BeckettFrey@users.noreply.github.com> * fix: reload_models iterates all engines instead of hardcoding W2TGENGINE (#75) * Initial plan * fix: reload_models iterates all engines instead of hardcoding W2TGENGINE Agent-Logs-Url: https://github.com/BrainBehaviorAnalyticsLab/voxkit-desktop/sessions/003f14fe-b32d-4938-9a69-f6efc8a5087d Co-authored-by: BeckettFrey <83560790+BeckettFrey@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: BeckettFrey <83560790+BeckettFrey@users.noreply.github.com> * Batch ci fixes (#83) * lint: auto fixes applied * format: auto fixes applied * ci: all passing * typecheck: passing and issues resolved (no checking untyped defs for now) * ci: small fix for tests passing * fix: attach ci actions to makefile commands * ci: cut up testing into os dedicated workflows for visibility --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
1 parent 770212f commit cb5859d

49 files changed

Lines changed: 749 additions & 358 deletions

Some content is hidden

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

.github/workflows/tests-macos.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Tests (macOS)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
test:
16+
runs-on: macos-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Python 3.11
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.11'
26+
27+
- name: Install uv
28+
run: |
29+
curl -LsSf https://astral.sh/uv/install.sh | sh
30+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
31+
shell: bash
32+
33+
- name: Configure Git for private repos
34+
run: |
35+
git config --global url."https://x-access-token:${{ secrets.PRIVATE_REPO_TOKEN }}@github.com/".insteadOf "https://github.com/"
36+
37+
- name: Install dependencies
38+
run: |
39+
uv sync
40+
41+
- name: Run tests
42+
run: |
43+
make run-tests
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tests
1+
name: Tests (Ubuntu)
22

33
on:
44
push:
@@ -13,48 +13,41 @@ permissions:
1313

1414
jobs:
1515
test:
16-
runs-on: ${{ matrix.os }}
17-
strategy:
18-
fail-fast: false
19-
matrix:
20-
os: [ubuntu-latest, macos-latest, windows-latest]
21-
python-version: ['3.11']
22-
16+
runs-on: ubuntu-latest
17+
2318
steps:
2419
- name: Checkout code
2520
uses: actions/checkout@v4
26-
27-
- name: Set up Python ${{ matrix.python-version }}
21+
22+
- name: Set up Python 3.11
2823
uses: actions/setup-python@v5
2924
with:
30-
python-version: ${{ matrix.python-version }}
31-
25+
python-version: '3.11'
26+
3227
- name: Install uv
3328
run: |
3429
curl -LsSf https://astral.sh/uv/install.sh | sh
3530
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
3631
shell: bash
37-
32+
3833
- name: Configure Git for private repos
3934
run: |
4035
git config --global url."https://x-access-token:${{ secrets.PRIVATE_REPO_TOKEN }}@github.com/".insteadOf "https://github.com/"
41-
36+
4237
- name: Install dependencies
4338
run: |
4439
uv sync
45-
40+
4641
- name: Run tests
4742
run: |
48-
uv run pytest src/voxkit/storage/test/ -v --tb=short
49-
50-
- name: Run linting (Ubuntu only)
51-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
43+
make run-tests
44+
45+
- name: Run linting
5246
run: |
53-
uv run ruff check src/
47+
make lint-check
5448
continue-on-error: true
55-
56-
- name: Run type checking (Ubuntu only)
57-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
49+
50+
- name: Run type checking
5851
run: |
59-
uv run mypy src/
52+
make mypy-check
6053
continue-on-error: true
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Tests (Windows)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
test:
16+
runs-on: windows-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Python 3.11
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.11'
26+
27+
- name: Install uv
28+
run: |
29+
curl -LsSf https://astral.sh/uv/install.sh | sh
30+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
31+
shell: bash
32+
33+
- name: Configure Git for private repos
34+
run: |
35+
git config --global url."https://x-access-token:${{ secrets.PRIVATE_REPO_TOKEN }}@github.com/".insteadOf "https://github.com/"
36+
37+
- name: Install dependencies
38+
run: |
39+
uv sync
40+
41+
- name: Run tests
42+
run: |
43+
make run-tests

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
</p>
1010

1111
<p align="center">
12-
<a href="https://github.com/BrainBehaviorAnalyticsLab/PyPLLR_GUI/actions/workflows/tests.yml"><img src="https://img.shields.io/github/actions/workflow/status/BrainBehaviorAnalyticsLab/PyPLLR_GUI/tests.yml?branch=main&label=Tests&style=flat-square" alt="Tests"></a>
12+
<a href="https://github.com/BrainBehaviorAnalyticsLab/PyPLLR_GUI/actions/workflows/tests-ubuntu.yml"><img src="https://img.shields.io/github/actions/workflow/status/BrainBehaviorAnalyticsLab/PyPLLR_GUI/tests-ubuntu.yml?branch=main&label=Ubuntu&logo=ubuntu&style=flat-square" alt="Ubuntu Tests"></a>
13+
<a href="https://github.com/BrainBehaviorAnalyticsLab/PyPLLR_GUI/actions/workflows/tests-macos.yml"><img src="https://img.shields.io/github/actions/workflow/status/BrainBehaviorAnalyticsLab/PyPLLR_GUI/tests-macos.yml?branch=main&label=macOS&logo=apple&style=flat-square" alt="macOS Tests"></a>
14+
<a href="https://github.com/BrainBehaviorAnalyticsLab/PyPLLR_GUI/actions/workflows/tests-windows.yml"><img src="https://img.shields.io/github/actions/workflow/status/BrainBehaviorAnalyticsLab/PyPLLR_GUI/tests-windows.yml?branch=main&label=Windows&logo=windows&style=flat-square" alt="Windows Tests"></a>
1315
<a href="https://github.com/BrainBehaviorAnalyticsLab/PyPLLR_GUI/actions/workflows/code-quality.yml"><img src="https://img.shields.io/github/actions/workflow/status/BrainBehaviorAnalyticsLab/PyPLLR_GUI/code-quality.yml?branch=main&label=Code%20Quality&style=flat-square" alt="Code Quality"></a>
1416
<a href="https://voxkit.atlassian.net/jira/software/projects/VOX/boards/2/"><img src="https://img.shields.io/badge/Project-Jira-0052CC?logo=jira&style=flat-square" alt="Jira"></a>
1517
</p>

_frozen_patch.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
if getattr(sys, "frozen", False):
88
# We're running in a PyInstaller bundle
99
print("[PATCH] Applying frozen app patches...")
10-
10+
1111
# Patch 1: Disable typeguard runtime checking
1212
try:
1313
import typeguard
14-
14+
1515
# Replace typechecked decorator with a no-op
1616
def _noop_decorator(func=None, **kwargs):
1717
"""No-op decorator that just returns the function unchanged"""
@@ -20,12 +20,12 @@ def _noop_decorator(func=None, **kwargs):
2020
return lambda f: f
2121
# Called without arguments: @typechecked
2222
return func
23-
24-
typeguard.typechecked = _noop_decorator
23+
24+
typeguard.typechecked = _noop_decorator # type: ignore[assignment]
2525
print("[PATCH] Disabled typeguard runtime checking")
2626
except ImportError:
2727
pass
28-
28+
2929
# Patch 2: Fix inspect.getsource to not fail in frozen apps
3030
import inspect
3131

@@ -70,7 +70,7 @@ def _patched_getsourcefile(object):
7070
try:
7171
result = _original_getsourcefile(object)
7272
# Check if the file actually exists
73-
if result and not __import__('os').path.exists(result):
73+
if result and not __import__("os").path.exists(result):
7474
return None
7575
return result
7676
except (OSError, TypeError):

hooks/hook-nltk.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66

77
# Don't collect any NLTK data files - they will be downloaded at runtime
8-
datas = []
8+
datas: list[tuple[str, str, str]] = []
99

1010
# Exclude data collection
11-
excludedimports = []
11+
excludedimports: list[str] = []

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ dev = [
4141
"pre-commit>=4.3.0",
4242
"ruff>=0.14.0",
4343
"mypy>=1.18.2",
44+
"types-PyYAML>=6.0.0",
4445
"genbadge[coverage]>=1.1.3",
4546
]
4647
docs = [
@@ -109,11 +110,15 @@ indent-style = "space"
109110
[tool.mypy]
110111
python_version = "3.11"
111112
ignore_missing_imports = true
113+
check_untyped_defs = false
114+
warn_return_any = true
115+
warn_unused_configs = true
112116
exclude = [
113117
"main.py",
114118
"build.py",
115119
"example_startup_script.py",
116-
"test_imports.py"
120+
"test_imports.py",
121+
"tests/"
117122
]
118123

119124

src/voxkit/analyzers/default_analyzer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ def paintEvent(self, event):
125125

126126
color = QColor("#3498db")
127127
h, s, lightness, a = color.getHsl()
128+
assert (
129+
h is not None and s is not None and lightness is not None and a is not None
130+
)
128131
ratio = count / max_count
129132
new_l = int(lightness + (220 - lightness) * (1 - ratio))
130133
color.setHsl(h, s, min(new_l, 240), a)

src/voxkit/config.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from voxkit.services.mfa import download_acoustic_model
55
from voxkit.storage import models
66
from voxkit.storage.config import MODELS_ROOT
7-
from voxkit.storage.models import download_and_copy_huggingface_model
87
from voxkit.storage.utils import get_storage_root
98

109
AppName = "VoxKit"
@@ -94,10 +93,10 @@ def startup_routine():
9493
# else:
9594
# print("[STARTUP] Failed to download W2TG model.")
9695

97-
9896
try:
9997
import nltk
100-
nltk.download('averaged_perceptron_tagger_eng')
98+
99+
nltk.download("averaged_perceptron_tagger_eng")
101100

102101
except Exception as e:
103102
print(f"[STARTUP] Failed to download NLTK resources. Error: {e}")

src/voxkit/config/startup_config.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def startup_routine():
4949
if not success:
5050
print(f"[STARTUP] Failed to create model metadata for {model}. {metadata}")
5151
continue
52+
assert not isinstance(metadata, str)
5253
model_dest = metadata.get("model_path")
5354
if not model_dest:
5455
print(f"[STARTUP] Model path not found in metadata for {model}.")
@@ -81,6 +82,7 @@ def startup_routine():
8182
if not success:
8283
print(f"[STARTUP] Failed to create model metadata. {metadata}")
8384
return
85+
assert not isinstance(metadata, str)
8486
model_dest = metadata.get("model_path")
8587
if not model_dest:
8688
print("[STARTUP] Model path not found in metadata.")
@@ -94,10 +96,10 @@ def startup_routine():
9496
else:
9597
print("[STARTUP] Failed to download W2TG model.")
9698

97-
9899
try:
99100
import nltk
100-
nltk.download('averaged_perceptron_tagger_eng')
101+
102+
nltk.download("averaged_perceptron_tagger_eng")
101103

102104
except Exception as e:
103105
print(f"[STARTUP] Failed to download NLTK resources. Error: {e}")

0 commit comments

Comments
 (0)