Skip to content

Commit

Permalink
Merge e3700ca into de21e63
Browse files Browse the repository at this point in the history
  • Loading branch information
sontek committed Feb 24, 2021
2 parents de21e63 + e3700ca commit 21728cd
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
4.0.0
================
- Drop support for celery 3.0
- Drop support for Pyramid 2.7
- Error out if ini is misconfigured
- Add support for pyramid2
- Add support for pyramid v2
- Add support for celery v5
- Drop support for old CELERY config options,
use only the lower case versions.
- Added support for `options` in celerybeat.
- Added support for `broker_transport_options`

3.0.0
================
Expand Down
1 change: 1 addition & 0 deletions examples/scheduler_example/development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ schedule = 10
task = scheduler_example.tasks.get_date_2
type = crontab
schedule = {"minute": "*/1", "hour": "*"}
options = {"task_id" : "4445"}

[server:main]
use = egg:waitress#main
Expand Down
5 changes: 4 additions & 1 deletion pyramid_celery/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import json
import celery.loaders.base
import celery.schedules
import configparser
from celery import VERSION as celery_version
from six.moves import configparser
from pyramid.exceptions import ConfigurationError

from functools import partial
Expand Down Expand Up @@ -65,6 +65,9 @@ def get_beat_config(parser, section):
'schedule': schedule,
}

if has_option('options'):
config['options'] = safe_json(get, section, 'options')

if has_option('args'):
config['args'] = safe_json(get, section, 'args')

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
pyramid
celery
six
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
requires = ['pyramid', 'celery']

setup(name='pyramid_celery',
version='3.0.0',
version='4.0.0',
description='Celery integration with pyramid',
long_description=README + "\n" + CHANGES,
classifiers=[
Expand Down
1 change: 1 addition & 0 deletions tests/configs/dev.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ max_retries = 5
task = myapp.tasks.Task1
type = crontab
schedule = {"minute": 0}
options = {"task_id": "4446"}

[celerybeat:task2]
# Execute every 30 seconds
Expand Down
1 change: 1 addition & 0 deletions tests/test_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def test_basic_ini():
assert isinstance(schedule['task1']['schedule'], crontab)
assert isinstance(schedule['task2']['schedule'], datetime.timedelta)
assert isinstance(schedule['task4']['schedule'], int)
assert schedule['task1']['options'] == {'task_id': '4446'}
assert schedule['task2']['args'] == [16, 16]
assert schedule['task3']['kwargs'] == {"boom": "shaka"}

Expand Down

0 comments on commit 21728cd

Please sign in to comment.