-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xtriggers: Doc Fixes #686
Merged
Merged
Xtriggers: Doc Fixes #686
Changes from 8 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
eb3d060
- Have ``make clean`` remove src/plugins/xtriggers.
wxtim 5ecefd3
spelling fixes
wxtim 8c84e9b
Fix xtrigger entry point example and improve docs (#6)
MetRonnie 3a5eabd
- Added a reference to built-in "Toy" xtriggers.
wxtim c6bcf10
Actions: `pip list` on build failure for debugging (#7)
MetRonnie 2fa2f87
Merge branch 'master' into pr-686
MetRonnie c1735ff
Remove doctest
MetRonnie 6e66136
Merge pull request #8 from MetRonnie/pr-686
wxtim ae1013b
Update src/user-guide/writing-workflows/external-triggers.rst
wxtim bfc92d1
remove surplus material
wxtim f445bbf
make code refs work
wxtim 9035b3a
xtiggers: flesh out validation
oliver-sanders 85e0ec1
Merge branch 'xtrig-arg-validate' into xtrigger-stuff
wxtim 33a6bd0
Merge pull request #9 from oliver-sanders/xtrigger-stuff
wxtim c4a6056
Remove outdated references to `:interval` suffix on `wall_clock` xtri…
MetRonnie 95fb337
xrandom: autodoc validate function & remove repeated content
MetRonnie d18b130
Merge pull request #10 from MetRonnie/xtrig
wxtim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,69 @@ | ||
Xtrigger Plugins | ||
====================================== | ||
|
||
Xtrigger plugins allow you to install and use xtriggers without them being | ||
in your ``CYLC_PYTHONPATH``. | ||
.. versionadded:: 8.3 | ||
|
||
Xtrigger plugins allow you to install and use | ||
:ref:`xtriggers <Section External Triggers>` without them being | ||
in ``<workflow-dir>/lib/python/`` or ``$CYLC_PYTHONPATH``. | ||
|
||
Built In Plugins | ||
---------------- | ||
.. seealso:: | ||
|
||
Cylc Flow provides the following xtriggers. | ||
* :ref:`Built-in Clock Triggers` | ||
* :ref:`Built-in Workflow State Triggers` | ||
* :ref:`Built-in Toy Xtriggers` | ||
|
||
.. autosummary:: | ||
:toctree: built-in | ||
:template: docstring_only.rst | ||
|
||
cylc.flow.xtriggers.echo | ||
cylc.flow.xtriggers.workflow_state | ||
cylc.flow.xtriggers.xrandom | ||
|
||
.. Note: Autosummary generates files in this directory, these are cleaned | ||
up by `make clean`. | ||
.. _developing.xtrigger.plugins: | ||
|
||
Developing ``xtrigger`` plugins | ||
------------------------------- | ||
|
||
Cylc uses entry points registered by setuptools to search for xtrigger | ||
plugins. | ||
Cylc uses the ``cylc.xtriggers`` entry point registered by setuptools to search | ||
for xtrigger plugins. Each xtrigger is registered individually. | ||
|
||
Example | ||
^^^^^^^ | ||
|
||
Plugins are registered by registering them with the ``cylc.xtriggers`` | ||
entry points. Each xtrigger is registered individually. | ||
Consider a package called ``my_package`` with the following structure: | ||
|
||
.. code-block:: python | ||
:caption: ``my_package/foo.py`` | ||
|
||
def foo(): | ||
... | ||
|
||
def bar(): | ||
... | ||
|
||
.. code-block:: python | ||
:caption: ``my_package/baz.py`` | ||
|
||
def baz(): | ||
... | ||
|
||
These xtriggers can be registered in the package's ``setup.cfg`` or | ||
``pyproject.toml`` file. | ||
|
||
.. code-block:: ini | ||
:caption: ``setup.cfg`` | ||
|
||
[options.entry_points] | ||
cylc.xtriggers = | ||
foo = my_package.foo:foo | ||
bar = my_package.foo:bar | ||
baz = my_package.baz:baz | ||
cylc.xtriggers = | ||
foo = my_package.foo | ||
bar = my_package.foo | ||
baz = my_package.baz | ||
|
||
.. code-block:: toml | ||
:caption: ``pyproject.toml`` | ||
|
||
[project.entry-points."cylc.xtriggers"] | ||
foo = "my_package.foo:foo" | ||
bar = "my_package.foo:bar" | ||
baz = "my_package.baz:baz" | ||
foo = "my_package.foo" | ||
bar = "my_package.foo" | ||
baz = "my_package.baz" | ||
|
||
.. tip:: | ||
|
||
It is recommended to implement only one xtrigger per module. This allows | ||
you to write a ``validate`` function for each xtrigger - see | ||
:ref:`xrandom.validate` for an example. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually adding every argument name to the dictionary is going to get painful.
Any ideas on excluding function signatures and argument lists from spellcheck?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oliver-sanders I've worked up a proof of concept at https://github.com/cylc/cylc-doc/compare/master...wxtim:cylc-doc:custom_filter_for_Cylc_Words?expand=1 - but I'm not terribly happy with the methods at the top of
cylc.doc.filters
which are scraping the Cylc code.