schedule icon indicating copy to clipboard operation
schedule copied to clipboard

✨ Schedule roadmap + discussion

Open dbader opened this issue 10 years ago • 15 comments

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.

dbader avatar Nov 07 '16 10:11 dbader

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.)

dbader avatar Nov 07 '16 12:11 dbader

For in-flight PRs that would be nice and easy to include in the next release I've created a 0.4.0 milestone

dbader avatar Nov 07 '16 13:11 dbader

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)

dbader avatar Nov 07 '16 15:11 dbader

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.

dlux95 avatar Nov 08 '16 21:11 dlux95

+1 for gitter.

WoLfulus avatar Nov 08 '16 22:11 WoLfulus

+1 for gitter as well. Easy to setup and use.

seemethere avatar Nov 08 '16 23:11 seemethere

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

Zerrossetto avatar Nov 09 '16 06:11 Zerrossetto

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.

dbader avatar Nov 09 '16 09:11 dbader

I corrected the documentation on the pull request #102

Zerrossetto avatar Nov 09 '16 19:11 Zerrossetto

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.

dbader avatar Nov 28 '16 15:11 dbader

@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!

roperi avatar Dec 11 '16 14:12 roperi

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

Zerrossetto avatar Dec 11 '16 15:12 Zerrossetto

Thanks @Zerrossetto !

roperi avatar Dec 11 '16 21:12 roperi

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

MasterGroosha avatar Mar 22 '17 10:03 MasterGroosha

Hi there! It seems like this roadmap has reached its destination.

Continue reading about the future in #412 :rocket:

SijmenHuizenga avatar Jan 09 '21 00:01 SijmenHuizenga