Commit Graph

54 Commits

Author SHA1 Message Date
Stephen Finucane 8d7607266c Remove legacy calling style of select()
Resolve the following SADeprecationWarning warning:

  The legacy calling style of select() is deprecated and will be removed
  in SQLAlchemy 2.0.  Please use the new calling style described at
  select().

Change-Id: Ic5f7240e790425d2689c6870483748650a49bc3d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-07-29 16:37:44 +01:00
xuanyandong 273009f63d remove unicode from code
Change-Id: Ia782bc7127a1cb967e2f475065b1fb963b9c184f
2021-01-03 16:02:16 +08:00
Hervé Beraud 80190b395c 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: Id03c1ea4752db3236c36521ca9c67125d5ba2526
Co-authored-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-22 12:32:18 +02:00
melissaml c18a019484 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: I572495d50e0edc8bdfe22594dcde30a61b0750b8
2020-06-04 15:17:23 +08:00
Zuul 03c12fd736 Merge "Add release notes links to doc index" 2020-05-26 13:57:23 +00:00
Andreas Jaeger db6a84accf 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. A
couple of variables are also not needed anymore, remove them.

Depends-On: https://review.opendev.org/728938
Change-Id: I072cf215486d672eacd3a57483cb2b311483c844
2020-05-18 21:07:24 +02:00
Hervé Beraud ad13a5cd10 Add release notes links to doc index
Change-Id: I33fc3e2579887e051ed5f47ebf96dcefc2bd8b49
2020-04-16 17:19:36 +02:00
Hervé Beraud aba1098b7e [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: I02e2d11d38d2aa4182e8d466519b99f05943701f
2020-02-03 18:33:11 +01:00
melissaml 4370cb39ce 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: I2c3a36fbc020d41c5eaa09008a0586142a63d6ba
2019-11-13 20:05:52 +08:00
caoyuan 9a5f153c4b 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: Idaca0bc97e33e0a080de612420177b5e102c628c
2019-10-24 14:28:28 +08:00
Stephen Finucane 05ddd9fc9e docs: Use sphinxcontrib.apidoc for building API docs
Gets us away from the old pbr functionality.

Some cleanup of tox.ini is included along the way.

Change-Id: Ia228f8ee49f31f88fa2a66f2aad3a3921c41a785
2019-05-21 08:50:29 +00:00
Ben Nemec 925bb81c7f 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: If86c82e0f4a519baca664af79352846c4af9a01c
Reference: https://github.com/PyCQA/bandit/pull/489
2019-05-13 20:09:00 +00:00
Ben Nemec e45ffc9bf4 List PyMySQL first in installation docs
It's by far the most tested driver with oslo.db so it makes sense
to have it first in the list of driver options.

Mostly this is just to have a change to merge so the reno jobs get
run again though.

Change-Id: I5a9a05b6c3e3008cb1dfefc2df397003c2cbc7fd
2018-04-24 14:20:12 +00:00
OpenStack Proposal Bot 83c1f18099 Updated from global requirements
Change-Id: Ia4e66a804bea3eee74fedc3c5a7f610cb05d9c8c
2018-03-15 07:48:10 +00:00
OpenStack Proposal Bot db60731ba0 Updated from global requirements
Change-Id: I383270a678de0e1fd1c1d563d5d72e13b14eb9ec
2018-01-24 01:25:12 +00:00
OpenStack Proposal Bot ebda4f02eb Updated from global requirements
Change-Id: I52293d97aace6ac2e249417d09c01a841014f924
2018-01-18 03:23:22 +00:00
OpenStack Proposal Bot c00824a26d Updated from global requirements
Change-Id: Id81f2a3321d563d35614fa0476a0743a982b88fc
2018-01-16 04:26:50 +00:00
ChangBo Guo(gcb) 4f81c41994 Use 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: Iba311cc69ec5272d8beb433e3589c53f371d5d0a
2017-12-19 14:41:22 +08:00
OpenStack Proposal Bot 05c8579ef0 Updated from global requirements
Change-Id: Ib05517c968e4d4bc5a55cec3cbe4a619a1ab9c11
2017-12-04 20:51:06 +00:00
Sean McGinnis 1c43d0689c Add requirements.txt for docs builds
Docs requirement some packages to be installed that are not currently
captured in the requirements.txt file. This causes job failures in the
post release jobs for oslo.db.

Adding doc/requirements.txt to list the two packages needed for docs
builds.

Change-Id: Ic957202c00a2047e35bac361111976141aa60f6f
2017-12-04 07:39:36 -06:00
Dirk Mueller 48d5380f2e Drop MySQL-python dependency from oslo.db
In order to fade out MySQL-python from OpenStack we need to stop
testing it. Add release notes entry and adjust documentation
references accordingly.

Depends-On: Ie1f07062ed18350bcbb9e7b5e33c7ab2390be9ab
Change-Id: Ie17f4543fa3d72b507d88d2c4023a9a5a430419e
2017-10-17 07:17:06 +02:00
Dong Ma 0a035933c8 turn on warning-is-error in doc build
Change-Id: I0b64c644f40a2da3242274194d1a5d2858813c25
2017-07-03 11:28:14 +00:00
Dong Ma bd35a6e841 switch from oslosphinx to openstackdocstheme
Change-Id: I66319c2b4e4ec4c10133151f7a867bdca7a3afa8
2017-07-01 08:51:47 +08:00
Dong Ma fe64db1d45 rearrange content to fit the new standard layout
Change-Id: Idaa0dde5e4fd14213ae1611560897a27e9f72514
Depends-On: Ia750cb049c0f53a234ea70ce1f2bbbb7a2aa9454
2017-07-01 01:08:19 +08:00
Roman Podoliaka 181109678b docs: mention that it's possible to use Connection directly
Sometimes people just do not need the ORM part and a Session at all.
Mention the fact, that it's possible to ask for a Connection in
enginefacade.

Change-Id: I7a135be7149cd3fa140e0268fea5a17f23f402b2
2016-12-12 10:38:06 +00:00
Roman Podoliaka 8a5fbb723f Make it possible to use enginefacade decorators with class methods
The decorator form can now be used with bound methods after a fix
for the related bug was merged. Mention this in docs and release
notes, so that people are aware of it.

A new test is added to make sure this also works with class methods
(as well as to check that the proposed decorator applying order
is actually correct).

Related-Bug: #1520195

Change-Id: Ifea08114d6d89de9d67fcae397eb94c0afc4d339
2016-06-27 17:22:01 +03:00
Thomas Herve e351f4412c Fix imports in doc
This fixes some imports in the usage docs that still uses the oslo
namespace package.

Change-Id: I684082ec2895704afd3282334547043dcd2da1f9
2016-05-22 15:54:52 +02:00
ChangBo Guo(gcb) 7574ab7ac7 Remove oslo-incubator related stuff
Change-Id: I4f09eb32cbc461e8aa8cb0df4612730d02e46dda
2016-05-11 19:32:58 +08:00
Brant Knudson 2d4fdbed56 Correct invalid reference
There's no oslo_db.migration module. It's an entrypoint group name.
Therefore it should not be using :mod:.

Change-Id: I14f26c1a9ae1bd6b5b1154b3f49eb9e1518cafc3
2015-09-28 17:58:21 -05:00
Allison Randal b43844b19c Use stevedore directive to document plugins
Add directives to the documentation to bring in the docstrings from the
plugins.

Change-Id: I2afe1d1e4a9abfa1d3cdf85bc4008ff8f772123c
2015-09-25 11:09:53 +00:00
Jenkins 7511fdde70 Merge "Make readme and documentation titles consistent" 2015-09-25 10:52:37 +00:00
Jenkins 88f3e6b4a8 Merge "Autogenerate the module docs" 2015-09-24 22:05:38 +00:00
Doug Hellmann b300f79e38 Make readme and documentation titles consistent
Change-Id: Ic667d7d7a4cb4a0fb3e6d15cc243f89b510386db
2015-09-24 20:45:26 +00:00
Brant Knudson 0b3aee8cc6 Autogenerate the module docs
The module docs were out of date (sqlalchemy.enginefacade was
missing).

Rather than try to keep this up to date by hand, autogenerate the
module docs.

Change-Id: I9b36cc635c1c0af9a61b5da20205f5628aec97e7
2015-09-24 10:56:06 -05:00
Davanum Srinivas 6450edb58b Add config options to the documentation
Add the directive to include the configuration options
to the library documentation.

Change-Id: I085cf62213340e19a2fa39b909b5c0365226f059
2015-09-24 07:49:29 -04:00
Davanum Srinivas 5645b7b93d Fix hacking rules and docs job
Change-Id: I2d86f266165ad98ded9f0bb9f11abfd8aa2c09ef
2015-08-08 07:30:58 -04:00
Mike Bayer d5f390f55c Improve failure mode handling in enginefacade
Check explicitly for the cases where no "sql_connection"
attribute was set when running _start(), so that the
lack of this parameter is documented by the
exception rather than failing into create_engine()
with an unclear failure mode.
If _start() fails as it will here, make sure _started
stays False so that repeated calls to _start() continue
to raise the same exception, rather than raising
attribute errors.  When accessing the "session" or
"connection" attributes of the context when these
attributes were not requested by the decorator or
context manager, raise explicit exceptions
for each, rather than returning None which leads to
hard-to-debug NoneType errors.

Change-Id: Iadfbf4707daed4140285a3a472009f6863b18275
Closes-bug: 1477080
2015-07-27 19:02:41 +03:00
Jeremy Stanley 9b552046f5 Switch from MySQL-python to PyMySQL
As discussed in the Liberty Design Summit "Moving apps to Python 3"
cross-project workshop, the way forward in the near future is to
switch to the pure-python PyMySQL library as a default.

Added a special test environment to keep MySQL-python support.
Documentation modified.

https://etherpad.openstack.org/p/liberty-cross-project-python3

Change-Id: I12b32dc097a121bd43991bc38dd4d289b65e86c1
2015-06-18 15:42:23 +03:00
Mike Bayer fdbd928b1f Implement new oslo.db.sqlalchemy.enginefacade module
This module presents a replacement for the EngineFacade
system.  At the center is the oslo.db.sqlalchemy.enginefacade
module, which when imported, provides decorators and context
managers which perform all database and ORM connectivity
functions transparently.   The docstrings as well
as the blueprint provide an introduction.

The patch includes a refactoring of sqlalchemy/session.py
into three dependent modules engines.py, orm.py and
enginefacade.py.  This is to maintain a non-cyclical import
structure as well as to maintain the import behavior of
oslo.db overall, as some projects such as glance currently
have dependencies on this structure.

There is also a slimming down and attempt at modernizing
some very old documentation in session.py.  The enginefacade
system should be preferred moving forward.

Implements: blueprint make-enginefacade-a-facade

Change-Id: I9a3d0c26bb727eb2c0bd823b9a12fde57cc7c9c3
2015-06-04 11:43:39 -04:00
Joshua Harlow 198a9e7cf7 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: Idb17dd30403daa130176643f4609fdd7c61c076e
2015-04-07 14:47:07 -07:00
Doug Hellmann 7063585c60 Move files out of the namespace package
Move the public API out of oslo.db to oslo_db. Retain the ability to
import from the old namespace package for backwards compatibility for
this release cycle.

Blueprint: drop-namespace-packages

Change-Id: Ie96b482b9fbcb1d85203ad35bb65c1f43e912a44
2014-12-24 13:28:48 +02:00
Doug Hellmann cae12025a9 Clean up documentation
Switch to manually generated rst files for the API documentation so we
do not expose private parts of the library.

Fix formatting of usage.rst

Convert bullet list to section headers to fix rendering issues and make
the docs more readable.

Fix formatting of docstrings in classes exposed in the docs to eliminate
warnings/errors from Sphinx.

Add history.rst

Change-Id: I6f500775f801558f7c0c29f180b60f83a7150e02
2014-09-04 16:27:00 -04:00
Christian Berendt f2f0960b15 Add doc8 to tox environment docs
Check reStructuredText documents for common style issues.

Change-Id: I10e61742e86d2d4781c5a00532c8e17d38a7d4b4
2014-09-01 11:40:08 +02:00
Jenkins 3f6b009570 Merge "remove definitions of Python Source Code Encoding" 2014-07-30 14:05:17 +00:00
Jenkins fb84de0828 Merge "Adding dependency documentation for MySQL." 2014-06-14 19:28:00 +00:00
Tim Kelsey b2c64e45d5 Adding dependency documentation for MySQL.
Merging change I347e1c235bc82d6e510761f4b1c3c3de62994c2f fixing pip
info.

Co-Authored-By: Gauvain Pocentek <gauvain.pocentek@objectif-libre.com>

Change-Id: I9a1b76ed261c69a92cc3e4e6b6100e43f98fea1e
2014-06-13 14:31:45 +01:00
Jenkins 87fc4d39de Merge "Added ``docs`` environment to tox.ini" 2014-06-10 16:35:15 +00:00
Victor Sergeyev df1c1dc23c Added ``docs`` environment to tox.ini
Added the new tox environment to build docs.
Fixes in oslo.db documentation building

Change-Id: Icab4f299df3d8a4c40dc4fd7292609109f206afd
2014-06-06 12:47:17 +03:00
Jenkins 0ecd6a63a8 Merge "Fix usage of oslo.config" 2014-06-05 22:01:58 +00:00
Christian Berendt 8f4389307c cleaning up index.rst file
Removed notes about the generation of the file and fixed the title.

Change-Id: If4d31f80c63f32b33f6f6a13d39fa12992fcf96c
2014-05-28 09:59:28 +02:00