-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f2f96fd
commit fcc9d5b
Showing
8 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ install | |
.venv | ||
__pycache__ | ||
*.pyc | ||
*.egg-info | ||
|
||
# IDEs / editors | ||
.idea | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Python Development Support Files | ||
|
||
This directory contains support files for developing Python demos: | ||
|
||
- `requirements.txt`: | ||
Requirements for development. Contains dependency for `ruff` (linter & formatter), `mypy` (type checker) | ||
and `workbench-typestubs` (typestubs for the `workbench` module). All of these are also installed | ||
in the `re.sonny.Workbench.Devel` Flatpak (TODO: not true yet, see below.) | ||
- `mypy.ini`: | ||
Rules for `mypy` used for all demos. | ||
- `workbench-typestubs`: | ||
Python package containing typestubs for the `workbench` package which is available to demos and | ||
implements the Workbench API. | ||
|
||
## Run type checks. | ||
|
||
```sh | ||
cd python-aux | ||
pip3 install -r requirements.txt | ||
cd .. | ||
# Check single file: | ||
mypy --config-file python-aux/mypy.ini src/Welcome/main.py | ||
# Check all: | ||
mypy --config-file python-aux/mypy.ini src | ||
``` | ||
|
||
## TODO | ||
|
||
TODO: All requirements should be in the Devel Flatpak, but unsure how the | ||
typestub itself could be added there...? We might need to put that in an extra repo and add it | ||
as a module to the Devel Flatpak. Ruff is already in there. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[mypy] | ||
warn_unused_configs = True | ||
explicit_package_bases = True | ||
namespace_packages = True | ||
check_untyped_defs = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
./workbench-typestubs | ||
ruff>=0.3.0 | ||
pygobject-stubs>=2.11.0 --config-settings=config=Gtk4,Gdk4,GtkSource5 | ||
mypy>=1.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include workbench/py.typed | ||
recursive-include workbench *.pyi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[build-system] | ||
requires = ["setuptools"] # REQUIRED if [build-system] table is used | ||
build-backend = "setuptools.build_meta" # If not defined, then legacy behavior can happen. | ||
|
||
[project] | ||
name = "workbench-typestubs" | ||
version = "46.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from gi.repository import Gtk, Gio | ||
|
||
window: Gtk.Window | ||
builder: Gtk.Builder | ||
|
||
def resolve(self, path: str) -> Gio.File: | ||
... |
Empty file.