Commit Graph

41 Commits

Author SHA1 Message Date
songwenping de2b367b48 Remove unnecessary unicode prefixes
Change-Id: Iaae10962581b84b4ae2af1a064dd27d78c05dd4d
2022-04-22 01:28:16 +00:00
Hervé Beraud 71122a0cca Adding pre-commit
Introduced changes:
- pre-commit config and rules
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commithooks.
- 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: Iba1e2ce707051ea393ac559fc51b1f07da1f6ee8
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-09 13:38:50 +02:00
melissaml 00ccff5a0d Fix pygments style
New theme of docs respects pygments_style.

more info: http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html

Change-Id: I535b0627c37db7eb70c699642da0ffae36590329
2020-06-04 14:08:43 +08:00
Zuul 34570b82aa Merge "Add release notes links to doc index" 2020-05-26 13:28:40 +00:00
Andreas Jaeger fa0f2d5734 Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.0 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.

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.

Depends-On: https://review.opendev.org/728938
Change-Id: I3a57dfef23cee9dc4430f46063e89ffb54d0396c
2020-05-18 21:00:59 +02:00
Hervé Beraud 7fd3563e13 Add release notes links to doc index
Change-Id: I4ae1aaea038fc8c5b05d455f44899c5b5b7f36f7
2020-04-16 17:47:51 +02:00
Hervé Beraud 1868508341 [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: If437786eb8dbba9386dd473b45dab0933812c649
2020-02-03 18:30:47 +01:00
pengyuesheng 5dda8dde84 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: Id5c6afef01c6f38cb72c3a6526352db40dcb3a87
2019-11-12 17:04:47 +08:00
caoyuan dad48cabbe tox: Keeping going with docs
Sphinx 1.8 introduced [1] the '--keep-going' argument which, as its name
suggests, keeps the build running when it encounters non-fatal errors.
This is exceptionally useful in avoiding a continuous edit-build loop
when undertaking large doc reworks where multiple errors may be
introduced.

[1] https://github.com/sphinx-doc/sphinx/commit/e3483e9b045

Change-Id: I7d39be84c5c8bd730119220720d2d33cb9e4ef62
2019-10-24 14:47:50 +08:00
Ben Nemec 3ed4676f93 Cap Bandit below 1.6.0 and update Sphinx requirement
Bandit 1.6.0 accidentally changed how the exclusion list option is
handled and breaks our use of it. Cap to the previous version until
Bandit has fixed the problem.

Sphinx 2.0 no longer works on python 2.7, so we need to start capping
it there as well.

Change-Id: I719a8cff50dcc0dea62db14edf7b9ab35b72facd
Reference: https://github.com/PyCQA/bandit/pull/489
2019-05-15 15:56:42 +00:00
Ben Nemec de4d748eee Capitalize Oslo
It's a proper name.

Mostly this is just to trigger the release notes jobs again after
they failed on release.

Change-Id: I5ea88dfbad5b9d60d9b404cef4a586e92fb5a957
2018-04-24 14:23:21 +00:00
Ben Nemec 9b23c17a6b Fix project name in user docs
Change-Id: I6d000cd4bfa776011638d96891f8966cc804f422
2018-03-29 21:01:56 +00:00
OpenStack Proposal Bot 36afeffc7e Updated from global requirements
Change-Id: I68a6de52dc412e026f8611052208afdc293f4069
2018-03-15 07:51:35 +00:00
OpenStack Proposal Bot 52d268ee84 Updated from global requirements
Change-Id: Icf016d2a22157bcf84db1b71733904bdded49aa5
2018-01-24 01:26:33 +00:00
OpenStack Proposal Bot 1be7cb1087 Updated from global requirements
Change-Id: I969d8e0335a7d119f702b0cab30cbf61f6255905
2018-01-18 03:25:00 +00:00
OpenStack Proposal Bot 1c33a439e8 Updated from global requirements
Change-Id: Ia615971a83f613b396299ac015dbb2a4e02848b6
2018-01-04 06:53:27 +00:00
ChangBo Guo(gcb) 2ba0aa94a0 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 detials information, please refer to:

http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Change-Id: I3d86f1897dc900ba815c0c3975e95e27bb29b532
2017-12-20 17:34:50 +08:00
Akihiro Motoki 0f3ea232b7 rearrange existing documentation to fit the new standard layout
Change-Id: I0727caae202b385d740b006fd957b990e308c6d7
2017-07-01 21:05:49 +09:00
Akihiro Motoki d14dfdf5c4 switch from oslosphinx to openstackdocstheme
Change-Id: Ief1b96ec6d08552f285540a68994c70cc9af3098
2017-07-01 21:05:48 +09:00
Stephen Finucane 6e04f882c4 Use Sphinx 1.5 warning-is-error
With pbr 2.0 and Sphinx 1.5, the setting for treat sphinx warnings as
errors is setting warning-is-error in build_sphinx section. Migrate the
setting from the old warnerrors one.

There are two issues:

- The `*` character is recognized as an emphasis character and must be
  escaped
- The index references modules that have since been removed

These are resolved.

Change-Id: Id078022c0f75bf8f162b693d260f67116eb6428b
2017-03-16 15:43:01 +00:00
Eric Brown d0d5f7af2f Add missing documentation for secretutils
The current doc page for secretutils is blank [1], most likely because
of the way constant_time_compare is in the exception block.

This patch manually tells sphinx to doc the constant_time_compare
function. Also adds the oslo.utils version when the module was added.

[1]: https://docs.openstack.org/developer/oslo.utils/api/secretutils.html

Change-Id: Ic1fb15176c93f126826f568149cabf4b8e5450d8
2017-02-23 07:38:04 -08:00
Hanxi Liu 7b7d5b9e80 Create dictutils and add 'flatten_dict_to_keypairs'
This function has been shared at least kwapi and all Telemetry projects
including ceilometer, aodh, panko and gnocchi. As a generator, it produces
sequence of keypairs for nested dictionaries. It seems to be good moving it
to the common shared code.

So add an initial dictutils and tests for it.

Change-Id: Ibd7c2ce4ef9c2608910b26169a804eb463759c7f
2016-11-01 23:35:57 +08:00
Eric Brown f77d420fc9 Trivial fixes to the usage doc
* Doc title containing too many =
* A tab instead of spaces

Change-Id: I87cc4cec257d937fcc87d98b76ef0446451fc822
2016-10-28 03:19:16 -07:00
ChangBo Guo(gcb) 676bdb3a06 Add missing specs_matcher documentation
Closes-Bug: #1616610

Change-Id: Id26af1ef6b19ace9d03611aba5389af644392b2c
2016-09-24 21:53:33 +08:00
Jenkins 123e12201a Merge "Create secretutils and include 'constant_time_compare' function" 2016-01-21 04:25:57 +00:00
Joshua Harlow 9d58253588 Create secretutils and include 'constant_time_compare' function
This code (or a version of it) is being shared by at least nova
and keystonemiddleware and it seems like a good idea to move it
to being common shared code (especially due to the importance
of getting this code correct).

This adds an initial secretutils and adds tests for it.

Change-Id: Ia603202a065d5b345608e712f63f7af21fd74dea
2016-01-19 17:24:03 -08:00
ChangBo Guo(gcb) 7b2b895db2 Add missing doc index for imageutils and fnmatch
We added these two modules recently, but didn't include them in doc
index. This commit add them in doc index and add version information
about when they were added.

Change-Id: Ic3347f57a722187fc4bfe68fce6f08fba97af7fb
2015-12-14 16:05:09 +08:00
Victor Stinner 7f57de5bb2 Use versionadded and versionchanged in doc
Document in which version new types and functions were added using
".. versionadded:: x.y". Document changes using
".. versionchanged:: x.y."

For new modules, add the versionadded tag in the module top
docstring, not on each type/function.

Add fileutils to documentation. The doc part was forgotten during the
graduation.

Add docstrings to convert versions of versionutils.

I used "git blame" + "git tag --contains=SHA1" to find these version,
and then I checked manually each version.

Change-Id: Ia2f00aa29eb36410a49fc1d350896a569a7737a1
2015-10-17 10:53:34 +02:00
Joshua Harlow 19605725ec Ensure stopwatch __enter__, __exit__ are in docs
People typically want to know if this can be used as a
context manager (it can); so make sure that the generated
docs explicitly shows them (vs not showing them, which is
the default).

Change-Id: I97d512afc79581478a5b7e734108c38635b79f45
2015-10-01 13:00:53 -07:00
Joshua Harlow 24d8950080 Add some timeutils stop watch examples
Change-Id: Id63243562bf92d370c3e3239ff4d64f53a0ace93
2015-09-30 15:09:25 -07:00
Joshua Harlow 1b1c521904 Move 'history' -> release notes section
This seems to better match what the other oslo
libraries are calling this section, so we might as
well call it that to.

Change-Id: Ib90d1e0bb2c90776c81a2b272f9aeb5c3565bfc6
2015-09-25 08:14:36 -07:00
ChangBo Guo(gcb) 13b55bd749 versionutils: add version convert helper methods
Nova[1] and Cinder[2] have same version convert methods. We can
put them in versionutils and make them don't maintain their version.

[1]https://github.com/openstack/nova/blob/master/nova/utils.py#L1044
[2]https://github.com/openstack/cinder/blob/master/cinder/utils.py#L789

Change-Id: I5a7e212bd0d661ce9ec89ae06a9f4c3bc7200d1e
2015-07-10 15:42:12 +08:00
Joshua Harlow 3a7fca5e9d Add missing reflection + uuidutils docs
These do not seem to have been created and
made appear, so make them appear and make sure
the exposed public API(s) have docstrings so
that they appear in the generated docs.

Change-Id: Ie34e46647b0b20d936ddaa15dc824d0e2d2ca99d
2015-04-13 10:49:20 -07:00
Joshua Harlow cb88d17a36 Add pypi download + version badges
Also makes the docs look more like the other
oslo libraries so that the content is easily readable
across projects.

Change-Id: I85158a89f103cdef2afa268558592c46ce6c3411
2015-04-07 18:19:37 -07:00
Joshua Harlow ed4e2d775a Add a eventlet utils helper module
When greenthreads are being used (and/or eventlet is available and
some modules have been monkey-patched) emit warnings to the users
that certain modules should be monkey-patched and if they are not
then spurious or unexpected lock-ups and/or hangs may result due to
this type of mixed usage which doesn't typically end well.

This commit adds that functionality to a new eventlet utils module
that can be used by calling code when that code really knows it will
not work without modules being patched or partially being patched.

Change-Id: I9a856fc0a6502b438c8da9b2f589154a6fa89a9f
2015-02-10 12:57:28 -08:00
Brant Knudson 89d0c2a88c Add TimeFixture
There was no fixture for using the functions related to
timeutils.set_time_override. A fixture is handy because
clear_time_override must be done for cleanup.

Change-Id: Ifef8d9f20fa9e5aa96ebf5040f290f65b503f0bd
2015-01-16 16:19:54 -06:00
Doug Hellmann ca76fdcb52 Move files out of the namespace package
Move the public API out of oslo.utils to oslo_utils. Retain the ability
to import from the old namespace package for backwards compatibility for
this release cycle.

bp/drop-namespace-packages

Change-Id: Ic6dd62097399bf75e3d11b4d8a6400971069c415
2015-01-06 17:07:36 -05:00
Davanum Srinivas c7ef2c2567 Add history/changelog to docs
Change-Id: Iec3a5cfd6245835c39e7dbe0354abb3353e42d5f
2014-10-04 13:05:13 +00:00
Doug Hellmann 3a09189098 Add API docs and clean up other docs
Add auto-generated documentation for the public modules in the library
and clean up a bit of the docstrings used.

Change-Id: Id5efa5c413b82e13f1a7ac78c92e39c193f12214
2014-07-23 16:05:59 -04:00
Christian Berendt 5d1659f786 Cleaning up index.rst file
Removed notes about the generation of the file.

Change-Id: I06355eb96cbd0fb564b7e7dbe3c10adecad74a1d
2014-07-21 08:27:02 +02:00
Davanum Srinivas 7b9410e41c exported from oslo-incubator by graduate.sh 2014-06-18 20:45:08 -04:00