sparknh-reader 0.1.0rc4__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.
- sparknh_reader-0.1.0rc4/LICENSE +167 -0
- sparknh_reader-0.1.0rc4/PKG-INFO +111 -0
- sparknh_reader-0.1.0rc4/README.md +96 -0
- sparknh_reader-0.1.0rc4/pyproject.toml +54 -0
- sparknh_reader-0.1.0rc4/pyproject.toml.orig +47 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/__init__.py +30 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/__main__.py +5 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/cli.py +198 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/icons/icon.ico +0 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/icons/icon.svg +5 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/keys.py +46 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/mod_packages.toml +326 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/qt/__init__.py +1 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/qt/app.py +280 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/qt/asyncloop.py +49 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/qt/host.py +31 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/qt/settings.py +296 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/qt/theme.py +165 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/qt/widgets.py +909 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/qt/window.py +1522 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/shortcut.py +260 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/skill/SKILL.md +61 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/skill/command.md +10 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/skill/spark.py +76 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/skill_install.py +159 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/spark.py +2069 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/update.py +317 -0
- sparknh_reader-0.1.0rc4/src/sparknh_reader/update_helper.py +75 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
+
of this license document, but changing it is not allowed.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
+
License, supplemented by the additional permissions listed below.
|
|
12
|
+
|
|
13
|
+
0. Additional Definitions.
|
|
14
|
+
|
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
+
General Public License.
|
|
18
|
+
|
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
|
20
|
+
other than an Application or a Combined Work as defined below.
|
|
21
|
+
|
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
+
of using an interface provided by the Library.
|
|
26
|
+
|
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
+
Application with the Library. The particular version of the Library
|
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
|
30
|
+
Version".
|
|
31
|
+
|
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
+
based on the Application, and not on the Linked Version.
|
|
36
|
+
|
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
+
object code and/or source code for the Application, including any data
|
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
+
|
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
+
|
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
|
46
|
+
|
|
47
|
+
2. Conveying Modified Versions.
|
|
48
|
+
|
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
|
51
|
+
that uses the facility (other than as an argument passed when the
|
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
|
53
|
+
version:
|
|
54
|
+
|
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
|
56
|
+
ensure that, in the event an Application does not supply the
|
|
57
|
+
function or data, the facility still operates, and performs
|
|
58
|
+
whatever part of its purpose remains meaningful, or
|
|
59
|
+
|
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
+
this License applicable to that copy.
|
|
62
|
+
|
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
+
|
|
65
|
+
The object code form of an Application may incorporate material from
|
|
66
|
+
a header file that is part of the Library. You may convey such object
|
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
|
68
|
+
material is not limited to numerical parameters, data structure
|
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
|
71
|
+
|
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
|
73
|
+
Library is used in it and that the Library and its use are
|
|
74
|
+
covered by this License.
|
|
75
|
+
|
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
+
document.
|
|
78
|
+
|
|
79
|
+
4. Combined Works.
|
|
80
|
+
|
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
|
82
|
+
taken together, effectively do not restrict modification of the
|
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
|
85
|
+
the following:
|
|
86
|
+
|
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
+
the Library is used in it and that the Library and its use are
|
|
89
|
+
covered by this License.
|
|
90
|
+
|
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
+
document.
|
|
93
|
+
|
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
|
95
|
+
execution, include the copyright notice for the Library among
|
|
96
|
+
these notices, as well as a reference directing the user to the
|
|
97
|
+
copies of the GNU GPL and this license document.
|
|
98
|
+
|
|
99
|
+
d) Do one of the following:
|
|
100
|
+
|
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
+
License, and the Corresponding Application Code in a form
|
|
103
|
+
suitable for, and under terms that permit, the user to
|
|
104
|
+
recombine or relink the Application with a modified version of
|
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
+
Corresponding Source.
|
|
108
|
+
|
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
+
a copy of the Library already present on the user's computer
|
|
112
|
+
system, and (b) will operate properly with a modified version
|
|
113
|
+
of the Library that is interface-compatible with the Linked
|
|
114
|
+
Version.
|
|
115
|
+
|
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
+
be required to provide such information under section 6 of the
|
|
118
|
+
GNU GPL, and only to the extent that such information is
|
|
119
|
+
necessary to install and execute a modified version of the
|
|
120
|
+
Combined Work produced by recombining or relinking the
|
|
121
|
+
Application with a modified version of the Linked Version. (If
|
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
+
for conveying Corresponding Source.)
|
|
127
|
+
|
|
128
|
+
5. Combined Libraries.
|
|
129
|
+
|
|
130
|
+
You may place library facilities that are a work based on the
|
|
131
|
+
Library side by side in a single library together with other library
|
|
132
|
+
facilities that are not Applications and are not covered by this
|
|
133
|
+
License, and convey such a combined library under terms of your
|
|
134
|
+
choice, if you do both of the following:
|
|
135
|
+
|
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
|
137
|
+
on the Library, uncombined with any other library facilities,
|
|
138
|
+
conveyed under the terms of this License.
|
|
139
|
+
|
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
|
141
|
+
is a work based on the Library, and explaining where to find the
|
|
142
|
+
accompanying uncombined form of the same work.
|
|
143
|
+
|
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
+
|
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
+
versions will be similar in spirit to the present version, but may
|
|
149
|
+
differ in detail to address new problems or concerns.
|
|
150
|
+
|
|
151
|
+
Each version is given a distinguishing version number. If the
|
|
152
|
+
Library as you received it specifies that a certain numbered version
|
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
|
154
|
+
applies to it, you have the option of following the terms and
|
|
155
|
+
conditions either of that published version or of any later version
|
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
|
160
|
+
|
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
+
permanent authorization for you to choose that version for the
|
|
165
|
+
Library.
|
|
166
|
+
|
|
167
|
+
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sparknh-reader
|
|
3
|
+
Version: 0.1.0rc4
|
|
4
|
+
Summary: Read spark profiles (spark.lucko.me) of GT New Horizons servers and clients as text reports and in a desktop UI
|
|
5
|
+
License-Expression: LGPL-3.0-only
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Requires-Dist: platformdirs>=4.14.5
|
|
8
|
+
Requires-Dist: typer>=0.29.1
|
|
9
|
+
Requires-Dist: pyside6-essentials>=6.12.0 ; extra == 'desktop'
|
|
10
|
+
Requires-Dist: textual>=8.2.8 ; extra == 'desktop'
|
|
11
|
+
Requires-Python: >=3.12
|
|
12
|
+
Project-URL: Repository, https://github.com/GTNewHorizons/SparkNH-Reader
|
|
13
|
+
Provides-Extra: desktop
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# SparkNH Reader
|
|
17
|
+
|
|
18
|
+
Reads [spark](https://spark.lucko.me) profiles of GT New Horizons servers and clients, in a desktop app or on the
|
|
19
|
+
command line: a spark link, its code, or a `.sparkprofile`, `.sparkheap` or `.sparkhealth` file. It shows an
|
|
20
|
+
overview with findings, call trees and tables, and writes a short text report that people and LLMs can both read.
|
|
21
|
+
It also reads the extra data [SparkNH](https://github.com/GTNewHorizons/sparkNH) records, which the spark web viewer
|
|
22
|
+
doesn't show.
|
|
23
|
+
|
|
24
|
+
How to read what it shows: [docs/Spark-Profiles.md](docs/Spark-Profiles.md).
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
It needs [uv](https://docs.astral.sh/uv/) (`winget install astral-sh.uv` on Windows, `brew install uv` on macOS),
|
|
29
|
+
which also fetches Python.
|
|
30
|
+
|
|
31
|
+
The desktop app (downloads Qt, about 150 MB, the first time):
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
uv tool install "sparknh-reader[desktop] @ git+https://github.com/GTNewHorizons/SparkNH-Reader"
|
|
35
|
+
sparknh-reader-desktop
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
At its first start it offers to add itself to the Start menu (Windows) or the app menu (Linux).
|
|
39
|
+
`sparknh-reader-desktop LINK_OR_FILE` opens that profile straight away. On Linux, Qt needs `libxcb-cursor0`.
|
|
40
|
+
|
|
41
|
+
The command line only, nothing to install:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
uvx --from git+https://github.com/GTNewHorizons/SparkNH-Reader sparknh-reader summary https://spark.lucko.me/XXXXXXXXXX
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Commands
|
|
48
|
+
|
|
49
|
+
| Command | What it does |
|
|
50
|
+
|---|---|
|
|
51
|
+
| `summary SOURCE` | The report: setup, findings, worst minutes, entities, where the time goes; for a heap summary, what fills memory |
|
|
52
|
+
| `tree SOURCE METHOD` | What a method calls, all its call sites merged |
|
|
53
|
+
| `callers SOURCE METHOD` | Who calls a method |
|
|
54
|
+
| `compare EARLIER LATER` | What grew between two heap summaries |
|
|
55
|
+
| `install-skill` | The `spark-profile` skill for Claude Code, Codex and OpenCode |
|
|
56
|
+
| `install-shortcut [--remove]` | The Start menu or app menu entry |
|
|
57
|
+
| `update [--check]` | Install the newest version, or only say whether there is one |
|
|
58
|
+
|
|
59
|
+
`--help` after any command lists its options.
|
|
60
|
+
|
|
61
|
+
## Settings and updates
|
|
62
|
+
|
|
63
|
+
The ⚙ button next to Load sets the theme, the text size and the keys, adds or removes the menu entry, and installs
|
|
64
|
+
the skill for coding agents. Changes apply at once and are kept in `config.toml` in the user's config folder (`%LOCALAPPDATA%\sparknh-reader` on
|
|
65
|
+
Windows, `~/.config/sparknh-reader` on Linux, `~/Library/Application Support/sparknh-reader` on macOS):
|
|
66
|
+
|
|
67
|
+
```toml
|
|
68
|
+
theme = "nord" # a Textual theme name (textual-dark, nord, dracula, gruvbox, ...), or "system"
|
|
69
|
+
font_size = 12 # points
|
|
70
|
+
check_updates = false # don't look for a newer version at start
|
|
71
|
+
[keys]
|
|
72
|
+
spark_callers = "k" # an action id from src/sparknh_reader/keys.py -> its letter
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
At start, at most once a day, the app looks for a newer version (on PyPI once it's published there, else in the
|
|
76
|
+
GitHub releases) and offers it in a bar: What's new, Update, or Skip this version.
|
|
77
|
+
|
|
78
|
+
- **Update** works for a `uv tool install`: the app closes, installs the new version the same way, and starts
|
|
79
|
+
again. If that fails, the next start shows uv's log.
|
|
80
|
+
- **Any other install** (a checkout, pip, uvx) shows the command to run instead.
|
|
81
|
+
|
|
82
|
+
## Development
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
uv sync --extra desktop
|
|
86
|
+
uv run pytest
|
|
87
|
+
uv run ruff check . && uv run ruff format --check .
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
- **PyCharm:** run configurations in `.run/`: Desktop UI, Summary (asks for a link or file) and Tests.
|
|
91
|
+
- **`scripts/gen_mod_packages.py`:** regenerates the package → mod table from a pack's jars.
|
|
92
|
+
- **`scripts/gen_icon.py`:** regenerates `icons/icon.ico`, the Windows shortcut's icon, from `icons/icon.svg`.
|
|
93
|
+
|
|
94
|
+
## Releasing
|
|
95
|
+
|
|
96
|
+
CI (`.github/workflows/build-and-test.yml`) lints and tests every push and pull request on Windows, Linux and
|
|
97
|
+
macOS.
|
|
98
|
+
|
|
99
|
+
To release, push a tag named as the version, as GTNH mods do: `1.0.0`, or `1.1.0-pre` / `1.1.0rc1` for a
|
|
100
|
+
prerelease. The tag must be a [PEP 440](https://peps.python.org/pep-0440/) version, so `-snapshot` doesn't work.
|
|
101
|
+
|
|
102
|
+
- **What happens:** `release-tags.yml` builds the wheel with that version and attaches it to a GitHub release.
|
|
103
|
+
- **Release notes:** from `.changelogs/<tag>.md` when it exists, else GitHub generates them.
|
|
104
|
+
- **`pyproject.toml`:** its version only matters for builds between releases.
|
|
105
|
+
|
|
106
|
+
Publishing to PyPI is ready but switched off until the repo variable `PUBLISH_PYPI` is `true`. That needs PyPI's
|
|
107
|
+
trusted publishing set up first, for this repo, `release-tags.yml` and a `pypi` environment.
|
|
108
|
+
|
|
109
|
+
## License
|
|
110
|
+
|
|
111
|
+
LGPL-3.0-only.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# SparkNH Reader
|
|
2
|
+
|
|
3
|
+
Reads [spark](https://spark.lucko.me) profiles of GT New Horizons servers and clients, in a desktop app or on the
|
|
4
|
+
command line: a spark link, its code, or a `.sparkprofile`, `.sparkheap` or `.sparkhealth` file. It shows an
|
|
5
|
+
overview with findings, call trees and tables, and writes a short text report that people and LLMs can both read.
|
|
6
|
+
It also reads the extra data [SparkNH](https://github.com/GTNewHorizons/sparkNH) records, which the spark web viewer
|
|
7
|
+
doesn't show.
|
|
8
|
+
|
|
9
|
+
How to read what it shows: [docs/Spark-Profiles.md](docs/Spark-Profiles.md).
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
It needs [uv](https://docs.astral.sh/uv/) (`winget install astral-sh.uv` on Windows, `brew install uv` on macOS),
|
|
14
|
+
which also fetches Python.
|
|
15
|
+
|
|
16
|
+
The desktop app (downloads Qt, about 150 MB, the first time):
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
uv tool install "sparknh-reader[desktop] @ git+https://github.com/GTNewHorizons/SparkNH-Reader"
|
|
20
|
+
sparknh-reader-desktop
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
At its first start it offers to add itself to the Start menu (Windows) or the app menu (Linux).
|
|
24
|
+
`sparknh-reader-desktop LINK_OR_FILE` opens that profile straight away. On Linux, Qt needs `libxcb-cursor0`.
|
|
25
|
+
|
|
26
|
+
The command line only, nothing to install:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
uvx --from git+https://github.com/GTNewHorizons/SparkNH-Reader sparknh-reader summary https://spark.lucko.me/XXXXXXXXXX
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Commands
|
|
33
|
+
|
|
34
|
+
| Command | What it does |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `summary SOURCE` | The report: setup, findings, worst minutes, entities, where the time goes; for a heap summary, what fills memory |
|
|
37
|
+
| `tree SOURCE METHOD` | What a method calls, all its call sites merged |
|
|
38
|
+
| `callers SOURCE METHOD` | Who calls a method |
|
|
39
|
+
| `compare EARLIER LATER` | What grew between two heap summaries |
|
|
40
|
+
| `install-skill` | The `spark-profile` skill for Claude Code, Codex and OpenCode |
|
|
41
|
+
| `install-shortcut [--remove]` | The Start menu or app menu entry |
|
|
42
|
+
| `update [--check]` | Install the newest version, or only say whether there is one |
|
|
43
|
+
|
|
44
|
+
`--help` after any command lists its options.
|
|
45
|
+
|
|
46
|
+
## Settings and updates
|
|
47
|
+
|
|
48
|
+
The ⚙ button next to Load sets the theme, the text size and the keys, adds or removes the menu entry, and installs
|
|
49
|
+
the skill for coding agents. Changes apply at once and are kept in `config.toml` in the user's config folder (`%LOCALAPPDATA%\sparknh-reader` on
|
|
50
|
+
Windows, `~/.config/sparknh-reader` on Linux, `~/Library/Application Support/sparknh-reader` on macOS):
|
|
51
|
+
|
|
52
|
+
```toml
|
|
53
|
+
theme = "nord" # a Textual theme name (textual-dark, nord, dracula, gruvbox, ...), or "system"
|
|
54
|
+
font_size = 12 # points
|
|
55
|
+
check_updates = false # don't look for a newer version at start
|
|
56
|
+
[keys]
|
|
57
|
+
spark_callers = "k" # an action id from src/sparknh_reader/keys.py -> its letter
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
At start, at most once a day, the app looks for a newer version (on PyPI once it's published there, else in the
|
|
61
|
+
GitHub releases) and offers it in a bar: What's new, Update, or Skip this version.
|
|
62
|
+
|
|
63
|
+
- **Update** works for a `uv tool install`: the app closes, installs the new version the same way, and starts
|
|
64
|
+
again. If that fails, the next start shows uv's log.
|
|
65
|
+
- **Any other install** (a checkout, pip, uvx) shows the command to run instead.
|
|
66
|
+
|
|
67
|
+
## Development
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
uv sync --extra desktop
|
|
71
|
+
uv run pytest
|
|
72
|
+
uv run ruff check . && uv run ruff format --check .
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
- **PyCharm:** run configurations in `.run/`: Desktop UI, Summary (asks for a link or file) and Tests.
|
|
76
|
+
- **`scripts/gen_mod_packages.py`:** regenerates the package → mod table from a pack's jars.
|
|
77
|
+
- **`scripts/gen_icon.py`:** regenerates `icons/icon.ico`, the Windows shortcut's icon, from `icons/icon.svg`.
|
|
78
|
+
|
|
79
|
+
## Releasing
|
|
80
|
+
|
|
81
|
+
CI (`.github/workflows/build-and-test.yml`) lints and tests every push and pull request on Windows, Linux and
|
|
82
|
+
macOS.
|
|
83
|
+
|
|
84
|
+
To release, push a tag named as the version, as GTNH mods do: `1.0.0`, or `1.1.0-pre` / `1.1.0rc1` for a
|
|
85
|
+
prerelease. The tag must be a [PEP 440](https://peps.python.org/pep-0440/) version, so `-snapshot` doesn't work.
|
|
86
|
+
|
|
87
|
+
- **What happens:** `release-tags.yml` builds the wheel with that version and attaches it to a GitHub release.
|
|
88
|
+
- **Release notes:** from `.changelogs/<tag>.md` when it exists, else GitHub generates them.
|
|
89
|
+
- **`pyproject.toml`:** its version only matters for builds between releases.
|
|
90
|
+
|
|
91
|
+
Publishing to PyPI is ready but switched off until the repo variable `PUBLISH_PYPI` is `true`. That needs PyPI's
|
|
92
|
+
trusted publishing set up first, for this repo, `release-tags.yml` and a `pypi` environment.
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
LGPL-3.0-only.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "sparknh-reader"
|
|
3
|
+
version = "0.1.0rc4"
|
|
4
|
+
description = "Read spark profiles (spark.lucko.me) of GT New Horizons servers and clients as text reports and in a desktop UI"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "LGPL-3.0-only"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
requires-python = ">=3.12"
|
|
9
|
+
dependencies = [
|
|
10
|
+
"platformdirs>=4.14.5",
|
|
11
|
+
"typer>=0.29.1",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[project.urls]
|
|
15
|
+
Repository = "https://github.com/GTNewHorizons/SparkNH-Reader"
|
|
16
|
+
|
|
17
|
+
[project.scripts]
|
|
18
|
+
sparknh-reader = "sparknh_reader.cli:app"
|
|
19
|
+
|
|
20
|
+
[project.gui-scripts]
|
|
21
|
+
sparknh-reader-desktop = "sparknh_reader.qt.app:main"
|
|
22
|
+
|
|
23
|
+
[project.optional-dependencies]
|
|
24
|
+
desktop = [
|
|
25
|
+
"pyside6-essentials>=6.12.0",
|
|
26
|
+
"textual>=8.2.8",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[build-system]
|
|
30
|
+
requires = ["uv_build>=0.11,<0.12"]
|
|
31
|
+
build-backend = "uv_build"
|
|
32
|
+
|
|
33
|
+
[tool.ruff]
|
|
34
|
+
line-length = 120
|
|
35
|
+
src = ["src"]
|
|
36
|
+
|
|
37
|
+
[tool.ruff.lint]
|
|
38
|
+
select = [
|
|
39
|
+
"E",
|
|
40
|
+
"W",
|
|
41
|
+
"F",
|
|
42
|
+
"I",
|
|
43
|
+
"UP",
|
|
44
|
+
"B",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[tool.pytest.ini_options]
|
|
48
|
+
testpaths = ["tests"]
|
|
49
|
+
|
|
50
|
+
[dependency-groups]
|
|
51
|
+
dev = [
|
|
52
|
+
"pytest>=9.2.0",
|
|
53
|
+
"ruff>=0.17.5",
|
|
54
|
+
]
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "sparknh-reader"
|
|
3
|
+
version = "0.1.0rc4"
|
|
4
|
+
description = "Read spark profiles (spark.lucko.me) of GT New Horizons servers and clients as text reports and in a desktop UI"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "LGPL-3.0-only"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
requires-python = ">=3.12"
|
|
9
|
+
dependencies = [
|
|
10
|
+
"platformdirs>=4.14.5",
|
|
11
|
+
"typer>=0.29.1",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[project.urls]
|
|
15
|
+
Repository = "https://github.com/GTNewHorizons/SparkNH-Reader"
|
|
16
|
+
|
|
17
|
+
[project.scripts]
|
|
18
|
+
sparknh-reader = "sparknh_reader.cli:app"
|
|
19
|
+
|
|
20
|
+
[project.gui-scripts]
|
|
21
|
+
sparknh-reader-desktop = "sparknh_reader.qt.app:main" # needs the desktop extra
|
|
22
|
+
|
|
23
|
+
[project.optional-dependencies]
|
|
24
|
+
desktop = [
|
|
25
|
+
"pyside6-essentials>=6.12.0",
|
|
26
|
+
"textual>=8.2.8", # the theme colours: Textual's built-in themes
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[build-system]
|
|
30
|
+
requires = ["uv_build>=0.11,<0.12"]
|
|
31
|
+
build-backend = "uv_build"
|
|
32
|
+
|
|
33
|
+
[tool.ruff]
|
|
34
|
+
line-length = 120
|
|
35
|
+
src = ["src"]
|
|
36
|
+
|
|
37
|
+
[tool.ruff.lint]
|
|
38
|
+
select = ["E", "W", "F", "I", "UP", "B"]
|
|
39
|
+
|
|
40
|
+
[tool.pytest.ini_options]
|
|
41
|
+
testpaths = ["tests"]
|
|
42
|
+
|
|
43
|
+
[dependency-groups]
|
|
44
|
+
dev = [
|
|
45
|
+
"pytest>=9.2.0",
|
|
46
|
+
"ruff>=0.17.5",
|
|
47
|
+
]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""The spark reader: spark.lucko.me profiles as text reports and a desktop window, GTNH-aware.
|
|
2
|
+
|
|
3
|
+
It imports nothing of the app around it: a host passes its name and cache folder with configure().
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from collections.abc import Callable
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
_app_name = "sparknh-reader"
|
|
10
|
+
_cache_dir: Callable[[], Path] | None = None
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def configure(app_name: str, cache_dir: Path | Callable[[], Path]) -> None:
|
|
14
|
+
"""The name sent as User-Agent, and the folder for downloads and saved profiles (a path, or a function asked
|
|
15
|
+
each time)."""
|
|
16
|
+
global _app_name, _cache_dir
|
|
17
|
+
_app_name = app_name
|
|
18
|
+
_cache_dir = cache_dir if callable(cache_dir) else lambda: cache_dir
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def app_name() -> str:
|
|
22
|
+
return _app_name
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def cache_dir() -> Path:
|
|
26
|
+
if _cache_dir is not None:
|
|
27
|
+
return _cache_dir()
|
|
28
|
+
from platformdirs import user_cache_dir
|
|
29
|
+
|
|
30
|
+
return Path(user_cache_dir(_app_name, appauthor=False))
|