Commit Graph

35 Commits

Author SHA1 Message Date
Stephen Finucane d17f58d1bf trivial: Remove unnecessary 'coding' lines
All files use UTF-8 by default in Python 3.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I7acf3a0ad369371aa4075962b3656467a6a37c58
2022-04-06 14:14:45 +01:00
liyou01 d0739397e6 remove unicode from code
Change-Id: I825c922648482f079c10c8db4f7aac262af611ba
2021-05-26 16:52:12 +00:00
Hervé Beraud d6c466197c Adding pre-commit
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>
2020-09-22 10:46:49 +02:00
Andreas Jaeger 604b63d3e9 Switch to newer openstackdocstheme and reno versions
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
2020-05-26 08:59:13 +02:00
Hervé Beraud 0c5e44839c [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in Ussuri cycle.

Complete discussion & schedule can be found in
-
http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Change-Id: Ia7abd5c3861978dbcbc7c72f469d19ff41032c13
Sem-Ver: api-break
2020-02-10 11:24:43 +01:00
pengyuesheng d6baed1d93 Bump the openstackdocstheme extension to 1.20
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
2019-10-11 16:44:53 +08:00
pengyuesheng 898326b814 Sync Sphinx requirement
Sync sphinx dependency with global requirements. It caps python 2 since
sphinx 2.0 no longer supports Python 2.7.

Change-Id: I2da8f284b877edd2cf0e6f57352b616c54fabac9
2019-10-09 16:17:21 +08:00
Nguyen Van Trung 880d7122b8 Follow the new PTI for document build
For compliance with the Project Testing Interface as described in:
https://governance.openstack.org/tc/reference/project-testing-interface.html

For more details information, please refer to:
http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Change-Id: Ib36e24d0b38356790993fec24b8280464645bd29
2018-07-09 16:18:03 +07:00
Akihiro Motoki 8629b628cb turn on warning-is-error in doc build
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
2017-07-10 13:04:22 +00:00
Akihiro Motoki e1bcf9dff1 rearrange existing documentation to fit the new standard layout
Change-Id: I56d60de2c3a8aefa2df834634ff5e6c068d868d4
2017-07-09 01:33:00 +00:00
Akihiro Motoki 3b7dbd6ff8 Switch from oslosphinx to openstackdocstheme
Change-Id: Ie58f20d819cbcdeb020403ba42d3dba3c958ba25
2017-07-08 22:24:55 +00:00
Jenkins 68557fec45 Merge "Introducing NeverAgain functionality for periodics" 2017-03-08 06:22:17 +00:00
Anh Tran db1dffd985 Typo fix: arbitary => arbitrary
Change-Id: I621f48d29e58078005fb623d41bd4ed4d15d13f0
2017-02-07 11:16:23 +07:00
aditi 6fe96712c5 Remove link to modindex
The documentation build does not generate any module index, thus
remove the link to the page.

Change-Id: If76465ef6b5061c6f932870741c5a68943c54de2
2017-01-27 12:35:53 +05:30
Joshua Harlow e05b121e6a Introducing NeverAgain functionality for periodics
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
2017-01-23 18:36:45 -08:00
gengchc2 d333f83994 Removes unnecessary utf-8 coding
The file was added redundant utf-8 coding by some editor.
we can delete it .

Change-Id: I35047b1f3abea24903d6cac65f572edaed11ee79
2016-12-27 09:08:15 +08:00
Surojit Pathak 7283021caf Modification of the example code
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
2016-01-14 23:18:30 +00:00
Jenkins 5c5801bee0 Merge "Allow providing a callback to certain executors to reject new work" 2015-07-30 20:52:56 +00:00
Joshua Harlow 7a7059da00 Allow providing a callback to certain executors to reject new work
Change-Id: Id71b9ed45cd9b71c82eed1562cd3f40701a3a983
2015-07-28 16:47:06 -07:00
Jenkins 7a8679f834 Merge "Ensure we check callback '_is_periodic' on add" 2015-07-24 00:35:54 +00:00
Jenkins 8e1632bcc9 Merge "Ensure doctesting and doc8 testing done in py27 env" 2015-07-15 14:35:53 +00:00
Joshua Harlow e4fe1dfad2 Ensure doctesting and doc8 testing done in py27 env
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
2015-07-14 22:05:53 -07:00
Joshua Harlow 2019213a62 Add future waiting helper module
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
2015-07-11 05:46:37 +00:00
Joshua Harlow 6de799a823 Ensure we check callback '_is_periodic' on add
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
2015-07-09 14:23:55 -07:00
Joshua Harlow 2ea7dba035 Add periodics to doc features section
Change-Id: Iadba1ab894f86afb19163814bb7b30360934751a
2015-06-25 20:53:29 -07:00
Jenkins 70a9100b83 Merge "Add history.rst that uses generated 'ChangeLog' file" 2015-06-24 21:35:47 +00:00
Joshua Harlow 13b607785d Add history.rst that uses generated 'ChangeLog' file
Change-Id: Ia909f2ed844a2ba39d4f73b1e6b349d950f6426a
2015-06-23 16:07:46 -07:00
Joshua Harlow 3cdc715547 Add some basic periodic worker activation examples
Change-Id: I56c1f68eb68638c04eb4f2b0d3d7ffd3bf109964
2015-06-12 23:21:41 -07:00
Jenkins 10f4411c83 Merge "Add basic doctest(ed) executor examples" 2015-06-12 11:05:37 +00:00
Jenkins 1afe690bd9 Merge "Add a periodics module that runs functions periodically" 2015-06-12 11:05:31 +00:00
Joshua Harlow 771b610659 Add a periodics module that runs functions periodically
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
2015-06-10 14:44:58 -07:00
Joshua Harlow 3d9ec12833 Add basic doctest(ed) executor examples
Change-Id: I8940fe16299b02ec4d92479e06c884a72f401cec
2015-06-10 21:19:28 +00:00
Joshua Harlow 5087ba9f6f Allow synchronous executors to run in green compat. mode
Change-Id: Idcde3249064cba79f9c977aa97991b9de29cef3b
2015-06-08 16:56:10 -07:00
Joshua Harlow 7fb8848433 Vastly improve the docs
Change-Id: I0a840818520463652e9cfc2c159145b825747e7a
2015-06-05 15:43:06 -07:00
Joshua Harlow 0d362d3078 Add initial .gitreview file and cookie-cutter template
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
2015-06-02 09:22:45 -04:00