Commit Graph

184 Commits

Author SHA1 Message Date
Zuul 4c78681bea Merge "remove unicode prefix from code" 2023-02-27 12:20:09 +00:00
niuke 443e97c736 remove unicode prefix from code
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
2023-02-23 09:15:20 +00:00
Alexander Fadeev 1813e1996a Fix the 'No such file or directory' error
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
2023-02-17 23:03:43 +02:00
Daniel Garcia Moreno 06cd5abff4 Remove deprecated sphinx-testing dependency
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
2022-10-03 12:36:17 +02:00
Hervé Beraud d3c6dd2c0c Drop python3.6/3.7 support in testing runtime
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
2022-05-05 16:20:01 +02:00
Stephen Finucane 92dddd6652 Update CI to use unversioned jobs template
As part of the migration of this project to the independent release
model, we failed to notice that the job template was still tied to a
specific release. We've now introduced a new unversioned job template,
'openstack-python3-jobs' [1], which was can and should use. Do this.

[1] https://review.opendev.org/c/openstack/openstack-zuul-jobs/+/833286/

Change-Id: I9e18a2d952610607fceeb7b9a4489f6f6dffd5a7
Depends-On: https://review.opendev.org/c/openstack/openstack-zuul-jobs/+/833286/
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-03-15 15:06:53 +00:00
tushargite96 a4607351cf Add Python3 yoga unit tests
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
2022-03-02 22:13:57 +05:30
Rafael Weingärtner 3d4f056ca3 Fix exception logging
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
2021-10-21 10:16:39 +01:00
Stephen Finucane 8aa8e71799 tox: Don't use distutils entrypoint for coverage
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>
2021-10-21 10:15:17 +01:00
Stephen Finucane fcf44fcfb5 Remove six
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>
2021-10-21 10:14:26 +01:00
Stephen Finucane 42053b1f92 Drop support for Sphinx < 4.x
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>
2021-10-21 10:14:22 +01:00
Zuul 79b9b698d9 Merge "Switch testing to Xena testing runtime" 2021-05-17 09:42:48 +00:00
Zuul 633ef7a030 Merge "Replace 'add_stylesheet', 'add_javascript'" 2021-05-17 09:33:14 +00:00
yangyawei 6e06849675 setup.cfg: Replace dashes with underscores
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
2021-05-14 16:05:53 +08:00
yangyawei b9e9b2dc7a Switch testing to Xena testing runtime
Upating the tetsing template to Xena testing runtime:
https://governance.openstack.org/tc/reference/runtimes/xena.html

Change-Id: I5e11583dd97bfa87634a88cfaef5d508f5389741
2021-04-30 15:04:30 +08:00
Daniel Bengtsson c0e57600ec Move flake8 as a pre-commit local target.
The goal here is to avoid conflicts between flake8 and hacking version each
2 days.

Inspired from nova's approach[1].

The flake8 version to install will be determined by hacking and
requirements[2] will stay aligned instead of relying on different versions.

[1] https://opendev.org/openstack/nova/src/branch/master/.pre-commit-config.yaml#L26-L35
[2] https://opendev.org/openstack/hacking/src/branch/master/requirements.txt#L1

Change-Id: I4a77b695b08c1d4e195858f1a9860951a4813b59
2021-03-23 13:15:01 +01:00
Zuul fc3f5d0538 Merge "Use py3 as the default runtime for tox" 2020-12-11 15:59:18 +00:00
Stephen Finucane 1e639fd5a2 Replace 'add_stylesheet', 'add_javascript'
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>
2020-12-07 11:21:31 +00:00
Hervé Beraud adb453580a Use TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated
This allows to use upper-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

[1] https://review.opendev.org/#/c/722814/
[2] https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file

Change-Id: I58f31536e240234156f402d3683af25263604122
2020-11-04 10:54:49 +01:00
Hervé Beraud 188e83325d Use py3 as the default runtime for tox
Moving on py3 as the default runtime for tox to avoid to update this at
each new cycle.

Wallaby support officially the following runtimes [1]:
- Python 3.6
- Python 3.8

During Victoria Python 3.7 was used as the default runtime [2] however this
version isn't longer officially supported.

[1] https://governance.openstack.org/tc/reference/runtimes/wallaby.html#python-runtimes-for-wallaby
[2] https://governance.openstack.org/tc/reference/runtimes/victoria.html#python-runtimes-for-victoria

Change-Id: Ia1a3fd90a66a655cdc46ab055857ce828247025a
2020-11-04 10:08:08 +01:00
Zuul 6c085b636f Merge "Remove install unnecessary packages" 2020-10-29 10:45:44 +00:00
Zuul 52971c5c8a Merge "bump py37 to py38 in tox.ini" 2020-10-29 10:43:12 +00:00
zhoulinhui 24a88c86bf Bump py37 to py38 in tox.ini
for now,  we should test py38 by default.

refer: https://governance.openstack.org/tc/reference/runtimes/victoria.html

