Skip to content

Commit

Permalink
Create an app module using the old python format, which pyinstaller n…
Browse files Browse the repository at this point in the history
…eeds to detect the packages.

Update pyright to ignore build directory

Overall: this should fix the app builds
  • Loading branch information
scosman committed Sep 30, 2024
1 parent 5552341 commit 29b15d4
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

Coming soon...

| | |
| --- | --- |
| CI | [![Build and Test](https://github.com/Kiln-AI/kiln/actions/workflows/build_and_test.yml/badge.svg)](https://github.com/Kiln-AI/kiln/actions/workflows/build_and_test.yml) [![Format and Lint](https://github.com/Kiln-AI/kiln/actions/workflows/format_and_lint.yml/badge.svg)](https://github.com/Kiln-AI/kiln/actions/workflows/format_and_lint.yml) [![Desktop Apps Build](https://github.com/Kiln-AI/kiln/actions/workflows/build_desktop.yml/badge.svg)](https://github.com/Kiln-AI/kiln/actions/workflows/build_desktop.yml) [![Web UI Build](https://github.com/Kiln-AI/kiln/actions/workflows/web_format_lint_build.yml/badge.svg)](https://github.com/Kiln-AI/kiln/actions/workflows/web_format_lint_build.yml)
| Package | [![PyPI - Version](https://img.shields.io/pypi/v/kiln-ai.svg?logo=pypi&label=PyPI&logoColor=gold)](https://pypi.org/project/kiln-ai/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/kiln-ai.svg?logo=python&label=Python&logoColor=gold)](https://pypi.org/project/kiln-ai/)
| Meta | [![linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/) [![types - Mypy](https://img.shields.io/badge/types-pyright-blue.svg)](https://github.com/microsoft/pyright) |
| | |
| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| CI | [![Build and Test](https://github.com/Kiln-AI/kiln/actions/workflows/build_and_test.yml/badge.svg)](https://github.com/Kiln-AI/kiln/actions/workflows/build_and_test.yml) [![Format and Lint](https://github.com/Kiln-AI/kiln/actions/workflows/format_and_lint.yml/badge.svg)](https://github.com/Kiln-AI/kiln/actions/workflows/format_and_lint.yml) [![Desktop Apps Build](https://github.com/Kiln-AI/kiln/actions/workflows/build_desktop.yml/badge.svg)](https://github.com/Kiln-AI/kiln/actions/workflows/build_desktop.yml) [![Web UI Build](https://github.com/Kiln-AI/kiln/actions/workflows/web_format_lint_build.yml/badge.svg)](https://github.com/Kiln-AI/kiln/actions/workflows/web_format_lint_build.yml) |
| Package | [![PyPI - Version](https://img.shields.io/pypi/v/kiln-ai.svg?logo=pypi&label=PyPI&logoColor=gold)](https://pypi.org/project/kiln-ai/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/kiln-ai.svg?logo=python&label=Python&logoColor=gold)](https://pypi.org/project/kiln-ai/) |
| Meta | [![linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/) [![types - Mypy](https://img.shields.io/badge/types-pyright-blue.svg)](https://github.com/microsoft/pyright) |

## Development

Running the desktop app without building executable:

`python -m app.desktop.desktop`
1 change: 1 addition & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Blank needed for pyinstaller to find module
1 change: 1 addition & 0 deletions app/desktop/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Blank needed for pyinstaller to find module
2 changes: 1 addition & 1 deletion app/desktop/desktop.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pystray
from PIL import Image

from .desktop_server import ThreadedServer, server_config
from app.desktop.desktop_server import ThreadedServer, server_config

# TODO: remove this and all other globals in this file
root = None # type: tk.Tk | None
Expand Down
3 changes: 2 additions & 1 deletion app/desktop/test_desktop.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import random

import desktop_server
import requests

import app.desktop.desktop_server as desktop_server


def test_desktop_app_server():
# random port between 9000 and 12000
Expand Down
2 changes: 1 addition & 1 deletion pyrightconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"exclude": ["**/test_*.py"]
"exclude": ["**/test_*.py", "app/desktop/build/**"]
}

0 comments on commit 29b15d4

Please sign in to comment.