PBKittyConfigStudio 0.2.0__tar.gz → 0.3.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.
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/.github/workflows/ci.yml +2 -2
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/CHANGELOG.md +24 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/Makefile +6 -6
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/PBKittyConfigStudio.spec +13 -4
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/PKG-INFO +1 -1
- pbkittyconfigstudio-0.3.0/hooks/pyi_rth_fonts.py +49 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/pyproject.toml +9 -6
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/__init__.py +1 -1
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/__main__.py +36 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/platform/auto_update.py +14 -4
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/test_auto_update.py +34 -2
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/.gitignore +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/.markdownlint-cli2.yaml +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/.pre-commit-config.yaml +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/CLAUDE.md +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/CODING.md +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/LICENSE +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/README.md +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/babel.cfg +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/hatch_build.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/pixi.lock +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/schema_builder/README.md +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/schema_builder/build_kitty.sh +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/schema_builder/build_schema.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/schema_builder/extract_definition.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/schema_builder/merge_schema.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/schema_builder/pixi.toml +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/schema_builder/rst_clean.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/argparse_qt.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/config/__init__.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/config/_babel_extractor.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/config/schema.json +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/core/__init__.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/core/kitty_conf.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/i18n.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/locale/de/LC_MESSAGES/pb_kitty_config_studio.po +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/locale/en/LC_MESSAGES/pb_kitty_config_studio.po +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/locale/es/LC_MESSAGES/pb_kitty_config_studio.po +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/locale/fr/LC_MESSAGES/pb_kitty_config_studio.po +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/locale/it/LC_MESSAGES/pb_kitty_config_studio.po +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/locale/ru/LC_MESSAGES/pb_kitty_config_studio.po +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/locale/vi/LC_MESSAGES/pb_kitty_config_studio.po +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/locale/zh_CN/LC_MESSAGES/pb_kitty_config_studio.po +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/platform/__init__.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/platform/desktop.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/__init__.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/cancel.svg +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/clear-all-data.svg +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/help-about.svg +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/pbkittyconfigstudio.icns +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/pbkittyconfigstudio.ico +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/pbkittyconfigstudio.png +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/previous.svg +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/quit.svg +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/refresh.svg +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/save-as.svg +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/resources/save.svg +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/ui/__init__.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/ui/about_dialog.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/ui/main_window.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/ui/widgets.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/conftest.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/fixtures/README.md +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/fixtures/kitty_default.conf +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/test_about_dialog.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/test_argparse_qt.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/test_babel_extractor.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/test_desktop.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/test_i18n.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/test_kitty_conf.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/test_main.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/test_main_window.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/test_resources.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/test_schema.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/test_schema_builder_extract_definition.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/test_schema_builder_merge_schema.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/test_schema_builder_rst_clean.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/test_widgets.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tools/bump_version.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tools/extract_changelog.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tools/fix_po_files.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tools/git_version.sh +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tools/po_check.py +0 -0
- {pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tools/update_icons.py +0 -0
|
@@ -109,7 +109,7 @@ jobs:
|
|
|
109
109
|
with:
|
|
110
110
|
# One artifact per runner; merged in the release job.
|
|
111
111
|
name: build-${{ runner.os }}
|
|
112
|
-
path: dist/
|
|
112
|
+
path: dist/pbkittyconfigstudio-*
|
|
113
113
|
if-no-files-found: error
|
|
114
114
|
|
|
115
115
|
# ── GitHub release ───────────────────────────────────────────────────────────
|
|
@@ -141,5 +141,5 @@ jobs:
|
|
|
141
141
|
uses: softprops/action-gh-release@v3
|
|
142
142
|
with:
|
|
143
143
|
body: ${{ steps.changelog.outputs.body }}
|
|
144
|
-
files: dist/
|
|
144
|
+
files: dist/pbkittyconfigstudio-*
|
|
145
145
|
fail_on_unmatched_files: true
|
|
@@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.3.0] - 2026-08-25
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- PyInstaller executable and source-archive names are now lowercase
|
|
13
|
+
(`pbkittyconfigstudio-<version>-<os>-<arch>`), for consistency with the
|
|
14
|
+
other PB* tools — previously `PBKittyConfigStudio-…`. `--auto-update`
|
|
15
|
+
looks up release assets under the new prefix first, falling back to the
|
|
16
|
+
old `PBKittyConfigStudio-` prefix so a pre-rename install can still find
|
|
17
|
+
and download its update.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- Linux PyInstaller builds: bundled fonts were resolved through a
|
|
22
|
+
fontconfig config file containing absolute paths hardcoded to the build
|
|
23
|
+
machine's environment, which don't exist on the target machine —
|
|
24
|
+
fontconfig failed to find its config there and Qt fell back to an
|
|
25
|
+
illegible default font. Fonts are now registered directly with
|
|
26
|
+
`QFontDatabase.addApplicationFont` (bypassing fontconfig entirely), with
|
|
27
|
+
the application font forced to Ubuntu; a PyInstaller runtime hook
|
|
28
|
+
(`hooks/pyi_rth_fonts.py`) also regenerates a portable `fonts.conf` at
|
|
29
|
+
startup so other rendering settings (anti-aliasing, hinting, …) are still
|
|
30
|
+
inherited from the target system.
|
|
31
|
+
|
|
8
32
|
## [0.2.0] - 2026-08-21
|
|
9
33
|
|
|
10
34
|
### Added
|
|
@@ -135,9 +135,9 @@ update-icons: ## Sync app icons (.svg/.png/.ico/.icns) from PBIcons
|
|
|
135
135
|
# PyInstaller builds natively: run this target on the target OS.
|
|
136
136
|
# Version comes from the exact git tag when HEAD is tagged and the tree is
|
|
137
137
|
# clean; otherwise "dev". Output in dist/:
|
|
138
|
-
# Linux → dist/
|
|
139
|
-
# Windows → dist/
|
|
140
|
-
# macOS → dist/
|
|
138
|
+
# Linux → dist/pbkittyconfigstudio-<ver>-linux-x86_64
|
|
139
|
+
# Windows → dist/pbkittyconfigstudio-<ver>-windows-x86_64.exe
|
|
140
|
+
# macOS → dist/pbkittyconfigstudio-<ver>-macos-arm64 (.app bundle)
|
|
141
141
|
dist: translate ## Build a standalone executable for the current platform
|
|
142
142
|
@ver=$$(bash tools/git_version.sh); \
|
|
143
143
|
printf "$(C)PyInstaller — version: $$ver platform: $$($(CONDA_RUN) python -c 'import sys; print(sys.platform)')$(R)\n"; \
|
|
@@ -147,12 +147,12 @@ dist: translate ## Build a standalone executable for the current platform
|
|
|
147
147
|
PBKittyConfigStudio.spec
|
|
148
148
|
@printf "$(G)Done.$(R) Executable in $(Y)dist/$(R)\n"
|
|
149
149
|
|
|
150
|
-
srcdist: ## Build a source archive (dist/
|
|
150
|
+
srcdist: ## Build a source archive (dist/pbkittyconfigstudio-<ver>-src.tar.gz) via git archive
|
|
151
151
|
@ver=$$(bash tools/git_version.sh); \
|
|
152
|
-
out="dist/
|
|
152
|
+
out="dist/pbkittyconfigstudio-$$ver-src.tar.gz"; \
|
|
153
153
|
printf "$(C)Source archive — version: $$ver$(R)\n"; \
|
|
154
154
|
mkdir -p dist; \
|
|
155
|
-
git archive --format=tar.gz --prefix="
|
|
155
|
+
git archive --format=tar.gz --prefix="pbkittyconfigstudio-$$ver/" HEAD -o "$$out"; \
|
|
156
156
|
printf "$(G)Done.$(R) Archive: $(Y)$$out$(R)\n"
|
|
157
157
|
|
|
158
158
|
# ── PyPI ──────────────────────────────────────────────────────────────────────
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
The output name embeds the version and the target platform so that builds
|
|
5
5
|
for different systems can coexist in the same directory:
|
|
6
6
|
|
|
7
|
-
Linux → dist/
|
|
8
|
-
Windows → dist/
|
|
9
|
-
macOS → dist/
|
|
7
|
+
Linux → dist/pbkittyconfigstudio-<version>-linux-x86_64
|
|
8
|
+
Windows → dist/pbkittyconfigstudio-<version>-windows-x86_64.exe
|
|
9
|
+
macOS → dist/pbkittyconfigstudio-<version>-macos-arm64.app
|
|
10
10
|
|
|
11
11
|
Build with: make dist
|
|
12
12
|
"""
|
|
@@ -49,7 +49,7 @@ elif sys.platform == "darwin":
|
|
|
49
49
|
else:
|
|
50
50
|
_os = sys.platform
|
|
51
51
|
|
|
52
|
-
_artifact_name = f"
|
|
52
|
+
_artifact_name = f"pbkittyconfigstudio-{_version}-{_os}-{_arch}"
|
|
53
53
|
|
|
54
54
|
# ---------------------------------------------------------------------------
|
|
55
55
|
# Data files to bundle
|
|
@@ -98,6 +98,14 @@ if sys.platform == "linux":
|
|
|
98
98
|
if (_conda_lib_dir / name).is_file()
|
|
99
99
|
]
|
|
100
100
|
|
|
101
|
+
# Conda fonts: bundled to guarantee identical rendering across machines.
|
|
102
|
+
# On Linux, fontconfig resolves fonts via absolute paths written into fonts.conf
|
|
103
|
+
# at build time; those paths do not exist on the target machine.
|
|
104
|
+
# The runtime hook hooks/pyi_rth_fonts.py generates a portable fonts.conf at startup.
|
|
105
|
+
_conda_fonts = Path(sys.base_prefix) / "fonts"
|
|
106
|
+
if _conda_fonts.is_dir():
|
|
107
|
+
_datas += [(str(_conda_fonts), "fonts")]
|
|
108
|
+
|
|
101
109
|
# ---------------------------------------------------------------------------
|
|
102
110
|
# Analysis
|
|
103
111
|
# ---------------------------------------------------------------------------
|
|
@@ -111,6 +119,7 @@ a = Analysis(
|
|
|
111
119
|
binaries=_binaries,
|
|
112
120
|
hiddenimports=[],
|
|
113
121
|
hookspath=[],
|
|
122
|
+
runtime_hooks=["hooks/pyi_rth_fonts.py"],
|
|
114
123
|
excludes=["tkinter", "unittest"],
|
|
115
124
|
noarchive=False,
|
|
116
125
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: PBKittyConfigStudio
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: A desktop GUI for configuring the kitty terminal
|
|
5
5
|
Project-URL: Homepage, https://github.com/ppoilbarbe/PBKittyConfigStudio
|
|
6
6
|
Project-URL: Repository, https://github.com/ppoilbarbe/PBKittyConfigStudio
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"""PyInstaller runtime hook — portable fontconfig on Linux.
|
|
2
|
+
|
|
3
|
+
On Linux, Qt uses fontconfig to locate fonts. The fonts.conf bundled by
|
|
4
|
+
PyInstaller contains absolute paths to the conda environment of the build
|
|
5
|
+
machine (e.g. /home/runner/…) that do not exist on the target machine.
|
|
6
|
+
|
|
7
|
+
This hook runs at frozen-app startup, before Qt initialises. It:
|
|
8
|
+
1. Writes a minimal fonts.conf into sys._MEIPASS pointing to the bundled
|
|
9
|
+
fonts (fonts/) and the system fonts (/usr/share/fonts).
|
|
10
|
+
2. Sets FONTCONFIG_FILE so that fontconfig picks up this file.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
import os
|
|
14
|
+
import sys
|
|
15
|
+
|
|
16
|
+
if sys.platform != "linux" or not getattr(sys, "frozen", False):
|
|
17
|
+
pass
|
|
18
|
+
else:
|
|
19
|
+
_meipass = sys._MEIPASS
|
|
20
|
+
_fonts_dir = os.path.join(_meipass, "fonts")
|
|
21
|
+
if os.path.isdir(_fonts_dir):
|
|
22
|
+
_conf_path = os.path.join(_meipass, "fonts.conf")
|
|
23
|
+
# Include the system fonts.conf so that all rendering settings
|
|
24
|
+
# (anti-aliasing, hinting, subpixel, …) and system fonts are inherited.
|
|
25
|
+
# Only the bundled fonts directory needs to be added explicitly.
|
|
26
|
+
_conf = f"""<?xml version="1.0"?>
|
|
27
|
+
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
|
|
28
|
+
<fontconfig>
|
|
29
|
+
<dir>{_fonts_dir}</dir>
|
|
30
|
+
<include ignore_missing="yes">/etc/fonts/fonts.conf</include>
|
|
31
|
+
</fontconfig>
|
|
32
|
+
"""
|
|
33
|
+
with open(_conf_path, "w", encoding="utf-8") as _f:
|
|
34
|
+
_f.write(_conf)
|
|
35
|
+
os.environ["FONTCONFIG_FILE"] = _conf_path
|
|
36
|
+
|
|
37
|
+
# Force fontconfig to (re-)initialize with the new FONTCONFIG_FILE.
|
|
38
|
+
# libfontconfig may have already been dlopen'd and self-initialized with
|
|
39
|
+
# its compile-time defaults (hardcoded to the build machine's conda path)
|
|
40
|
+
# before this hook ran. FcFini() + FcInit() resets it so it re-reads
|
|
41
|
+
# FONTCONFIG_FILE before Qt's QFontDatabase is populated.
|
|
42
|
+
try:
|
|
43
|
+
import ctypes
|
|
44
|
+
|
|
45
|
+
_fc = ctypes.CDLL("libfontconfig.so.1")
|
|
46
|
+
_fc.FcFini()
|
|
47
|
+
_fc.FcInit()
|
|
48
|
+
except OSError:
|
|
49
|
+
pass
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "PBKittyConfigStudio"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.3.0"
|
|
8
8
|
description = "A desktop GUI for configuring the kitty terminal"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "GPL-3.0-or-later"
|
|
@@ -91,11 +91,14 @@ channels = ["conda-forge"]
|
|
|
91
91
|
platforms = ["linux-64", "osx-64", "osx-arm64", "win-64"]
|
|
92
92
|
|
|
93
93
|
[tool.pixi.dependencies]
|
|
94
|
-
python
|
|
95
|
-
pyside6
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
python = "3.12.*"
|
|
95
|
+
pyside6 = "*"
|
|
96
|
+
# Bundled into PyInstaller builds for identical, portable font rendering
|
|
97
|
+
# across machines — see hooks/pyi_rth_fonts.py and PBKittyConfigStudio.spec.
|
|
98
|
+
fonts-conda-ecosystem = "*"
|
|
99
|
+
pytest = "*"
|
|
100
|
+
pytest-qt = "*"
|
|
101
|
+
pytest-cov = "*"
|
|
99
102
|
ruff = "*"
|
|
100
103
|
pre-commit = "*"
|
|
101
104
|
babel = "*"
|
{pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/__main__.py
RENAMED
|
@@ -123,6 +123,41 @@ def main() -> None:
|
|
|
123
123
|
_run_gui(ns) # pragma: no cover — see _run_gui's docstring/comment
|
|
124
124
|
|
|
125
125
|
|
|
126
|
+
def _load_bundled_fonts(app: object) -> None: # pragma: no cover
|
|
127
|
+
"""Register bundled fonts into Qt's font database (frozen builds only).
|
|
128
|
+
|
|
129
|
+
In a PyInstaller onefile build, fontconfig uses paths hardcoded at build
|
|
130
|
+
time that don't exist on the target machine. QFontDatabase.addApplicationFont
|
|
131
|
+
bypasses fontconfig entirely and guarantees that the bundled fonts (Ubuntu,
|
|
132
|
+
DejaVu, …) are available regardless of the host fontconfig configuration.
|
|
133
|
+
"""
|
|
134
|
+
if not getattr(sys, "frozen", False):
|
|
135
|
+
return
|
|
136
|
+
|
|
137
|
+
from PySide6.QtGui import QFont, QFontDatabase
|
|
138
|
+
|
|
139
|
+
fonts_dir = Path(sys._MEIPASS) / "fonts" # type: ignore[attr-defined]
|
|
140
|
+
if not fonts_dir.is_dir():
|
|
141
|
+
return
|
|
142
|
+
|
|
143
|
+
loaded: set[str] = set()
|
|
144
|
+
for ttf in sorted(fonts_dir.glob("*.ttf")):
|
|
145
|
+
fid = QFontDatabase.addApplicationFont(str(ttf))
|
|
146
|
+
if fid >= 0:
|
|
147
|
+
loaded.update(QFontDatabase.applicationFontFamilies(fid))
|
|
148
|
+
|
|
149
|
+
# Set Ubuntu as the default application font so the bundle renders
|
|
150
|
+
# consistently on any machine, regardless of whether fontconfig finds
|
|
151
|
+
# the system config. The bundled libfontconfig.so has its default config
|
|
152
|
+
# path hardcoded to the build machine's conda prefix, which does not exist
|
|
153
|
+
# on target machines, so font selection cannot rely on fontconfig.
|
|
154
|
+
if "Ubuntu" in loaded:
|
|
155
|
+
current = app.font() # type: ignore[union-attr]
|
|
156
|
+
app.setFont( # type: ignore[union-attr]
|
|
157
|
+
QFont("Ubuntu", current.pointSize() if current.pointSize() > 0 else 10)
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
|
|
126
161
|
def _run_gui(ns: argparse.Namespace) -> None: # pragma: no cover
|
|
127
162
|
# Real Qt bootstrap: creates the process's one-and-only QApplication and
|
|
128
163
|
# runs its event loop. Not unit-testable — PySide6 raises ("libshiboken:
|
|
@@ -141,6 +176,7 @@ def _run_gui(ns: argparse.Namespace) -> None: # pragma: no cover
|
|
|
141
176
|
# which would let Qt's own permissive C++ parser silently absorb or
|
|
142
177
|
# ignore anything argparse didn't already recognize above.
|
|
143
178
|
app = QApplication([sys.argv[0]] + ns.qt_args)
|
|
179
|
+
_load_bundled_fonts(app)
|
|
144
180
|
app.setApplicationName("PBKittyConfigStudio")
|
|
145
181
|
app.setApplicationVersion(__version__)
|
|
146
182
|
app.setOrganizationName("cardolan")
|
|
@@ -189,11 +189,21 @@ def _fetch_latest_release() -> dict:
|
|
|
189
189
|
return json.load(resp)
|
|
190
190
|
|
|
191
191
|
|
|
192
|
+
# Release assets were originally named with the PascalCase project name
|
|
193
|
+
# ("PBKittyConfigStudio-…"); the executable (and its asset prefix) was later
|
|
194
|
+
# renamed to lowercase for consistency with the other PB* tools. Try the
|
|
195
|
+
# current prefix first, falling back to the old one so updating from a
|
|
196
|
+
# pre-rename install still finds a matching asset.
|
|
197
|
+
_ASSET_PREFIXES = ("pbkittyconfigstudio-", "PBKittyConfigStudio-")
|
|
198
|
+
|
|
199
|
+
|
|
192
200
|
def _find_asset(release: dict, suffix: str) -> dict | None:
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
201
|
+
assets = release.get("assets", [])
|
|
202
|
+
for prefix in _ASSET_PREFIXES:
|
|
203
|
+
for asset in assets:
|
|
204
|
+
name = asset.get("name", "")
|
|
205
|
+
if name.startswith(prefix) and name.endswith(suffix):
|
|
206
|
+
return asset
|
|
197
207
|
return None
|
|
198
208
|
|
|
199
209
|
|
|
@@ -89,11 +89,11 @@ def test_find_asset_matches_name_prefix_and_suffix():
|
|
|
89
89
|
release = {
|
|
90
90
|
"assets": [
|
|
91
91
|
{
|
|
92
|
-
"name": "
|
|
92
|
+
"name": "pbkittyconfigstudio-1.2.3-linux-x86_64",
|
|
93
93
|
"browser_download_url": "u1",
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
|
-
"name": "
|
|
96
|
+
"name": "pbkittyconfigstudio-1.2.3-macos-arm64.zip",
|
|
97
97
|
"browser_download_url": "u2",
|
|
98
98
|
},
|
|
99
99
|
]
|
|
@@ -106,6 +106,38 @@ def test_find_asset_returns_none_when_no_match():
|
|
|
106
106
|
assert _find_asset({"assets": []}, "-linux-x86_64") is None
|
|
107
107
|
|
|
108
108
|
|
|
109
|
+
def test_find_asset_falls_back_to_legacy_pascalcase_prefix():
|
|
110
|
+
# Older releases published assets under the original PascalCase name;
|
|
111
|
+
# a pre-rename install must still be able to find its update.
|
|
112
|
+
release = {
|
|
113
|
+
"assets": [
|
|
114
|
+
{
|
|
115
|
+
"name": "PBKittyConfigStudio-1.2.3-linux-x86_64",
|
|
116
|
+
"browser_download_url": "u1",
|
|
117
|
+
},
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
asset = _find_asset(release, "-linux-x86_64")
|
|
121
|
+
assert asset["browser_download_url"] == "u1"
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def test_find_asset_prefers_current_prefix_over_legacy_one():
|
|
125
|
+
release = {
|
|
126
|
+
"assets": [
|
|
127
|
+
{
|
|
128
|
+
"name": "PBKittyConfigStudio-1.2.3-linux-x86_64",
|
|
129
|
+
"browser_download_url": "legacy",
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "pbkittyconfigstudio-1.2.3-linux-x86_64",
|
|
133
|
+
"browser_download_url": "current",
|
|
134
|
+
},
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
asset = _find_asset(release, "-linux-x86_64")
|
|
138
|
+
assert asset["browser_download_url"] == "current"
|
|
139
|
+
|
|
140
|
+
|
|
109
141
|
# -- _fetch_latest_release / _download -----------------------------------------
|
|
110
142
|
|
|
111
143
|
|
{pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/.github/ISSUE_TEMPLATE/bug_report.md
RENAMED
|
File without changes
|
{pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/.github/ISSUE_TEMPLATE/feature_request.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/schema_builder/extract_definition.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/argparse_qt.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/core/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/ui/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/ui/main_window.py
RENAMED
|
File without changes
|
{pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/src/pb_kitty_config_studio/ui/widgets.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/test_schema_builder_merge_schema.py
RENAMED
|
File without changes
|
{pbkittyconfigstudio-0.2.0 → pbkittyconfigstudio-0.3.0}/tests/test_schema_builder_rst_clean.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|