All strings are considered as unicode string from Python 3.
This patch drops the explicit unicode literal (u'...')
appearances from the unicode strings.
Change-Id: Ib48cebaaaf7802f82af8ab46a5cce66c42273a7a
Problem: build error when `http_theme` is NOT 'openstackdocs'
Cause: `copy_assets` starts copying fonts into non-existing dir.
Measure: mkdir _static/fonts before copying
```
Extension error (os_api_ref):
Handler <function copy_assets at 0x7fd3c902f310> for event
'build-finished' threw an exception (exception: [Errno 2]
No such file or directory: '..../api-ref/build/html/_static/
fonts/glyphicons-halflings-regular.ttf')
```
Change-Id: I70d5455db3bb61060a54202c5e510493c81661d5
This patch replaces the sphinx-testing package using the SphinxTestApp
provided by the Sphinx package.
The sphinx-testing package is deprecated and should be replaced with
the sphinx.testing package that's bundled with Sphinx.
Change-Id: I60b4d1a8b83dc35c394e29d746a2fbb3ff744c1a
In Zed cycle testing runtime, we are targetting to drop the
python 3.6/3.7 support, project started adding python 3.8 as minimum,
example nova:
- 56b5aed08c/setup.cfg (L13)
Also indicates that we support python 3.9.
Change-Id: I252d3cea1bf66553a4c41f25dacfd8ec77fb1cd3
This patch updates the project template to use the Yoga project template
to ensure unit testing is in place for all of the tested runtimes
for yoga. For more please refer to [1].
[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html
Change-Id: Iaba3a69d352ea181167f2a845ffece3f43c5faae
When an exception happens while executing the method `_load_param_file`,
the exception logging `LOG.exception(exc_info=exc)` will generate an
error.
A small snippet to reproduce the issue is the following code:
from sphinx.util import logging
LOG = logging.getLogger(__name__)
try:
raise Exception("teste")
except Exception as exc:
LOG.exception(exc_info=exc)
Which will generate the error:
Exception: teste
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/rafael/git/os-api-ref/os_api_ref/test-logging.py", line 8, in <module>
LOG.exception(exc_info=exc)
TypeError: exception() missing 1 required positional argument: 'msg'
Process finished with exit code 1
With this fix, the exception logging error is solved, and users get a
meaningful message.
Change-Id: Ib3c3e93c283d86b9708c74e60c2ac5762dc2c222
This is deprecated in pbr. While we're here, we also clean up some
formatting and remove an unnecessary MANIFEST.in file (pbr doesn't need
these)
Change-Id: I9d5023a083905da76c20bde503a6ec65f0849573
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
There were only two small users. No need to keep the library around for
those.
Change-Id: Iad5d845b46852ce74962a134c8d250142f29c8e3
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Our tests are broken due to changes introduced by Sphinx 4.0 and thus
require some adaptation. Rather than introduce more logic into tests to
handle older versions, simply drop support for older versions of Sphinx.
Change-Id: I2e8ff5cc2e6b4703d7f767fc95b6766d727d8577
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Setuptools v54.1.0 introduces a warning that the use of dash-separated
options in 'setup.cfg' will not be supported in a future version [1].
Get ahead of the issue by replacing the dashes with underscores. Without
this, we see 'UserWarning' messages like the following on new enough
versions of setuptools:
UserWarning: Usage of dash-separated 'description-file' will not be
supported in future versions. Please use the underscore name
'description_file' instead
[1] https://github.com/pypa/setuptools/commit/a2e9ae4cb
Change-Id: Ibd68d9824b3cf0b64ffb9d82811d1a20c20eff75
We currently see the following warnings when building a doc project
involving os-api-ref:
RemovedInSphinx40Warning: The app.add_stylesheet() is deprecated.
Please use app.add_css_file() instead.
RemovedInSphinx40Warning: The app.add_javascript() is deprecated.
Please use app.add_js_file() instead.
As the message would suggest, these methods were replaced by
'add_css_file' and 'add_js_file' in commits 3afc72fb [1] and f3168d98
[2], respectively. Both changes were first included in Sphinx 1.8, which
is lower than our current minimum, so there's no need to bump
requirements.
[1] https://github.com/sphinx-doc/sphinx/commit/3afc72fb
[2] https://github.com/sphinx-doc/sphinx/commit/f3168d98
Change-Id: I7f4d772adbcb9d592935b14c430ae3a62a60b6d1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
flake8 new release 3.8.0 added new checks and gate pep8
job start failing. hacking 3.0.1 fix the pinning of flake8 to
avoid bringing in a new version with new checks.
Though it is fixed in latest hacking but 2.0 and 3.0 has cap for
flake8 as <4.0.0 which mean flake8 new version 3.9.0 can also
break the pep8 job if new check are added.
To avoid similar gate break in future, we need to bump the hacking min
version.
- http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014828.html
Change-Id: I3433e903d2a1484d97c3eeed21955324fe8a33a9
requirements.txt is unnecessary when run tox -e docs,
docs relative stuffs is in doc/requirements.txt, this ps to
remove the requirements.txt from tox.ini
Change-Id: I69b5a12128669de877a27fbbd09ffde8d8149508
The docs requirements migrated to doc/requirements.txt
we need not install things from requirements.txt.
Change-Id: I8a7f47c699a574bc31931831b5f4714866b92bbb
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: Ib2e545d2dc93e18055ade232599e76f319a44e6b
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
Switch to openstackdocstheme 2.2.1 version. Using
this version 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.
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: Ifbefda50c728a1abf7599489677bfd9efc26e045
This commit removes .testr.conf since this repo already has
.stestr.conf. We just need .stestr.conf instead of .testr.conf.
Change-Id: I32e527e7367d4b4a5a1738b3c0770a9a1e7eb566
Remove translation sections from setup.fg and the file babel.cfg.
These are not needed for this repo.
Change-Id: Id73288ad8414ed97e17a5b603cd6966814f116f3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found by updated hacking version.
Change-Id: I4a4ec207f87d3afb58b6427825ce9b3872823008
During the investigaion of the mailing list thread [1],
it turns out that our test does work with sphinx-testing<1.0.1
and requires sphinx-testing==1.0.1.
read_text() method is from sphinx_testing.path.path class but
str is returned as app.outdir in test setUp() with sphinx-testing<1.0.1.
[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-March/013653.html
Change-Id: I35d6d4bed2e069a51794cc2a9baa8288869d894e
Come a new Sphinx version, come new breakages. This one is because of
commit 107c20a11f [1], which changed the default centering style of
tables.
[1] https://github.com/sphinx-doc/sphinx/commit/107c20a11f
Change-Id: I1155300828ad0012bd80b7615a0baca121c5e72e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Test python 3.7 instead of 3.5 for Train now.
Update docs building to have separate dir for dirtrees so that they do
no get published.
Change-Id: Ica60dc6ffa6c14e0a07489ac8a8b2be4800caa31
Sphinx 2.0 switched the default HTML builder from HTML4 to HTML5 [1].
Since some of our tests are validating raw HTML output, this has caused
them to break. We can't drop support for Sphinx < 2.0 yet since Sphinx
2.0 doesn't support Python 2.7, so simply if-else this mofo until such a
time as we _can_ drop support.
[1] https://github.com/sphinx-doc/sphinx/issues/4587
Change-Id: I4631169908e34fa924f5a0a783a94ad9c1215d9f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This was added in I10d90ac2f702153508bc6e607ed451c089276a4d and doesn't
appear to have been used anywhere. Remove it.
Change-Id: If29f203da9633f9174ed4ba94d70153962d195b9
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
A random value can still easily hit collision, and at least
one was found easily on the gates (gone with a recheck).
Moreover, the usage of a random target does not allow for ensuring
reproducible builds: the usage of an hash build from the node
content makes sure that the target is stable across different
runs of api-ref generation.
Change-Id: I3fcd8a4e5b0a66c9dbf34f4a4c472f3c93c46bb8
The rendered HTML changes a bit between beautifulsoup4 4.6.3 and 4.7.1.
A regular expression can handle both cases.
Change-Id: I64d4c56b480d54b50e58141999636b91b5fb4f94