Change-Id: Ic239cc78903817d503f3a63f9b02e1e2937510e9
2020-10-28 23:00:33 +08:00
maaoyu 14ac8baac7 bump py37 to py38 in tox.ini
in 'victoria' cycle, we should test py38 by default.

ref:
  https://governance.openstack.org/tc/reference/runtimes/victoria.html

Change-Id: Iee3ac12e67138ac4eae7bfe33936a066e1025bde
2020-10-12 13:49:52 +08:00
zhoulinhui 859f766a2e Fix hacking min version to 3.0.1
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
2020-10-06 17:53:57 +08:00
zhoulinhui ae88bef00a Stop install unnecessary packages when run tox -edocs
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
2020-10-03 00:48:31 +08:00
maaoyu ec8ca09a28 Remove install unnecessary packages
The docs requirements migrated to doc/requirements.txt
we need not install things from requirements.txt.

Change-Id: I8a7f47c699a574bc31931831b5f4714866b92bbb
2020-09-23 14:15:32 +08:00
Hervé Beraud 093c9f2f90 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: Ib2e545d2dc93e18055ade232599e76f319a44e6b
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-15 15:00:05 +02:00
Andreas Jaeger ca0db9d33e Switch to newer openstackdocstheme version
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
2020-06-02 13:35:48 +02:00
Masayuki Igawa 6b7db75edc
Remove .testr.conf
This commit removes .testr.conf since this repo already has
.stestr.conf. We just need .stestr.conf instead of .testr.conf.

Change-Id: I32e527e7367d4b4a5a1738b3c0770a9a1e7eb566
2020-05-19 15:47:09 +09:00
Andreas Jaeger 63e134440d Remove unused translation content
Remove translation sections from setup.fg and the file babel.cfg.

These are not needed for this repo.

Change-Id: Id73288ad8414ed97e17a5b603cd6966814f116f3
2020-04-26 14:13:10 +02:00
Zuul d4a68afadc Merge "Update sphinx-testing requirements to >=1.0.1" 2020-04-14 12:48:38 +00:00
Andreas Jaeger 8cb0072adb Update hacking for Python3
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
2020-03-30 12:01:47 +00:00
Akihiro Motoki b5ffcc302c Update sphinx-testing requirements to >=1.0.1
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
2020-03-29 12:54:17 +09:00
Andreas Jaeger ac100a7b76 [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: I3cf8525b430031303dd0ecfbb6719ec935f6dd91
2020-02-03 17:34:04 +01:00
Andreas Jaeger 5052c2949e Use Ussuri jobs
Switch from Train to Ussuri python3 jobs.

Change-Id: I6797d2f373a1a1870d8881ef31e4e4da9f27f007
2019-10-16 22:10:42 +02:00
Corey Bryant 678238dec2 Add Python 3 Train unit tests
This is a mechanically generated patch to ensure unit testing is in place
for all of the Tested Runtimes for Train.

See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html

Change-Id: Ifc243b812803ec7a015bd2bf53988d9567fca116
Story: #2005924
Task: #34205
2019-06-24 16:09:00 +01:00
Stephen Finucane 2a3f53494d Add support for Sphinx v2.1
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>
2019-06-24 16:08:55 +01:00
Andreas Jaeger f8557cb63d Update Testing for Train
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
2019-04-26 11:26:10 +02:00
zhulingjie d9d4cb5399 Replace git.openstack.org URLs with opendev.org URLs
Thorough replacement of git.openstack.org URLs with their opendev.org counterparts.

Change-Id: I69c284629a52b6db879d6a90f4a25b8c8d06150c
2019-04-25 16:31:25 +00:00
Stephen Finucane 525eee5a72 Add support for Sphinx 2.0
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>
2019-04-25 17:26:50 +01:00
OpenDev Sysadmins 72de61e3d6 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:26:32 +00:00
Stephen Finucane c6874c7f72 trivial: Remove unused attribute
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>
2019-04-01 16:41:51 +01:00
Zuul 3b3734499b Merge "Update hacking version" 2019-01-15 01:05:29 +00:00
Luigi Toscano 8626ce5d88 Generate stable targets rather than random
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
2019-01-11 11:59:16 +01:00
Luigi Toscano 4e56d09daf Fix microversion test: handle different HTML renderings
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
2019-01-11 11:58:11 +01:00
ZhijunWei 0228eb9ae3 Update hacking version
Use latest release 1.1.0 and compatible changes w.r.t pep8

Change-Id: I16071db752ab50d42127dca07d68130fea7474ce
2019-01-06 18:12:47 +08:00
Zuul f58a59d09f Merge "Remove support for py34" 2018-12-30 02:53:44 +00:00
jacky06 6ad64a02d2 Remove support for py34
refer to https://github.com/openstack/os-api-ref/blob/master/tox.ini#L3

Change-Id: I268b9b8faff42771b5241253def8044d6e7e9acc
2018-12-20 02:07:15 +00:00
Zuul 6fee36c342 Merge "Fixing duplicate label issue." 2018-12-12 07:01:24 +00:00