celery/celery — pull request #1133 by lorenabrams (2012-12-18 04:49:47+00:00)
Title: Add support for crontab range wrapping in Celerybeat scheduling configuration

This PR addresses issue: https://github.com/celery/celery/issues/1114

In sum, the following scheduling configuration would result in an error on Celerybeat instantiation as Celery does not yet deduce that a range should wrap around the parameter's max value:

```python
CELERYBEAT_SCHEDULE = {
'wrap-december-to-january': {
'task': 'some.task',
'schedule': crontab(month_of_year='10-2'),
}
```

This schedule implies that some.task should be executed for months 10-12 and 1-2. In other words, the range should wrap around month 12 (the max value for the month_of_year parameter) to month 1 (the minimum value for the month_of_year parameter). This PR provides such wrapping functionality and produces the desired value set: {1, 2, 10, 11, 12}

Also included in the PR is a bounds check that values provided in ranges do not exceed the max value for that parameter (12 if month_of_year, 59 if minute, 23 if hour, etc.).