sphinx-contrib / openapi

OpenAPI (fka Swagger) spec renderer for Sphinx.
https://sphinxcontrib-openapi.readthedocs.io
BSD 2-Clause "Simplified" License
109 stars 79 forks source link

Switch from m2r to sphinx-mdinclude #127

Closed qmonnet closed 1 year ago

qmonnet commented 2 years ago

m2r is unmaintained. It relies on mistune, but is not compatible with mistune versions >= 2.0. This makes it impossible to update mistune, even though there is a CVE in the old versions of the package.

Switch to sphinx-mdinclude instead.

Note: There is also m2r2, but it is not look like a suitable alternative because the project simply forces the use of an older mistune version.

I haven't managed to pass the full CI locally successfully, but the issues seemed to be related to my setup and not to the changes from this PR. If they did come from the PR, I would welcome some assistance to address them.

Fixes: #123 Possibly addresses #121 as well

kloczek commented 1 year ago

Just tested master + this PR and pytest is failing for me

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-openapi-0.7.0-5.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-openapi-0.7.0-5.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra --import-mode=importlib =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.15, pytest-7.1.3, pluggy-1.0.0 rootdir: /home/tkloczko/rpmbuild/BUILD/openapi-0.7.0, configfile: tox.ini collected 443 items tests/test_openapi.py ................................. [ 7%] tests/test_schema_utils.py ......... [ 9%] tests/test_spec_examples.py ......... [ 11%] tests/lib2to3/test_convert.py ............ [ 14%] tests/lib2to3/test_convert_operation.py ...... [ 15%] tests/lib2to3/test_convert_parameter.py ................ [ 19%] tests/lib2to3/test_convert_parameters.py ... [ 20%] tests/lib2to3/test_convert_path.py ........... [ 22%] tests/lib2to3/test_convert_paths.py .... [ 23%] tests/lib2to3/test_convert_request_body.py ..... [ 24%] tests/lib2to3/test_convert_request_body_formdata.py ............ [ 27%] tests/lib2to3/test_convert_response.py ............. [ 30%] tests/lib2to3/test_convert_responses.py .... [ 31%] tests/renderers/httpdomain/test_render.py ...FF.... [ 33%] tests/renderers/httpdomain/test_render_json_schema_description.py .................................................................................................. [ 56%] [ 56%] tests/renderers/httpdomain/test_render_operation.py ............. [ 59%] tests/renderers/httpdomain/test_render_parameter.py .......................................... [ 68%] tests/renderers/httpdomain/test_render_parameters.py ............. [ 71%] tests/renderers/httpdomain/test_render_paths.py ......... [ 73%] tests/renderers/httpdomain/test_render_request_body.py .... [ 74%] tests/renderers/httpdomain/test_render_request_body_example.py ......................... [ 80%] tests/renderers/httpdomain/test_render_response.py .................................... [ 88%] tests/renderers/httpdomain/test_render_response_example.py .............................. [ 95%] tests/renderers/httpdomain/test_render_responses.py ........ [ 97%] tests/renderers/httpdomain/test_render_restructuredtext_markup.py .......... [100%] ================================================================================= FAILURES ================================================================================= _______________________________________________________________________ test_render[v2.0/uber.json] ________________________________________________________________________ testrenderer = testspec = {'basePath': '/v1', 'definitions': {'Activities': {'properties': {'count': {'description': 'Total number of items avai...com', 'info': {'description': 'Move your app forward with the Uber API', 'title': 'Uber API', 'version': '1.0.0'}, ...} rendered = PosixPath('/home/tkloczko/rpmbuild/BUILD/openapi-0.7.0/tests/renderers/httpdomain/rendered') def test_render(testrenderer, testspec, rendered): testspec_name, testspec = testspec rendered_markup = "\n".join(testrenderer.render_restructuredtext_markup(testspec)) > assert rendered_markup == rendered.joinpath(testspec_name + ".rst").read_text() E AssertionError: assert '.. http:get:...ected error\n' == '.. http:get:...ected error\n' E Skipping 1312 identical leading characters in diff, use -v to show E tes** E E - .. role:: raw-html-md(raw) E - :format: html E - E - ... E E ...Full output truncated (150 lines hidden), use '-vv' to show tests/renderers/httpdomain/test_render.py:25: AssertionError _______________________________________________________________________ test_render[v2.0/uber.yaml] ________________________________________________________________________ testrenderer = testspec = {'basePath': '/v1', 'definitions': {'Activities': {'properties': {'count': {'description': 'Total number of items avai...com', 'info': {'description': 'Move your app forward with the Uber API', 'title': 'Uber API', 'version': '1.0.0'}, ...} rendered = PosixPath('/home/tkloczko/rpmbuild/BUILD/openapi-0.7.0/tests/renderers/httpdomain/rendered') def test_render(testrenderer, testspec, rendered): testspec_name, testspec = testspec rendered_markup = "\n".join(testrenderer.render_restructuredtext_markup(testspec)) > assert rendered_markup == rendered.joinpath(testspec_name + ".rst").read_text() E AssertionError: assert '.. http:get:...ected error\n' == '.. http:get:...ected error\n' E Skipping 1313 identical leading characters in diff, use -v to show E tes** E E - .. role:: raw-html-md(raw) E - :format: html E - E - ... E E ...Full output truncated (150 lines hidden), use '-vv' to show tests/renderers/httpdomain/test_render.py:25: AssertionError ============================================================================= warnings summary ============================================================================= ../../../../../usr/lib/python3.8/site-packages/pkg_resources/__init__.py:123 /usr/lib/python3.8/site-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: 1.17.1-unknown is an invalid version and will not be supported in a future release warnings.warn( ../../../../../usr/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/version.py:111 /usr/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/version.py:111: DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release warnings.warn( -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ========================================================================= short test summary info ========================================================================== FAILED tests/renderers/httpdomain/test_render.py::test_render[v2.0/uber.json] - AssertionError: assert '.. http:get:...ected error\n' == '.. http:get:...ected error\n' FAILED tests/renderers/httpdomain/test_render.py::test_render[v2.0/uber.yaml] - AssertionError: assert '.. http:get:...ected error\n' == '.. http:get:...ected error\n' ================================================================ 2 failed, 432 passed, 2 warnings in 7.10s ================================================================= /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-98d24dec-bba3-4d76-baf7-40ffe34b971e/test_rmtree_errorhandler_rerai0 : [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-98d24dec-bba3-4d76-baf7-40ffe34b971e/test_rmtree_errorhandler_reado0 : [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-98d24dec-bba3-4d76-baf7-40ffe34b971e/test_safe_delete_no_perms0 : [Errno 39] Directory not empty: 'test_safe_delete_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-98d24dec-bba3-4d76-baf7-40ffe34b971e/test_safe_set_no_perms0 : [Errno 39] Directory not empty: 'test_safe_set_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-98d24dec-bba3-4d76-baf7-40ffe34b971e/test_safe_get_no_perms0 : [Errno 39] Directory not empty: 'test_safe_get_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-98d24dec-bba3-4d76-baf7-40ffe34b971e : [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-98d24dec-bba3-4d76-baf7-40ffe34b971e' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-dc31f309-b95a-4271-9667-1339f46c53a6/test_rmtree_errorhandler_rerai0 : [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-dc31f309-b95a-4271-9667-1339f46c53a6/test_rmtree_errorhandler_reado0 : [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-dc31f309-b95a-4271-9667-1339f46c53a6/test_safe_delete_no_perms0 : [Errno 39] Directory not empty: 'test_safe_delete_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-dc31f309-b95a-4271-9667-1339f46c53a6/test_safe_set_no_perms0 : [Errno 39] Directory not empty: 'test_safe_set_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-dc31f309-b95a-4271-9667-1339f46c53a6/test_safe_get_no_perms0 : [Errno 39] Directory not empty: 'test_safe_get_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-dc31f309-b95a-4271-9667-1339f46c53a6 : [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-dc31f309-b95a-4271-9667-1339f46c53a6' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-41642e46-df79-48ac-ae9b-7dcabd12c5d1/test_rmtree_errorhandler_rerai0 : [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-41642e46-df79-48ac-ae9b-7dcabd12c5d1/test_rmtree_errorhandler_reado0 : [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-41642e46-df79-48ac-ae9b-7dcabd12c5d1/test_safe_delete_no_perms0 : [Errno 39] Directory not empty: 'test_safe_delete_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-41642e46-df79-48ac-ae9b-7dcabd12c5d1/test_safe_set_no_perms0 : [Errno 39] Directory not empty: 'test_safe_set_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-41642e46-df79-48ac-ae9b-7dcabd12c5d1/test_safe_get_no_perms0 : [Errno 39] Directory not empty: 'test_safe_get_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-41642e46-df79-48ac-ae9b-7dcabd12c5d1 : [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-41642e46-df79-48ac-ae9b-7dcabd12c5d1' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-a2628007-f0c4-42c8-9f20-1e2e295151c4/test_safe_delete_no_perms0 : [Errno 39] Directory not empty: 'test_safe_delete_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-a2628007-f0c4-42c8-9f20-1e2e295151c4/test_safe_set_no_perms0 : [Errno 39] Directory not empty: 'test_safe_set_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-a2628007-f0c4-42c8-9f20-1e2e295151c4/test_safe_get_no_perms0 : [Errno 39] Directory not empty: 'test_safe_get_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-a2628007-f0c4-42c8-9f20-1e2e295151c4 : [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-a2628007-f0c4-42c8-9f20-1e2e295151c4' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-a718da0f-bb8c-48f5-bc67-8d453447c5ea/test_rmtree_errorhandler_rerai0 : [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-a718da0f-bb8c-48f5-bc67-8d453447c5ea/test_rmtree_errorhandler_reado0 : [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-a718da0f-bb8c-48f5-bc67-8d453447c5ea/test_safe_delete_no_perms0 : [Errno 39] Directory not empty: 'test_safe_delete_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-a718da0f-bb8c-48f5-bc67-8d453447c5ea/test_safe_set_no_perms0 : [Errno 39] Directory not empty: 'test_safe_set_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-a718da0f-bb8c-48f5-bc67-8d453447c5ea/test_safe_get_no_perms0 : [Errno 39] Directory not empty: 'test_safe_get_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-a718da0f-bb8c-48f5-bc67-8d453447c5ea : [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-a718da0f-bb8c-48f5-bc67-8d453447c5ea' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-2d3a5dfb-e58b-4cbe-a863-0126e0f50568/test_rmtree_errorhandler_rerai0 : [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-2d3a5dfb-e58b-4cbe-a863-0126e0f50568/test_rmtree_errorhandler_reado0 : [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-2d3a5dfb-e58b-4cbe-a863-0126e0f50568/test_safe_delete_no_perms0 : [Errno 39] Directory not empty: 'test_safe_delete_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-2d3a5dfb-e58b-4cbe-a863-0126e0f50568/test_safe_set_no_perms0 : [Errno 39] Directory not empty: 'test_safe_set_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-2d3a5dfb-e58b-4cbe-a863-0126e0f50568/test_safe_get_no_perms0 : [Errno 39] Directory not empty: 'test_safe_get_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:79: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-2d3a5dfb-e58b-4cbe-a863-0126e0f50568 : [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-2d3a5dfb-e58b-4cbe-a863-0126e0f50568' warnings.warn( ```
qmonnet commented 1 year ago

@kloczek is it passing for you on master without the PR?

kloczek commented 1 year ago

@kloczek is it passing for you on master without the PR?

I have no idea because on my build infra I cannot send build request because broken build dependencies when m2r is used.

hmaarrfk commented 1 year ago

Is there a viable fork of this project? It would be good to be able to get this functionality to work again.

hmaarrfk commented 1 year ago

Should we post: https://github.com/sphinx-contrib/github-administration to see if there is a path to reviving this project.

I think we could setup the CIs again and start moving it forward. There seems to be about 10 small PRs that would benefit from a bit of maintenance.

qmonnet commented 1 year ago

Just tested master + this PR and pytest is failing for me

@kloczek Right, I could reproduce, not sure how I missed it the first time. Thanks! I adjusted the tests accordingly. It's a bit dirty because I had to adjust the base JSON/YAML files used for the tests, but apart from updating mdinclude, I don't have a better proposal right now. See the last commit I pushed for details.

qmonnet commented 1 year ago

@hmaarrfk Sorry, I'm not familiar with the github-administration repo. When you say "reviving this project", you mean openapi? (Not m2r, right? Which seems to be archived now, by the way). I'm not familiar with the process but we can get someone to give some attention and help maintaining openapi again, by all means, go ahead! :) Maybe try to keep the original authors/maintainers in the loop.

kloczek commented 1 year ago

OK just tested upodated PR and I was able to commit it, build it and pass cleanly pytest

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-openapi-0.7.0-5.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-openapi-0.7.0-5.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.15, pytest-7.2.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/openapi-0.7.0, configfile: tox.ini
plugins: xdist-3.0.2
collected 496 items

tests/test_openapi.py .................................                                                                                                              [  6%]
tests/test_schema_utils.py .........                                                                                                                                 [  8%]
tests/test_spec_examples.py ..............................................................                                                                           [ 21%]
tests/lib2to3/test_convert.py ............                                                                                                                           [ 23%]
tests/lib2to3/test_convert_operation.py ......                                                                                                                       [ 25%]
tests/lib2to3/test_convert_parameter.py ................                                                                                                             [ 28%]
tests/lib2to3/test_convert_parameters.py ...                                                                                                                         [ 28%]
tests/lib2to3/test_convert_path.py ...........                                                                                                                       [ 31%]
tests/lib2to3/test_convert_paths.py ....                                                                                                                             [ 32%]
tests/lib2to3/test_convert_request_body.py .....                                                                                                                     [ 33%]
tests/lib2to3/test_convert_request_body_formdata.py ............                                                                                                     [ 35%]
tests/lib2to3/test_convert_response.py .............                                                                                                                 [ 38%]
tests/lib2to3/test_convert_responses.py ....                                                                                                                         [ 39%]
tests/renderers/httpdomain/test_render.py .........                                                                                                                  [ 40%]
tests/renderers/httpdomain/test_render_json_schema_description.py .................................................................................................. [ 60%]
                                                                                                                                                                     [ 60%]
tests/renderers/httpdomain/test_render_operation.py .............                                                                                                    [ 63%]
tests/renderers/httpdomain/test_render_parameter.py ..........................................                                                                       [ 72%]
tests/renderers/httpdomain/test_render_parameters.py .............                                                                                                   [ 74%]
tests/renderers/httpdomain/test_render_paths.py .........                                                                                                            [ 76%]
tests/renderers/httpdomain/test_render_request_body.py ....                                                                                                          [ 77%]
tests/renderers/httpdomain/test_render_request_body_example.py .........................                                                                             [ 82%]
tests/renderers/httpdomain/test_render_response.py ....................................                                                                              [ 90%]
tests/renderers/httpdomain/test_render_response_example.py ..............................                                                                            [ 96%]
tests/renderers/httpdomain/test_render_responses.py ........                                                                                                         [ 97%]
tests/renderers/httpdomain/test_render_restructuredtext_markup.py ..........                                                                                         [100%]

============================================================================= warnings summary =============================================================================
../../../../../usr/lib/python3.8/site-packages/pkg_resources/__init__.py:123
  /usr/lib/python3.8/site-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: 1.17.1-unknown is an invalid version and will not be supported in a future release
    warnings.warn(

../../../../../usr/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/version.py:111
  /usr/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/version.py:111: DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
===================================================================== 487 passed, 2 warnings in 16.08s =====================================================================
stephenfin commented 1 year ago

As you can see, this is currently failing CI. Not your fault though: the deps in pre-commit are also rather out-of-date. If you could rebase this onto the changes in https://github.com/sphinx-contrib/openapi/pull/136 then you should get this pass :green_circle: and we can look to merge and release it.

stephenfin commented 1 year ago

I've actually gone ahead and rebased this myself. Let's see how this passes. There was a small formatting issue on the first commit so I fixed that as part of the rebase also.

kloczek commented 1 year ago

It is yet another thing. In sphinxcontrib/init.py sphinxcontrib-openapi used pkg_resources. This modle is already marked as deprecated and is known that it meeeses sys.path which bloks altering in conf.py path to sphinxcontrib-openapi to be able generate dosumentation without have installed sphinxcontrib-openapi (by just execute for rxample sphinx-build -n -T -b <out_format> docs build/sphinx).

On https://github.com/python/importlib_metadata/issues/378 is poasible to find some hints how to migrate to importlib-metadata.

stephenfin commented 1 year ago

Like this? https://github.com/sphinx-contrib/openapi/pull/137

kloczek commented 1 year ago

Yes 😄