Repository: celery/celery

Issue:
Building the documentation throws a variety of warnings
## Checklist

- [x] I have verified that the issue exists against the `master` branch of Celery.

## Steps to reproduce
On a fresh Ubuntu 18.04 system, clone the repo and follow the steps in CONTRIBUTING.rst to build the documentation files.

## Expected behavior
The docs should build without warnings as stipulated in CONTRIBUTING.rst

## Actual behavior
Warnings are thrown for a number of things, including:
- missing python packages and system packages.
- missing and mislabelled toctree entries
- ambiguous typehints in docstrings
- a link intended to show the `--port` option for `flower` instead links to the options list for the base `celery` command, which has no `--port` option if `flower` is not installed.
- there are also a few warnings which cannot be fixed with a PR on this project because they originate in kombu and sphinx_celery. i'm working on issues and PRs for those warnings also.


I recognize that this seems really nit-picky; I do think that some of these issues result in the docs being slightly less useful than they would otherwise be. Certainly as a whole they make it feel much more intimidating to try to contribute to the docs, which seems worth avoiding as well.


Discussion:

Resolving patch:
diff --git a/celery/app/base.py b/celery/app/base.py
--- a/celery/app/base.py
+++ b/celery/app/base.py
@@ -151,8 +151,9 @@ class Celery(object):
 
     Keyword Arguments:
         broker (str): URL of the default broker used.
-        backend (Union[str, type]): The result store backend class,
-            or the name of the backend class to use.
+        backend (Union[str, Type[celery.backends.base.Backend]]):
+            The result store backend class, or the name of the backend
+            class to use.
 
             Default is the value of the :setting:`result_backend` setting.
         autofinalize (bool): If set to False a :exc:`RuntimeError`
@@ -161,15 +162,17 @@ class Celery(object):
         set_as_current (bool):  Make this the global current app.
         include (List[str]): List of modules every worker should import.
 
-        amqp (Union[str, type]): AMQP object or class name.
-        events (Union[str, type]): Events object or class name.
-        log (Union[str, type]): Log object or class name.
-        control (Union[str, type]): Control object or class name.
-        tasks (Union[str, type]): A task registry, or the name of
+        amqp (Union[str, Type[AMQP]]): AMQP object or class name.
+        events (Union[str, Type[celery.app.events.Events]]): Events object or
+            class name.
+        log (Union[str, Type[Logging]]): Log object or class name.
+        control (Union[str, Type[celery.app.control.Control]]): Control object
+            or class name.
+        tasks (Union[str, Type[TaskRegistry]]): A task registry, or the name of
             a registry class.
         fixups (List[str]): List of fix-up plug-ins (e.g., see
             :mod:`celery.fixups.django`).
-        config_source (Union[str, type]): Take configuration from a class,
+        config_source (Union[str, class]): Take configuration from a class,
             or object.  Attributes may include any settings described in
             the documentation.
     """
diff --git a/celery/canvas.py b/celery/canvas.py
--- a/celery/canvas.py
+++ b/celery/canvas.py
@@ -110,7 +110,8 @@ class Signature(dict):
         :ref:`guide-canvas` for the complete guide.
 
     Arguments:
-        task (Task, str): Either a task class/instance, or the name of a task.
+        task (Union[Type[celery.app.task.Task], str]): Either a task
+            class/instance, or the name of a task.
         args (Tuple): Positional arguments to apply.
         kwargs (Dict): Keyword arguments to apply.
         options (Dict): Additional options to :meth:`Task.apply_async`.


Test patch: