Skip to content

Commit 9b7deb4

Browse files
authored
fix documentation build failure, fix sphinx errors and amend sphinx warnings (#332)
* fix documentation build failure, fix sphinx errors and amend sphinx warnings Signed-off-by: Oleg Hoefling <oleg.hoefling@ionos.com> * add celery to doc build requirements Signed-off-by: Oleg Hoefling <oleg.hoefling@ionos.com> * use pypi ref for django-celery-beat Signed-off-by: Oleg Hoefling <oleg.hoefling@ionos.com> * fix flake8 complaining Signed-off-by: Oleg Hoefling <oleg.hoefling@ionos.com> * switch pydocstyle to use google convention for param field lists Signed-off-by: Oleg Hoefling <oleg.hoefling@ionos.com>
1 parent 7cf6f70 commit 9b7deb4

File tree

9 files changed

+37
-39
lines changed

9 files changed

+37
-39
lines changed

.readthedocs.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
build:
3+
os: ubuntu-20.04
4+
tools:
5+
python: "3.8"
6+
sphinx:
7+
configuration: docs/conf.py
8+
python:
9+
install:
10+
- requirements: requirements/docs.txt

Changelog

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
:release-date: 2022-04-17 12:50 P.M. UTC+6:00
2424
:release-by: Asif Saif Uddin
2525

26-
- Remove hard dependency on psycopg2.
26+
- Remove hard dependency on psycopg2.
2727
- Fix #296 Stop producing a universal wheel, python 2 is unspported.
2828
- fix: The description content type for setuptools needs to be rst to markdown.
2929

@@ -35,10 +35,10 @@
3535
:release-date: 2022-03-01 1:45 p.m. UTC+6:00
3636
:release-by: Asif Saif Uddin
3737

38-
- Fix default_app_config deprecation (#221)
38+
- Fix default_app_config deprecation (#221)
3939
- Use string values for django-cache keys #230 (#242)
4040
- feat: raw delete expired instead of Queryset.delete (#235)
41-
- Fix `pydoc.ErrorDuringImport: problem in django_celery_results url
41+
- Fix ``pydoc.ErrorDuringImport`` problem in django_celery_results url
4242
- Russian language support (#255)
4343
- Add Simplified Chinese translation strings.
4444
- Minor code clean up
@@ -59,8 +59,8 @@
5959
:release-date: 2021-07-02 11:00 a.m. UTC+6:00
6060
:release-by: Asif Saif Uddin
6161

62-
- add new urls with nouns first structure (#216)
63-
- Remove duplicate indexes
62+
- add new urls with nouns first structure (#216)
63+
- Remove duplicate indexes
6464
- fix group status view return data, add tests for it (#215)
6565
- typo fix (#218)
6666
- Use the DJANGO_CELERY_RESULTS_TASK_ID_MAX_LENGTH for group_id/task_id
@@ -73,7 +73,7 @@
7373
:release-date: 2021-06-14 09:00 p.m. UTC+6:00
7474
:release-by: Asif Saif Uddin
7575

76-
- Don't raise an error when ChordCounter is not found
76+
- Don't raise an error when ChordCounter is not found
7777
- add default_auto_field to apps.py
7878
- Use the provided chord_size when available
7979
- Match apply_chord call signature to Celery 5.1
@@ -85,20 +85,20 @@
8585
2.0.1
8686
=====
8787
:release-date: 2021-01-19 07:30 p.m. UTC+6:00
88-
:release-by:
88+
:release-by:
8989

9090
- Fix backward compatibility in DatabaseBackend._store_result function
9191
- Fix 'args' and 'kwargs' propiertes of AsyncResult for DatabaseBackend
9292
- Fix task_args/task_kwargs in task_protocol=1
9393
- Test refactors
94-
- Add task_args and task_kwargs to admins searchable fields (#182)
94+
- Add task_args and task_kwargs to admins searchable fields (#182)
9595

9696
.. _version-2.0.0:
9797

9898
2.0.0
9999
=====
100-
:release-date:
101-
:release-by:
100+
:release-date:
101+
:release-by:
102102

103103
- Add Spanish translations (#134)
104104
- Add support for Django 3.0 and 3.1 (#145, #163)

django_celery_results/managers.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ def transaction_retry(max_retries=1):
2929
retrying if the operation fails.
3030
3131
Keyword Arguments:
32-
-----------------
3332
max_retries (int): Maximum number of retries. Default one retry.
3433
3534
"""
@@ -92,15 +91,14 @@ def delete_expired(self, expires):
9291

9392

9493
class TaskResultManager(ResultManager):
95-
"""Manager for :class:`celery.models.TaskResult` models."""
94+
"""Manager for :class:`~.models.TaskResult` models."""
9695

9796
_last_id = None
9897

9998
def get_task(self, task_id):
10099
"""Get result for task by ``task_id``.
101100
102101
Keyword Arguments:
103-
-----------------
104102
exception_retry_count (int): How many times to retry by
105103
transaction rollback on exception. This could
106104
happen in a race condition if another worker is trying to
@@ -125,7 +123,6 @@ def store_result(self, content_type, content_encoding,
125123
"""Store the result and status of a task.
126124
127125
Arguments:
128-
---------
129126
content_type (str): Mime-type of result and meta content.
130127
content_encoding (str): Type of encoding (e.g. binary/utf-8).
131128
task_id (str): Id of task.
@@ -145,7 +142,6 @@ def store_result(self, content_type, content_encoding,
145142
children).
146143
147144
Keyword Arguments:
148-
-----------------
149145
exception_retry_count (int): How many times to retry by
150146
transaction rollback on exception. This could
151147
happen in a race condition if another worker is trying to
@@ -175,15 +171,14 @@ def store_result(self, content_type, content_encoding,
175171

176172

177173
class GroupResultManager(ResultManager):
178-
"""Manager for :class:`celery.models.GroupResult` models."""
174+
"""Manager for :class:`~.models.GroupResult` models."""
179175

180176
_last_id = None
181177

182178
def get_group(self, group_id):
183179
"""Get result for group by ``group_id``.
184180
185181
Keyword Arguments:
186-
-----------------
187182
exception_retry_count (int): How many times to retry by
188183
transaction rollback on exception. This could
189184
happen in a race condition if another worker is trying to

django_celery_results/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@ class ChordCounter(models.Model):
157157
)
158158

159159
def group_result(self, app=None):
160-
"""Return the GroupResult of self.
160+
"""Return the :class:`celery.result.GroupResult` of self.
161161
162162
Arguments:
163-
---------
164-
app (Celery): app instance to create the GroupResult with.
163+
app (celery.app.base.Celery): app instance to create the
164+
:class:`celery.result.GroupResult` with.
165165
166166
"""
167167
return CeleryGroupResult(

docs/copyright.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Copyright |copy| 2016, Ask Solem
1111

1212
All rights reserved. This material may be copied or distributed only
1313
subject to the terms and conditions set forth in the `Creative Commons
14-
Attribution-ShareAlike 4.0 International`
14+
Attribution-ShareAlike 4.0 International
1515
<http://creativecommons.org/licenses/by-sa/4.0/legalcode>`_ license.
1616

1717
You may share and adapt the material, even for commercial purposes, but

docs/getting_started.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,9 @@ To use :pypi:`django-celery-results` with your project you need to follow these
5454
'LOCATION': 'my_cache_table',
5555
}
5656
}
57-
58-
If you want to include extended information about your tasks remember to enable the `result_extended` setting.
59-
More information here: https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-extended
60-
57+
58+
If you want to include extended information about your tasks remember to enable the :setting:`result_extended` setting.
59+
6160
.. code-block:: python
62-
63-
CELERY_RESULT_EXTENDED = True
6461
62+
CELERY_RESULT_EXTENDED = True

docs/includes/introduction.txt

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,14 @@ About
99

1010
This extension enables you to store Celery task and group results using the Django ORM.
1111

12-
It defines 2 models (``django_celery_results.models.TaskResult`` and ``django_celery_results.models.GroupResult``)
12+
It defines 2 models (:class:`django_celery_results.models.TaskResult` and :class:`django_celery_results.models.GroupResult`)
1313
used to store task and group results, and you can query these database tables like
1414
any other Django model.
1515

16-
If your `django-celery-beat` carries `request["properties"]["periodic_task_name"]`,
17-
it will be stored in `TaskResult.periodic_task_name` to track the periodic task.
16+
If your :pypi:`django-celery-beat` carries ``request["properties"]["periodic_task_name"]``,
17+
it will be stored in :attr:`TaskResult.periodic_task_name <django_celery_results.models.TaskResult.periodic_task_name>` to track the periodic task.
1818

1919
Installing
2020
==========
2121

22-
The installation instructions for this extension is available
23-
from the `Celery documentation`_:
24-
25-
http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html#django-celery-results-using-the-django-orm-cache-as-a-result-backend
26-
27-
28-
.. _`Celery documentation`:
29-
http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html#django-celery-results-using-the-django-orm-cache-as-a-result-backend
22+
The installation instructions for this extension is available from the :ref:`Celery documentation <django-celery-results>`.

requirements/docs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
sphinx_celery>=1.1
22
Django>=2.2
3+
celery>=5.2.3,<6.0

setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ markers =
1212
ignore = N806, N802, N801, N803
1313

1414
[pep257]
15-
ignore = D102,D104,D203,D105,D213
15+
convention=google
16+
add-ignore = D102,D104,D203,D105,D213
1617
match-dir = [^migrations]
1718

1819
[isort]

0 commit comments

Comments
 (0)