All files use UTF-8 by default in Python 3.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I7acf3a0ad369371aa4075962b3656467a6a37c58
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: I3a8d6c282a1ec8189f4150a5e5391a94591cff9d
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: Ife447363df7ed70ee9d813cc70c236efdbb916b6
Some options are now automatically configured by the version 1.20:
- project
- html_last_updated_fmt
- latex_engine
- latex_elements
- version
- release.
Change-Id: Idc90ab7e1ee046b426979de62499cd6861674edc
Sync sphinx dependency with global requirements. It caps python 2 since
sphinx 2.0 no longer supports Python 2.7.
Change-Id: I2da8f284b877edd2cf0e6f57352b616c54fabac9
sphinx.ext.napoleon is a preprocessor which converts Google style
docstring into ReST style. This is required to avoid sphinx warnings.
warnerrors = True in [pbr] section is no longer needed
in favor of warning-is-error in sphinx.
Change-Id: If4a7adfae5dab3313bb54ad465a75290476b7154
Allow functions to raise a never again exception to remove
themselves from running
It also introduces a new param named ``auto_stop_when_empty``
to ``start()`` method. When the provided periodic functions have
all exited and this param is set to false then the thread
responsible for executing those methods will just spin/idle
waiting for a new periodic function to be added; switching it to
true will make this idling not happen (and instead when no more
periodic work exists then the calling thread will just return).
Co-Authored-By: Debayan Ray <debayan.ray@gmail.com>
Change-Id: If7c5e1a407fb72af8e0f7f3a1017a123590cffb2
To illustrate the fact that we can share code seemlessly with different
scheduling behavior, at ease with futurist. Moreover, the example code
shows how the concurrency/parallel execution can be observed from same
code, just by changing the executor. This demonstrates the power of
futurist interfaces.
Change-Id: Ifdd2a89c8cd9d06f54900960a69debc41b42ab3d
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.
The process based executor doctest is disabled as it appears
sphinx creates the code for these examples in a local namespace
which the process based executor can't locate (and therefore it
dies).
Change-Id: I825f3a4b673acd66cc6e05d0d1057ed5c72a759d
This code is useful for waiting on green or regular futures
and ensuring this is done in a safe manner (both kinds can
not be waited at on the same time, due to how the locking
and event objects & strategies of both differ).
Depends-On: Ie491d8a504903fb27dcb9610567e660b86669126
Change-Id: I44ae2d260c1ecbdbd45b00b26113f9f1d64db5b6
Instead of always adding we should make sure we check
the callback attribute '_is_periodic' and avoid adding
if this is set to false.
This always has the `add` function return whether the
add was successful or not (using the '_is_periodic' attribute
to affect this return result).
Whats returned from `add` (and is also accessible now via
`iter_watchers`) is a new watcher object which provides a
read-only view on the callback (and its metrics) as it gets ran
by the worker.
Change-Id: Ie77248f04125c9f61a336d45f25ac1eaa53ab497
This code is extracted out of taskflow where it is
part one of part two (or more) of getting this in a library
where others can use it.
Related to: https://review.openstack.org/#/c/134303/
Change-Id: I16c8db8ec6a8f77732a482a544a3af8d2b8c4ed3
Bootstrap the futurist project by using the cookiecutter
template. So that the CI jobs have all the things they
need and it follows the patterns used by all other oslo
/openstack libraries.
Change-Id: I738f68448e64e14725afc5e9c998751e081e7f07