Skip to content

Commit de83f65

Browse files
committed
Initial linting/formatting/type fixes
1 parent c7a81a1 commit de83f65

29 files changed

Lines changed: 5589 additions & 5158 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ jobs:
5050
PROD_KEYS: ${{ secrets.PROD_KEYS }}
5151
run: $env:PROD_KEYS | Out-File prod.keys
5252
- name: Build basic NSP forwarder
53-
run: uv run nton build "sdl-hello.nro" --name "Hello World" --publisher "vgmoose" --version "1.1" --sdmc "/switch/sdl-hello.nro"
53+
run: uv run nton build "sdl-hello.nro" --name "Hello World" --publisher "vgmoose" --version "1.1" --sdmc "/switch/sdl-hello.nro"

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
33

4+
exclude: |
5+
(?x)^(
6+
nton/gui/main\.py|
7+
nton/gui/resources/icons_rc\.py
8+
)$
49
repos:
510
- repo: https://github.com/astral-sh/ruff-pre-commit
611
rev: v0.14.13
712
hooks:
813
- id: ruff-check
914
language: system
1015
types: [ python ]
16+
- id: ruff-format
17+
language: system
18+
types: [ python ]
1119
- repo: https://github.com/pre-commit/mirrors-mypy
1220
rev: v1.19.1
1321
hooks:

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
"ms-python.isort",
88
"ms-python.mypy-type-checker"
99
]
10-
}
10+
}

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4141
- Special characters like "é" etc. are no longer garbled in the built NSP. This was a bug when HacBrewPack set the
4242
name and publisher, yet that was never intended anyway. Now NTON itself fully manages setting the Name and Publisher.
4343
- Multiple language data being included but with missing data is now fixed. Only AmericanEnglish is enabled, and only
44-
AmericanEnglish has language data. Similarly to the previous issue, this was caused by HacBrewPack in the same way.
44+
AmericanEnglish has language data. Similarly to the previous issue, this was caused by HacBrewPack in the same way.
4545

4646
## [2.0.1] - 2023-08-26
4747

@@ -114,7 +114,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
114114

115115
### Fixed
116116

117-
- Fixed API call within `get_game_title_ids()`, though it still sometimes errors with HTTP 500.
117+
- Fixed API call within `get_game_title_ids()`, though it still sometimes errors with HTTP 500.
118118

119119
## [1.2.2] - 2023-04-20
120120

@@ -137,7 +137,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
137137
folders, or `atmosphere` & `bootloader` folders. This is much more reliable than simply assuming any drive that
138138
isn't the C drive to be your microSD card.
139139
- The NRO path is no longer forced to be within `/retroarch/cores` when `--rom` is used. This is to allow use of
140-
`--rom` with other Homebrew, e.g., MGBA.
140+
`--rom` with other Homebrew, e.g., MGBA.
141141

142142
### Fixed
143143

README.md

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ There are numerous reasons why this could be, see the following main reasons:
198198
forwarder has a hardcoded file path that it loads the NRO from when launched.
199199
2. You may have since updated Atmosphere or your Firmware which broke the changes you made to the bootloader that enabled
200200
the use of custom NSP files. As this project does not support piracy on any Nintendo system, support is not provided.
201-
4. It's possible a firmware update has broken the Forwarder ROM binary (source under /rom in this repo) and needs
202-
to be re-compiled against a newer libnx / devkitpro version. Firmware 9.0.0, 12.0.0, 19.0.0, and 21.0.0 have previously
201+
3. It's possible a firmware update has broken the Forwarder ROM binary (source under /rom in this repo) and needs
202+
to be re-compiled against a newer libnx / devkitpro version. Firmware 9.0.0, 12.0.0, 19.0.0, and 21.0.0 have previously
203203
broken different forwarder ROMs requiring updates. If you believe this to be the case then please make an Issue.
204204

205205
If after reading all of these troubleshooting steps, you still cannot get the NSP forwarder to work, then I do not
@@ -208,30 +208,19 @@ recommend the use of them and instead recommend using the Homebrew launcher from
208208

209209
## Development
210210

211-
The following steps are basic instructions on downloading and working on the code under a [Poetry] environment.
211+
1. Install [uv]
212+
2. `uv sync --all-extras --all-groups`
213+
3. `.venv\Scripts\activate` (or `source .venv/bin/activate` on macOS and Linux)
214+
4. `uv tool install pre-commit --with pre-commit-uv --force-reinstall`
215+
5. `pre-commit install`
212216

213-
1. Follow Poetry's Docs to [Install Poetry].
214-
2. Download NTON's latest code, `git clone https://github.com/rlaphoenix/nton`
215-
3. Navigate to the downloaded code repository, `cd nton`
216-
4. _Optionally_ have Poetry install the virtual-env in the project, `poetry config virtualenvs.in-project true`
217-
5. Install NTON's dependencies and development tools, `poetry install -E gui`
218-
6. Run NTON from within the Poetry venv, `poetry run nton --help`
217+
Now feel free to work on the project however you like, all code will be checked before committing.
218+
You can run nton with the GUI with `nton` or without the GUI with `nton --help`.
219219

220-
> [!NOTE]
221-
> If you plan to work on or use the GUI during development, then add `-E gui` during Step 5.
222-
223-
As shown, running the `nton` executable is somewhat different to a normal installation. This is because Poetry installs
224-
all dependencies and the `nton` shim itself within a virtual-environment, which is like a clone of your Python install
225-
stripped clean, with only NTON's dependencies installed. That way you don't mess around with any dependencies from any
226-
other installed Python applications, nor the other way around. A secluded environment.
227-
228-
I recommend taking a look at [Poetry's Docs] for further information, why not get started by reading Poetry's guide on
229-
[Using Your Virtual Environment].
220+
If you make any changes to the QT UI file (main.ui) or any of the icon/image files, then you must
221+
run `.\make` to re-compile them to Python files.
230222

231-
[Poetry]: <https://python-poetry.org>
232-
[Install Poetry]: <https://python-poetry.org/docs/#installation>
233-
[Poetry's Docs]: <https://python-poetry.org/docs>
234-
[Using Your Virtual Environment]: <https://python-poetry.org/docs/basic-usage/#using-your-virtual-environment>
223+
[uv]: <https://docs.astral.sh/uv>
235224

236225
## Credit
237226

make.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
pyside6-rcc nton\gui\resources\icons.qrc -o nton\gui\resources\icons_rc.py
3+
pyside6-uic nton\gui\main.ui -o nton\gui\main.py --absolute-imports --python-paths "."

make.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env sh
2+
pyside6-rcc nton/gui/resources/icons.qrc -o nton/gui/resources/icons_rc.py
3+
pyside6-uic nton/gui/main.ui -o nton/gui/main.py --absolute-imports --python-paths "."

nton/assets/game_title_ids.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

nton/bin/hacbrewpack.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,4 +336,4 @@ This General Public License does not permit incorporating your program into
336336
proprietary programs. If your program is a subroutine library, you may
337337
consider it more useful to permit linking proprietary applications with the
338338
library. If this is what you want to do, use the GNU Lesser General
339-
Public License instead of this License.
339+
Public License instead of this License.

nton/bin/hptnacp-hacpack.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,4 +336,4 @@ This General Public License does not permit incorporating your program into
336336
proprietary programs. If your program is a subroutine library, you may
337337
consider it more useful to permit linking proprietary applications with the
338338
library. If this is what you want to do, use the GNU Lesser General
339-
Public License instead of this License.
339+
Public License instead of this License.

0 commit comments

Comments
 (0)