station-appkit 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,62 @@
1
+ __pycache__/
2
+ *.pyc
3
+ *.pyo
4
+ .pytest_cache/
5
+ .venv/
6
+ venv/
7
+ *.db
8
+ *.db-journal
9
+ *.db-wal
10
+ *.db-shm
11
+ .DS_Store
12
+ node_modules/
13
+ .svelte-kit/
14
+ web/build/
15
+ dist/
16
+ build/
17
+ *.egg-info/
18
+ .env
19
+ .env.local
20
+
21
+ # User-dropped iTunes XML exports (large, not repo content)
22
+ from_user/*
23
+ !from_user/README.md
24
+
25
+ # Generated iTunes XML exports (default disk-export destination)
26
+ out/
27
+ output/
28
+
29
+ # Playwright
30
+ web/test-results/
31
+ web/playwright-report/
32
+ test-results/
33
+ playwright-report/
34
+ playwright-test.*.db
35
+ playwright-test.*.db-wal
36
+ playwright-test.*.db-shm
37
+ playwright-stations.*/
38
+
39
+ # Coverage output (.coverage.* = per-process files before `coverage combine`)
40
+ .coverage
41
+ .coverage.*
42
+ web/coverage/
43
+
44
+ # Database backups (DESIGN.md §14.18). User-data; never repo content.
45
+ backups/
46
+ .claude/
47
+
48
+ # §16.15 c1 — MkDocs build output. Source lives in docs/; the
49
+ # rendered HTML/CSS/JS lands in site/ and is published to GH Pages
50
+ # via the docs workflow, never committed to main.
51
+ site/
52
+ # §16.15 c4 — OpenAPI dump consumed by mkdocs-render-swagger-plugin.
53
+ # Regenerated by `make docs-openapi` (chained from docs-build +
54
+ # docs-serve); committing would risk drift between the JSON and
55
+ # the FastAPI app's actual schema.
56
+ docs/reference/openapi.json
57
+ # §16.15 c5 — CLI --help dump consumed by the docs build.
58
+ # Regenerated by `make docs-cli`; same drift logic as openapi.json.
59
+ docs/reference/cli.md
60
+
61
+ # ffmpeg fetched for the Station Server downloads (server-installers.yml)
62
+ server/packaging/ffmpeg/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 Raby Whyte
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,55 @@
1
+ Metadata-Version: 2.5
2
+ Name: station-appkit
3
+ Version: 1.0.0
4
+ Summary: Update check, self-updater and app window shared by Station Studio, Station Player and Station Server
5
+ Project-URL: Homepage, https://github.com/raby/station-studio
6
+ Project-URL: Repository, https://github.com/raby/station-studio
7
+ Author-email: Raby Whyte <rabywhyte@gmail.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2025-2026 Raby Whyte
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ License-File: LICENSE
30
+ Keywords: desktop,station-studio,updater
31
+ Requires-Python: >=3.11
32
+ Description-Content-Type: text/markdown
33
+
34
+ # station-appkit
35
+
36
+ What [Station Studio](https://github.com/raby/station-studio), Station
37
+ Player and Station Server share as desktop apps, so each is written once:
38
+
39
+ - **The new-version check** (`station_appkit.updates`): asks GitHub, at
40
+ most once a day, for the app's newest release (`studio-v*`,
41
+ `player-v*`, `server-v*`). Only release names are fetched.
42
+ - **The self-updater** (`station_appkit.selfupdate`): Update now in the
43
+ downloaded Mac and Windows apps. The new version's installer is used
44
+ only when its size and SHA-256 match what GitHub publishes for that
45
+ file, and only from the project's own releases.
46
+ - **The app window** (`station_appkit.window`): a Chrome, Edge or Brave
47
+ app window with its own profile, or a browser tab; and on the Mac
48
+ (`station_appkit.macwindow`, needs PyObjC) the downloaded app's own
49
+ WebKit window, with its menus, Dock icon and downloads.
50
+
51
+ Each app describes itself once (`station_appkit.App`: its name, release
52
+ tag, port and so on) and passes that in. Standard library only.
53
+
54
+ It isn't meant for use outside these apps; it's published so they can be
55
+ installed with pip or pipx. MIT licensed.
@@ -0,0 +1,22 @@
1
+ # station-appkit
2
+
3
+ What [Station Studio](https://github.com/raby/station-studio), Station
4
+ Player and Station Server share as desktop apps, so each is written once:
5
+
6
+ - **The new-version check** (`station_appkit.updates`): asks GitHub, at
7
+ most once a day, for the app's newest release (`studio-v*`,
8
+ `player-v*`, `server-v*`). Only release names are fetched.
9
+ - **The self-updater** (`station_appkit.selfupdate`): Update now in the
10
+ downloaded Mac and Windows apps. The new version's installer is used
11
+ only when its size and SHA-256 match what GitHub publishes for that
12
+ file, and only from the project's own releases.
13
+ - **The app window** (`station_appkit.window`): a Chrome, Edge or Brave
14
+ app window with its own profile, or a browser tab; and on the Mac
15
+ (`station_appkit.macwindow`, needs PyObjC) the downloaded app's own
16
+ WebKit window, with its menus, Dock icon and downloads.
17
+
18
+ Each app describes itself once (`station_appkit.App`: its name, release
19
+ tag, port and so on) and passes that in. Standard library only.
20
+
21
+ It isn't meant for use outside these apps; it's published so they can be
22
+ installed with pip or pipx. MIT licensed.
@@ -0,0 +1,44 @@
1
+ # station-appkit: what Station Studio, Station Player and Station Server
2
+ # share as desktop apps. The new-version check, the self-updater (download,
3
+ # SHA-256 check, install) and the app window: a Chrome or Edge app window,
4
+ # or on the Mac the app's own WebKit window. Standard library only (the
5
+ # Mac window needs PyObjC, which only the downloaded Mac apps carry).
6
+ #
7
+ # In this repo the three apps use it from appkit/ (a uv workspace member);
8
+ # the Mac and Windows downloads bundle it from here. Each app's Publish
9
+ # workflow puts this version on PyPI first if it isn't there yet, so a
10
+ # `pipx install station-player` (say) finds it.
11
+
12
+ [build-system]
13
+ requires = ["hatchling"]
14
+ build-backend = "hatchling.build"
15
+
16
+ [project]
17
+ name = "station-appkit"
18
+ version = "1.0.0"
19
+ description = "Update check, self-updater and app window shared by Station Studio, Station Player and Station Server"
20
+ readme = "README.md"
21
+ license = { file = "LICENSE" }
22
+ requires-python = ">=3.11"
23
+ authors = [
24
+ { name = "Raby Whyte", email = "rabywhyte@gmail.com" },
25
+ ]
26
+ keywords = ["station-studio", "updater", "desktop"]
27
+ dependencies = []
28
+
29
+ [project.urls]
30
+ Homepage = "https://github.com/raby/station-studio"
31
+ Repository = "https://github.com/raby/station-studio"
32
+
33
+ # For working on it, not installed with it.
34
+ [dependency-groups]
35
+ dev = [
36
+ "pytest>=8.0",
37
+ "pytest-github-actions-annotate-failures>=0.4.2",
38
+ ]
39
+
40
+ [tool.hatch.build.targets.wheel]
41
+ packages = ["station_appkit"]
42
+
43
+ [tool.pytest.ini_options]
44
+ testpaths = ["tests"]
@@ -0,0 +1,65 @@
1
+ """What Station Studio, Station Player and Station Server share as desktop
2
+ apps: the new-version check (updates), the self-updater (selfupdate) and
3
+ the app window (window, and on the Mac macwindow).
4
+
5
+ Each app describes itself once, as an `App`, and hands that in.
6
+ """
7
+ from __future__ import annotations
8
+
9
+ from dataclasses import dataclass, field
10
+
11
+ __version__ = "1.0.0"
12
+
13
+ REPO = "raby/station-studio"
14
+
15
+
16
+ @dataclass(frozen=True)
17
+ class App:
18
+ """One of the three apps, as the shared code needs to know it."""
19
+
20
+ name: str
21
+ """In words: "Station Studio"."""
22
+ slug: str
23
+ """Without the space: "StationStudio". Names the downloads
24
+ (StationStudio-1.2.0-windows-setup.exe), the user agent and the
25
+ Mac window's user agent (StationStudioApp/1.2.0)."""
26
+ tag_prefix: str
27
+ """Its releases' tags: "studio-v"."""
28
+ version: str
29
+ """The version running."""
30
+ port: int
31
+ """The port it serves on unless told otherwise."""
32
+ mac_helper: str = ""
33
+ """The Mac app's helper (Contents/MacOS/<this>), which runs the server;
34
+ the app the Finder opens is its window."""
35
+ env_prefix: str = ""
36
+ """"STATION_STUDIO": STATION_STUDIO_INSPECT, STATION_STUDIO_SELFTEST."""
37
+ window_size: tuple[int, int] = (1280, 860)
38
+ """The app window's first size."""
39
+ browser_args: tuple[str, ...] = field(default=())
40
+ """More flags for the Chrome or Edge app window."""
41
+ repo: str = REPO
42
+
43
+ @property
44
+ def default_url(self) -> str:
45
+ return f"http://127.0.0.1:{self.port}/"
46
+
47
+ @property
48
+ def releases_api(self) -> str:
49
+ return f"https://api.github.com/repos/{self.repo}/releases?per_page=100"
50
+
51
+ def release_api(self, version: str) -> str:
52
+ return f"https://api.github.com/repos/{self.repo}/releases/tags/{self.tag_prefix}{version}"
53
+
54
+ def release_page(self, version: str) -> str:
55
+ return f"https://github.com/{self.repo}/releases/tag/{self.tag_prefix}{version}"
56
+
57
+ @property
58
+ def download_prefix(self) -> str:
59
+ """Only files from the project's own releases are used."""
60
+ return f"https://github.com/{self.repo}/releases/download/"
61
+
62
+ @property
63
+ def temp_prefix(self) -> str:
64
+ """"station-studio": for temporary folders."""
65
+ return self.name.lower().replace(" ", "-")