Both the 'FiniteMachine' and 'HierarchicalFiniteMachine' in
'automaton.machines' define an 'Effect' attribute. It seems recent
versions of autodoc can't handle this since we're seeing the following
warning:
automaton/machines.py:docstring of
automaton.machines.Effect:1:duplicate object description of
automaton.machines.Effect, other instance in reference/index, use
:noindex: for one of them
Do as it says and configure 'noindex' for the latter. This means we lose
the ability to link to other members of this class but that's a
necessary compromise since there's no way to exclude an individual
member.
Change-Id: Ic9e50f6b56a278032463357552960e40c2ddf6a7
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Introduced changes:
- pre-commit config and rules
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commit hooks.
- Applying fixes for pre-commit compliance in all code.
Also commit hash will be used instead of version tags in pre-commit to
prevend arbitrary code from running in developer's machines.
pre-commit will be used to:
- trailing whitespace;
- Replaces or checks mixed line ending (mixed-line-ending);
- Forbid files which have a UTF-8 byte-order marker (check-byte-order-marker);
- Checks that non-binary executables have a proper
shebang (check-executables-have-shebangs);
- Check for files that contain merge conflict strings (check-merge-conflict);
- Check for debugger imports and py37+ breakpoint()
calls in python source (debug-statements);
- Attempts to load all yaml files to verify syntax (check-yaml);
- Run flake8 checks (flake8) (local)
For further details about tests please refer to:
https://github.com/pre-commit/pre-commit-hooks
Change-Id: I1e4625d34ed08218dd7069402a1eff1418f4ec35
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems
Update Sphinx version as well.
Disable openstackdocs_auto_name to use 'project' variable as name.
Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.
Remove docs requirements from lower-constraints, they are not needed
during install or test but only for docs building.
openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.
See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html
Change-Id: I3adc259f89f9093fbe9cce1353f5d6f0828271b9
1. Sync sphinx dependency with global requirements. It caps python 2 since
sphinx 2.0 no longer supports Python 2.7.
2. Remove unncessary "=="
Change-Id: Ied4095b176b20795f6a8d4d7a84d01d958d76896
We currently don't have an example that uses a state
space to build a machine, so in order to make people aware
of this ability add an example that uses it to build a simple
state machine.
Change-Id: Ieec71ceee14f2bb451a52457d1a05aa54898597c
Without explicitly mentioning that it should have its docs
generated sphinx won't generate docs for it, so ensure that
we list __iter__ and __contains__ so that it does get
generated docs.
Also fixes 'default_start_state' docs which were not showing
up since they were on the setter method vs the getter method.
Change-Id: I83d02a3604678d16b16f6da5384ff10543af850f
This ensures that sphinx doc tests are ran and validated
and also runs doc8 to ensure style checks are done and adjusts
some of the current examples and code to fix found issues.
Also fixes the `get_callback_name` method which needs to check
if the __module__ is non-none (since it appears sphinx somehow
triggers it being none).
Change-Id: I54daecff219a9e9be71ff382d36fc2d5e67360cf
For hierarchical machines it seems like it would be
quite useful to allow nested machines to initialize to
states that are not just none so to enable this allow for
providing a callback that will be used to determine the
callback for all nested machines (and nested-nested
machines) so that they can be initialized to the users
desire.
Change-Id: I45a0c0e0c2a976e0df094e6c728f943766be7c7a
To make it easier for users of this library to
differentiate general exceptions from automaton
exceptions it is quite common to have a root exception
class that libraries use (and derive there exceptions
from); this adds that.
Change-Id: I140cb188f58849ac5caea97ed5a422375b549f6f
Both ironic and taskflow share this same code to convert
their state machines into a pydot graph which then gets
converted into SVG to form:
- http://docs.openstack.org/developer/taskflow/states.html
- http://docs.openstack.org/developer/ironic/dev/states.html
So instead of duplicating it, provide a useful helper function
that both (and others) can share to produce a dot/graphviz pretty
diagram from a state machine.
Change-Id: I218740910163a1ca2587d706edc55852af1c0c74
When using a state machine it is not always desired
to use the runner concept, so to ensure both concepts
are modular split runners off into there own module.
Change-Id: Iac8ce50b0a17468190f3f737663b5b094c324a55