6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-11-13 08:46:34 +00:00
tutor/requirements
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
..
base.in fix: incompatible deprecated click versions 2021-07-03 11:08:27 +02:00
base.txt feat: strongly typed hooks 2022-11-15 14:58:36 +01:00
dev.in feat: strongly typed hooks 2022-11-15 14:58:36 +01:00
dev.txt feat: strongly typed hooks 2022-11-15 14:58:36 +01:00
docs.in docs: generate reference docs automatically 2021-10-14 12:59:57 +02:00
docs.txt feat: strongly typed hooks 2022-11-15 14:58:36 +01:00
plugins.txt depr: richie plugin is no longer official 2022-09-30 12:09:31 +02:00