Skip to content

Commit

Permalink
0.2.9 (#118)
Browse files Browse the repository at this point in the history
* ✨ Allow `requires` to be set by `__setattr__()`

* 🔖 0.2.9
  • Loading branch information
pwwang authored Dec 6, 2021
1 parent 9cea5e5 commit 33e1d13
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,4 @@ poetry.lock
t-*.ipynb
*-output/
*_results/
t.py
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.9

- ✨ Allow `requires` to be set by `__setattr__()`

## 0.2.8

- 🩹 Forward fill na for input data
Expand Down
9 changes: 8 additions & 1 deletion pipen/proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ def __repr__(cls) -> str:
"""Representation for the Proc subclasses"""
return f"<Proc:{cls.name}>"

def __setattr__(cls, name: str, value: Any) -> None:
if name == "requires":
value = cls._compute_requires(value)
return super().__setattr__(name, value)

def __call__(cls, *args: Any, **kwds: Any) -> "Proc":
"""Make sure Proc subclasses are singletons
Expand Down Expand Up @@ -274,7 +279,9 @@ def __init_subclass__(cls) -> None:
"""Do the requirements inferring since we need them to build up the
process relationship
"""
cls.requires = cls._compute_requires()
# cls.requires = cls._compute_requires()
# triggers cls.__setattr__() to compute requires
cls.requires = cls.requires
if cls.name is None or cls.name == cls.__bases__[0].name:
cls.name = cls.__name__
if cls.__doc__ is None:
Expand Down
2 changes: 1 addition & 1 deletion pipen/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Provide version of pipen"""

__version__ = "0.2.8"
__version__ = "0.2.9"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.masonry.api"

[tool.poetry]
name = "pipen"
version = "0.2.8"
version = "0.2.9"
description = "A pipeline framework for python"
authors = [ "pwwang <[email protected]>",]
license = "MIT"
Expand Down

0 comments on commit 33e1d13

Please sign in to comment.