Miksus / rocketry

Modern scheduling library for Python
https://rocketry.readthedocs.io
MIT License
3.26k stars 105 forks source link

add: Custom arguments with custom cond #68

Closed Miksus closed 1 year ago

Miksus commented 2 years ago

Now one can pass arguments when using a custom condition.

Now this should work:

from pathlib import Path

@app.cond()
def file_exists(file):
    return Path(file).exists()

@app.task(file_exists("myfile.csv"))
def do_things():
    ...
codecov-commenter commented 1 year ago

Codecov Report

Base: 95.50% // Head: 95.50% // No change to project coverage :thumbsup:

Coverage data is based on head (aa6dadf) compared to base (9e3539b). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #68 +/- ## ======================================= Coverage 95.50% 95.50% ======================================= Files 88 88 Lines 4604 4604 ======================================= Hits 4397 4397 Misses 207 207 ``` | [Impacted Files](https://codecov.io/gh/Miksus/rocketry/pull/68?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mikael+Koli) | Coverage Δ | | |---|---|---| | [rocketry/conditions/func.py](https://codecov.io/gh/Miksus/rocketry/pull/68/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mikael+Koli#diff-cm9ja2V0cnkvY29uZGl0aW9ucy9mdW5jLnB5) | `89.58% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mikael+Koli). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Mikael+Koli)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.