✨ Schedule roadmap + discussion
Hey folks 👋
Progress on schedule has been kinda stale for a while now and I'd like to kick things into gear again.
We've had a bunch of open issues and PRs that I'm triaging right now. Thanks to everyone who helped out answering usage and how-to questions, I really appreciate it! 😊
I've created this issue so we can discuss next steps for another schedule release in November.
We have a bunch of PRs cooking at the moment and some of them I think would make good additions.
However, one thing I want to avoid is growing schedule "randomly" by adding half-baked or too niche features. I think people like schedule because its interface is simple and straight-forward.
I'm worried schedule will lose its simplicity.
I don't think we should build another APScheduler or a replacement for Cron.
That's definitely something that will be tough to balance and I'd love to hear your opinions on that topic as well 😃 .
I also think there are some must do's that we should tackle in the next release. For me those include:
- [x] Fix the CI build (done in #79)
- [x] Adding Wheel support for faster installs from PyPI
- [x] Setting up proper docs and expanding the FAQ (see #4). This will help keep questions like "how can I cancel jobs?" under control.
Again I'd love to hear input on that, please fire away 😃
I've also toyed with the idea of setting up a Gitter chat room for schedule. I've seen this working well on other projects and I'd be happy to set it up if there's enough interest in it.
Pinging everyone who's been active in 2016: @510908220 @AdamRi @alaingilbert @Aluriak @frispete @grampajoe @invl @jmdevince @jmpesp @laubed @mbattifarano @Michael-F-Bryan @msoedov @r0fls @seemethere @Zerrossetto
(Apologies if I missed anyone.)
For in-flight PRs that would be nice and easy to include in the next release I've created a 0.4.0 milestone
If you want to contribute I'd appreciate some help with fleshing out the Sphinx-based docs further. More info on that in #4.
Here's a quick preview: https://schedule.readthedocs.io/en/latest/api.html (these are auto-generated from the Python source so we mainly need to improve the docstrings)
A chat room for schedule is a nice idea but i would go with a standard IRC channel on a public server because it's simpler, doesn't explicitly need a registration and is a pretty common way for open source projects to communicate.
+1 for gitter.
+1 for gitter as well. Easy to setup and use.
gitter would be ok. Also for:
This will help keep questions like "how can I cancel jobs?" under control.
I noticed that the What if my task throws an exception? may conflict with How can I run a job only once?. The wrapping function
import functools
def catch_exceptions(job_func):
@functools.wraps(job_func)
def wrapper(*args, **kwargs):
try:
job_func(*args, **kwargs)
except:
import traceback
print(traceback.format_exc())
return wrapper
Should change to
import functools
import schedule
def catch_exceptions(job_func, cancel_on_failure=False):
@functools.wraps(job_func)
def wrapper(*args, **kwargs):
try:
return job_func(*args, **kwargs)
except:
import traceback
print(traceback.format_exc())
if cancel_on_failure:
return schedule.CancelJob
return wrapper
@catch_exceptions(cancel_on_failure=True)
def bad_task():
return 1 / 0
Great catch @Zerrossetto – mind creating a PR to update the docs? Otherwise I can do it later today.
I'm also going to set up Gitter soon.
I corrected the documentation on the pull request #102
FYI I just released schedule 0.4.0 with the following changes:
- Add proper HTML (Sphinx) docs available at https://schedule.readthedocs.io/
- CI builds now run against Python 2.7 and 3.5 (3.3 and 3.4 should work fine but are untested)
- Fixed an issue with
run_all()and having more than one job that deletes itself in the same iteration. Thanks @alaingilbert. - Add ability to tag jobs and to cancel jobs by tag. Thanks @Zerrossetto.
- Improve schedule docs. Thanks @Zerrossetto.
- Additional docs fixes by @fkromer and @yetingsky.
Thanks everyone!
edit: Make that schedule 0.4.1, there was an issue with README.rst not rendering correctly on PyPI. All good now.
@Zerrossetto
Hi! I just installed schedule and started playing with it. So sorry if I sound very naive but when I run this:
import schedule
def catch_exceptions(job_func, cancel_on_failure=False):
@functools.wraps(job_func)
def wrapper(*args, **kwargs):
try:
return job_func(*args, **kwargs)
except:
import traceback
print(traceback.format_exc())
if cancel_on_failure:
return schedule.CancelJob
return wrapper
@catch_exceptions(cancel_on_failure=True)
def bad_task():
return 1 / 0
...I get this:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: catch_exceptions() missing 1 required positional argument: 'job_func'
Why is 'job_func' missing in the bad_task()'s catch_exception decorator? In the 'What if my task throws and exception' section found in the documentation it says:
If you want to guard against exceptions you can wrap your job function in a decorator like this ...
What would be my job function? I thought bad_task() would be my job function. I am probably missing something very obvious or something that goes beyond my limited understanding of Python. Any tip would be greatly appreciated. Thanks!
Hi, it doesn't work for you because I messed up with the documentation. Try this:
def catch_exceptions(cancel_on_failure=False):
def catch_exceptions_decorator(job_func):
@functools.wraps(job_func)
def wrapper(*args, **kwargs):
try:
return job_func(*args, **kwargs)
except:
import traceback
print(traceback.format_exc())
if cancel_on_failure:
return schedule.CancelJob
return wrapper
return catch_exceptions_decorator
@catch_exceptions(cancel_on_failure=True)
def bad_task():
return 1 / 0
Thanks @Zerrossetto !
Are there any plans to integrate run_continuously into your original schedule? I'm thinking of using your library in my Telegram bot, however, I need to run scheduler separately from the bot itself
Hi there! It seems like this roadmap has reached its destination.
Continue reading about the future in #412 :rocket: