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
4 changes: 4 additions & 0 deletions binding/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""LVGL binding generator: preprocess → analyze → emit (.c and .pyi)."""
4 changes: 4 additions & 0 deletions binding/analyze.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Walk preprocessed C AST; build func/object/enum/struct metadata for emit."""
from __future__ import print_function

Expand Down
4 changes: 4 additions & 0 deletions binding/api_model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Target-neutral public API model built from the declaration IR.

This module describes the API independently of any C runtime or binding
Expand Down
4 changes: 4 additions & 0 deletions binding/api_policy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Auditable visibility and target-availability policy for the API model."""

from __future__ import annotations
Expand Down
4 changes: 4 additions & 0 deletions binding/api_report.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Report canonical API inventory, target parity, and baseline compatibility.

The report is deliberately observational. It validates the canonical model,
Expand Down
4 changes: 4 additions & 0 deletions binding/artifacts.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Hash and compare generated binding artifacts."""

from __future__ import annotations
Expand Down
4 changes: 4 additions & 0 deletions binding/context.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Per-generation BindingContext; synced into runtime for analyze/emit."""
from __future__ import print_function

Expand Down
4 changes: 4 additions & 0 deletions binding/emit_backend.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Shared setup for target C-lowering runs.

The individual emitters own VM-specific C output. This module owns only the
Expand Down
4 changes: 4 additions & 0 deletions binding/emit_c_cpython.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Main CPython emit loop (PyObject* API); calls cpython_glue and cpython_native."""
from __future__ import print_function

Expand Down
4 changes: 4 additions & 0 deletions binding/emit_c_micropython_style.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Main MP-style C emitter (mp_obj_t API); used by MicroPython and CircuitPython."""
from __future__ import print_function

Expand Down
4 changes: 4 additions & 0 deletions binding/emit_circuitpython.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""CircuitPython target entry: analyze → emit_c_micropython_style (target=circuitpython)."""

from __future__ import print_function
Expand Down
4 changes: 4 additions & 0 deletions binding/emit_circuitpython_glue.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""CircuitPython bookends: phase-2 enums and LVCP_MODULE_GLOBALS module table."""
from __future__ import print_function

Expand Down
4 changes: 4 additions & 0 deletions binding/emit_cpython.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""CPython target entry: analyze → emit_c_cpython."""

from __future__ import print_function
Expand Down
4 changes: 4 additions & 0 deletions binding/emit_cpython_glue.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""CPython bookends: phase-2 enum types and PyInit_lvgl / module registration."""
from __future__ import print_function

Expand Down
4 changes: 4 additions & 0 deletions binding/emit_cpython_native.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""CPython body codegen (phases 3–7): funcs, objects, structs, and callbacks."""

from __future__ import print_function
Expand Down
4 changes: 4 additions & 0 deletions binding/emit_micropython.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""MicroPython target entry: analyze → emit_c_micropython_style."""
from __future__ import print_function

Expand Down
4 changes: 4 additions & 0 deletions binding/emit_pyi.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Generate the shared lvgl.pyi from the canonical API model."""

from __future__ import annotations
Expand Down
4 changes: 4 additions & 0 deletions binding/emit_pyi_canonical.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Emit the shared ``lvgl.pyi`` from the canonical API model."""

from __future__ import annotations
Expand Down
4 changes: 4 additions & 0 deletions binding/generate.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Unified command for generating all LVGL binding artifacts."""

from __future__ import annotations
Expand Down
4 changes: 4 additions & 0 deletions binding/generator.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Shared analysis and target-backend orchestration."""

from __future__ import print_function
Expand Down
6 changes: 5 additions & 1 deletion binding/helpers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Shared identifier sanitization, LVGL patterns, and export_name helpers."""
from __future__ import print_function

Expand All @@ -11,7 +15,7 @@

# Prevent identifier names which are Python reserved words (add underscore in such case)
def export_name(name, kind):
"""Delegate to :mod:`binding.naming` for Python export identifiers."""
"""Delegate to `binding.naming` for Python export identifiers."""
from .naming import export_name as _export_name

return _export_name(name, kind)
Expand Down
6 changes: 5 additions & 1 deletion binding/ir.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Target-neutral C declaration intermediate representation.

The IR deliberately contains declarations only. Target runtime policy,
Expand Down Expand Up @@ -176,7 +180,7 @@ def callback_typedefs(self) -> Mapping[str, CType]:

@dataclass(frozen=True)
class DeclarationIndex:
"""Read-only indexes and relationship queries over :class:`DeclarationIR`."""
"""Read-only indexes and relationship queries over `DeclarationIR`."""

