Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI

on:
push:
pull_request:

env:
PY_COLORS: "1"

jobs:
ci:
name: Tests on Python ${{ matrix.python-version }}
runs-on: windows-latest

timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v7

- name: Install uv
uses: astral-sh/setup-uv@v8.3.2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync

- name: Run type checks
run: uv run poe typecheck

- name: Run core tests
run: uv run pytest tests/core

- name: Run wx integration tests
run: uv run pytest tests/wx_integration --cov-append

- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v7
with:
name: coverage-report-py${{ matrix.python-version }}
path: htmlcov/
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
//
// Misc ///////////////////////////////////////////////////////////////////
"files.exclude": {
".venv/": true,
"**/__pycache__": true,
"*.egg-info": true,
".pytest_cache": true
Expand Down
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ The preferred way to installation is via PyPI:
pip install construct-editor
```

## Tests
Unittests are in development and will be added by PR #40.

The following static type checkers are fully supported:
- [mypy](https://github.com/python/mypy)
- [pyright](https://github.com/microsoft/pyright)
- [ty](https://github.com/astral-sh/ty) (experimental, since ty itself is still in development)

## Development

This project uses `uv` as a project management tool. To set up your development environment, run the following command:
Expand All @@ -42,15 +34,14 @@ To run the unit tests, run:
```bash
uv run poe test
```
Note: Unittests are in development and will be added by PR #40. For now, this command is a placeholder and does nothing.

To run the linter/code formatter (including auto fix), run:

```bash
uv run poe lint
```

To run all supported type checkers, run:
To run all supported type checkers (currently [mypy](https://github.com/python/mypy), [pyright](https://github.com/microsoft/pyright) and [ty](https://github.com/astral-sh/ty)), run:

```bash
uv run poe typecheck
Expand Down
15 changes: 8 additions & 7 deletions construct_editor/core/context_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
import dataclasses
import typing as t

import construct_editor.core.construct_editor as construct_editor
import construct_editor.core.entries as entries
from construct_editor.core.model import (
ConstructEditorModel,
IntegerFormat,
)
from construct_editor.core.integer_format import IntegerFormat
from construct_editor.core.path import create_path_str

if t.TYPE_CHECKING:
import construct_editor.core.construct_editor as construct_editor
import construct_editor.core.entries as entries
from construct_editor.core.model import ConstructEditorModel

COPY_LABEL = "Copy"
PASTE_LABEL = "Paste"
Expand Down Expand Up @@ -163,7 +164,7 @@ def _init_list_viewed_entries(self):
def on_remove_list_viewed_item(checked: bool):
self.parent.disable_list_view(e)

label = entries.create_path_str(e.path)
label = create_path_str(e.path)
submenu.subitems.append(
CheckboxMenuItem(
label,
Expand Down
5 changes: 3 additions & 2 deletions construct_editor/core/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import construct_editor.core.entries as entries
import construct_editor.core.model as model
import construct_editor.core.preprocessor as preprocessor
from construct_editor.core.path import NameType


def add_custom_transparent_subconstruct(
Expand All @@ -34,7 +35,7 @@ def __init__(
model: model.ConstructEditorModel,
parent: entries.EntryConstruct | None,
construct: cs.Compressed[t.Any, t.Any],
name: entries.NameType,
name: NameType,
docs: str,
):
super().__init__(model, parent, construct, name, docs)
Expand Down Expand Up @@ -67,7 +68,7 @@ def __init__(
model: model.ConstructEditorModel,
parent: entries.EntryConstruct | None,
construct: cs.Subconstruct[t.Any, t.Any, t.Any, t.Any],
name: entries.NameType,
name: NameType,
docs: str,
):
super().__init__(model, parent, construct, name, docs)
Expand Down
Loading