Simplify `Tags` (#12490)

- Use a set to store the list of tags
- Cache evaluated expressions
- Extract locally-defined function into a private method
This commit is contained in:
Adam Turner
2024-06-29 10:21:23 +01:00
committed by GitHub
parent 3b3a7d911b
commit d2f1acc0ca
6 changed files with 80 additions and 56 deletions

View File

@@ -51,9 +51,9 @@ Important points to note:
* There is a special object named ``tags`` available in the config file.
It can be used to query and change the tags (see :ref:`tags`). Use
``tags.has('tag')`` to query, ``tags.add('tag')`` and ``tags.remove('tag')``
``'tag' in tags`` to query, ``tags.add('tag')`` and ``tags.remove('tag')``
to change. Only tags set via the ``-t`` command-line option or via
``tags.add('tag')`` can be queried using ``tags.has('tag')``.
``tags.add('tag')`` can be queried using ``'tag' in tags``.
Note that the current builder tag is not available in ``conf.py``, as it is
created *after* the builder is initialized.