Skip to content

Commit 4a77963

Browse files
authored
Fix type checking for pytask.mark.x. (#432)
1 parent 1966b16 commit 4a77963

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

docs/source/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask) and
5050
exception. Now, it is easy to see which tasks are affected.
5151
- {pull}`430` updates some parts of the documentation.
5252
- {pull}`431` enables colors for WSL.
53+
- {pull}`432` fixes type checking of `pytask.mark.xxx`.
5354

5455
## 0.3.2 - 2023-06-07
5556

src/_pytask/mark/__init__.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ from _pytask.mark.expression import Expression
55
from _pytask.mark.expression import ParseError
66
from _pytask.mark.structures import Mark
77
from _pytask.mark.structures import MarkDecorator
8-
from _pytask.mark.structures import MarkGenerator
98
from _pytask.tree_util import PyTree
109

1110
from _pytask.session import Session
@@ -14,7 +13,7 @@ import networkx as nx
1413
def select_by_keyword(session: Session, dag: nx.DiGraph) -> set[str]: ...
1514
def select_by_mark(session: Session, dag: nx.DiGraph) -> set[str]: ...
1615

17-
class MARK_GEN: # noqa: N801
16+
class MarkGenerator:
1817
@deprecated(
1918
"'@pytask.mark.produces' is deprecated starting pytask v0.4.0 and will be removed in v0.5.0. To upgrade your project to the new syntax, read the tutorial on product and dependencies: https://tinyurl.com/yrezszr4.", # noqa: E501, PYI053
2019
category=FutureWarning,
@@ -42,6 +41,9 @@ class MARK_GEN: # noqa: N801
4241
kwargs: dict[Any, Any] | None = None,
4342
produces: PyTree[Any] = None,
4443
) -> None: ...
44+
def __getattr__(self, name: str) -> MarkDecorator | Any: ...
45+
46+
MARK_GEN = MarkGenerator()
4547

4648
__all__ = [
4749
"Expression",

0 commit comments

Comments
 (0)