From 08fc503f686660cadb09a324cda5be69c5801900 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Sat, 8 Feb 2025 18:11:08 +0100 Subject: [PATCH] Add scaffolding for Python API docs --- api/python/.gitignore | 1 + api/python/pyproject.toml | 6 ++++++ api/python/slint/__init__.py | 10 ++++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/api/python/.gitignore b/api/python/.gitignore index 994ffc93b..28862627e 100644 --- a/api/python/.gitignore +++ b/api/python/.gitignore @@ -1 +1,2 @@ slint/*.so +uv.lock diff --git a/api/python/pyproject.toml b/api/python/pyproject.toml index 7fb366bf5..74f9bfac4 100644 --- a/api/python/pyproject.toml +++ b/api/python/pyproject.toml @@ -40,3 +40,9 @@ Tracker = "https://github.com/slint-ui/slint/issues" [project.optional-dependencies] dev = ["pytest"] + +[dependency-groups] +dev = [ + "pdoc>=15.0.1", + "pytest>=8.3.4", +] diff --git a/api/python/slint/__init__.py b/api/python/slint/__init__.py index 673844a19..baa8f7724 100644 --- a/api/python/slint/__init__.py +++ b/api/python/slint/__init__.py @@ -1,6 +1,10 @@ # Copyright © SixtyFPS GmbH # SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 +r''' +.. include:: ../README.md +''' + from importlib.machinery import ModuleSpec import os import sys @@ -311,7 +315,6 @@ def callback(global_name=None, name=None): Image = native.PyImage Color = native.PyColor Brush = native.PyBrush -Model = native.PyModelBase ListModel = models.ListModel Model = models.Model Timer = native.Timer @@ -319,4 +322,7 @@ TimerMode = native.TimerMode Struct = native.PyStruct def set_xdg_app_id(app_id: str): - native.set_xdg_app_id(app_id) \ No newline at end of file + native.set_xdg_app_id(app_id) + +__all__ = ["CompileError", "Component", "load_file", "loader", "Image", "Color", + "Brush", "Model", "ListModel", "Timer", "TimerMode", "set_xdg_app_id"]