ir: DeclarationIR
functions_by_name: Mapping[str, CFunction]
Expand Down
4 changes: 4 additions & 0 deletions binding/naming.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Established upstream-compatible Python export names."""

from __future__ import annotations
Expand Down
4 changes: 4 additions & 0 deletions binding/parse.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Low-level pycparser AST helpers used by analyze and emit."""
from __future__ import print_function

Expand Down
4 changes: 4 additions & 0 deletions binding/preprocess.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Deterministic C preprocessing used by the binding generator."""

from __future__ import print_function
Expand Down
4 changes: 4 additions & 0 deletions binding/runtime.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Context-local state access for one binding generation run."""
from __future__ import print_function

Expand Down
4 changes: 4 additions & 0 deletions binding/runtime_exports.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Select the canonical module-function surface for native registration."""

from __future__ import print_function
Expand Down
4 changes: 4 additions & 0 deletions binding/util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Small utilities: memoize and stderr logging for analyze/emit."""
from __future__ import print_function

Expand Down
4 changes: 4 additions & 0 deletions binding/verify_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Validate the generated target-neutral API model and its content hash."""

from __future__ import annotations
Expand Down
4 changes: 4 additions & 0 deletions binding/verify_namespace.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Verify every native module namespace against the canonical API model."""
from __future__ import print_function

Expand Down
4 changes: 4 additions & 0 deletions binding/verify_pyi.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Validate a generated pyi against the canonical API manifest."""

from __future__ import annotations
Expand Down
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Sphinx configuration for the LVGL documentation.

Everything shared by the PyDevices documentation projects (theme, top bar,
Expand Down
4 changes: 4 additions & 0 deletions ports/circuitpython/manifest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

# Frozen Python helpers that ship with the LVGL CircuitPython integration:
# fs_driver.py, kept once at the root of this repository in python/. LVGL's
# PyDevices coordinator, display_driver.py, ships with pydevices (lib/): put
Expand Down
4 changes: 4 additions & 0 deletions ports/circuitpython/tests/test_circuitpython_port.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

from pathlib import Path


Expand Down
4 changes: 4 additions & 0 deletions ports/circuitpython/tests/test_lvgl_jpeg_decode.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""lv.image decodes jpegio's corpus on CircuitPython through the jpegio decoder shim.

The CircuitPython half of jpegio's LVGL decoder: LVGL's
Expand Down
4 changes: 4 additions & 0 deletions ports/micropython/manifest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

# Frozen Python helpers that ship with the LVGL MicroPython usermod: fs_driver.py,
# kept once at the root of this repository in python/. LVGL's PyDevices
# coordinator, display_driver.py, ships with pydevices (lib/).
Expand Down
4 changes: 4 additions & 0 deletions ports/micropython/tests/test_gc_finaliser_flag.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""LVGL's allocations must not be flagged as having MicroPython finalisers.

``gc_alloc()``'s second argument is ``alloc_flags``, and 1 is
Expand Down
4 changes: 4 additions & 0 deletions ports/micropython/tests/test_micropython_port.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

from pathlib import Path


Expand Down
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Build the lvgl CPython extension (generated/lvgl_python.c + LVGL sources).

It sits at the repository root, not in ports/cpython/, because the wheel
Expand Down
4 changes: 4 additions & 0 deletions tests/test_api_model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

from binding.api_model import api_hash_for_dict, build_api_model
from binding.ir import parse_source

Expand Down
4 changes: 4 additions & 0 deletions tests/test_api_policy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

from pathlib import Path

from binding.api_model import build_api_model
Expand Down
4 changes: 4 additions & 0 deletions tests/test_api_report.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

from pathlib import Path

import pytest
Expand Down
4 changes: 4 additions & 0 deletions tests/test_cpython_callback_references.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Every CPython callback trampoline owns what it touches during the call.

A trampoline looks the Python callback up in a callback dict, which gives a
Expand Down
4 changes: 4 additions & 0 deletions tests/test_cpython_gil_declaration.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""The generated CPython module declares that it doesn't need the GIL.

On a free-threaded build (3.13t and later) importing an extension that
Expand Down
4 changes: 4 additions & 0 deletions tests/test_generation_tools.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

from __future__ import annotations

import shutil
Expand Down
4 changes: 4 additions & 0 deletions tests/test_ir.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

from binding.ir import DeclarationIndex, parse_source


Expand Down
4 changes: 4 additions & 0 deletions tests/test_nesting_export.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""The generated MicroPython and CircuitPython modules export ``lv._nesting``.

``_nesting`` is not an LVGL declaration: it is a binding-internal callback
Expand Down
Loading
Loading