Skip to content

Fix generation of developer documentation for modules which rely on our generated comInterfaces#14016

Merged
seanbudd merged 3 commits into
nvaccess:masterfrom
lukaszgo1:comtypesGenCustomSearchPathForDevDocsBuild
Aug 16, 2022
Merged

Fix generation of developer documentation for modules which rely on our generated comInterfaces#14016
seanbudd merged 3 commits into
nvaccess:masterfrom
lukaszgo1:comtypesGenCustomSearchPathForDevDocsBuild

Conversation

@lukaszgo1

Copy link
Copy Markdown
Contributor

Link to issue number:

None - one of the prerequisites for eventual further work on #12971

Summary of the issue:

When trying to generate developer documentation various modules cannot be imported, and as a result it is impossible to generate any documentation from their docstrings.
In most cases this is caused by the fact that they try to import various com interfaces from our comInterfaces package, which cannot work since we set its path in a particular way at runtime.
The example error for one of the modules is as follows:

WARNING: autodoc: failed to import module 'IAccessibleHandler'; the following exception was raised:
cannot import name '_CE3F726E_D1D3_44FE_B995_FF1DB3B48B2B_0_1_3' from 'comtypes.gen' (D:\my_repos\nvda\.venv\lib\site-packages\comtypes\gen\__init__.py)

Description of user facing changes

None

Description of development approach

During developer documentation build our com interfaces directory is appended to the comtypes.gen search path, to match the behavior at runtime.

Testing strategy:

Generated developer documentation - made sure that there are no errors similar to the one shown in the problem description. Checked count of warnings before and after this change - their amount decreased from 532 to 484.

Known issues with pull request:

Since we now generate documentation for some modules which previously weren't importable this PR almost certainly introduces some new warnings. In my opinion any attempt at fixing warnings automatically or making note of which warnings are present and which are new should wait until all our modules can be imported successfully during build of the developer documentation, which is not yet the case.

Change log entries:

None needed

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English

@lukaszgo1 lukaszgo1 requested a review from a team as a code owner August 15, 2022 12:03
@lukaszgo1 lukaszgo1 requested a review from seanbudd August 15, 2022 12:03
@AppVeyorBot

Copy link
Copy Markdown
  • PASS: Translation comments check.
  • PASS: Unit tests.
  • PASS: Lint check.
  • Build execution time has reached the maximum allowed time for your plan (60 minutes).

See test results for failed build of commit 65dedd567a

Comment thread devDocs/conf.py Outdated
Comment thread devDocs/conf.py Outdated
lukaszgo1 and others added 2 commits August 16, 2022 07:29
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
@seanbudd seanbudd merged commit 565a668 into nvaccess:master Aug 16, 2022
@nvaccessAuto nvaccessAuto added this to the 2022.4 milestone Aug 16, 2022
@lukaszgo1 lukaszgo1 deleted the comtypesGenCustomSearchPathForDevDocsBuild branch August 16, 2022 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants