7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-02 06:10:47 +00:00
tutor/tutor
Régis Behmo 33e4f33afe feat: strongly typed hooks
Now that the mypy bugs have been resolved, we are able to define more precisely
and cleanly the types of Actions and Filters.

Moreover, can now strongly type named actions and hooks (in consts.py). With
such a strong typing, we get early alerts of hooks called with incorrect
arguments, which is nothing short of awesome :)

This change breaks the hooks API by removing the `context=...` argument. The
reason for that is that we cannot insert arbitrary arguments between `P.args,
P.kwargs`: https://peps.python.org/pep-0612/#the-components-of-a-paramspec

> A function declared as def inner(a: A, b: B, *args: P.args, **kwargs:
> P.kwargs) -> R has type Callable[Concatenate[A, B, P], R]. Placing
> keyword-only parameters between the *args and **kwargs is forbidden.

Getting the documentation to build in nitpicky mode is quite difficult... We
need to add `nitpick_ignore` to the docs conf.py, otherwise sphinx complains
about many missing class references. This, despite upgrading almost all doc
requirements (except docutils).
2022-11-15 14:58:36 +01:00
..
commands feat: strongly typed hooks 2022-11-15 14:58:36 +01:00
hooks feat: strongly typed hooks 2022-11-15 14:58:36 +01:00
plugins feat: strongly typed hooks 2022-11-15 14:58:36 +01:00
templates feat: strongly typed hooks 2022-11-15 14:58:36 +01:00
__about__.py v14.1.2 (2022-11-02) 2022-11-02 10:42:55 +01:00
__init__.py Tutor v3 complete rewrite 2019-02-09 20:30:01 +01:00
bindmounts.py feat: add --mount option to local/dev 2022-04-20 19:33:17 +02:00
config.py feat: strongly typed hooks 2022-11-15 14:58:36 +01:00
env.py feat: strongly typed hooks 2022-11-15 14:58:36 +01:00
exceptions.py Tutor v3 complete rewrite 2019-02-09 20:30:01 +01:00
fmt.py feat: upgrade to Maple 2021-12-20 21:21:36 +01:00
images.py feat: migrate to plugins.v1 with filters & actions 2022-04-15 15:30:54 +02:00
interactive.py feat: introduce tutor dev quickstart 2022-04-19 16:53:57 +02:00
jobs.py feat: strongly typed hooks 2022-11-15 14:58:36 +01:00
py.typed feat: add py.typed for typing extensions 2022-10-26 12:28:16 +02:00
serialize.py fix: YamlParamType supports line terminators 2021-04-25 09:14:21 +02:00
types.py feat: strongly typed hooks 2022-11-15 14:58:36 +01:00
utils.py fix: print proper command on check_output 2022-10-26 16:46:04 +02:00