Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure sphinx correctly parses docstrings #991

Conversation

kristiankyvik
Copy link
Collaborator

@kristiankyvik kristiankyvik commented Jan 25, 2024

This addresses task 1 of this issue: #990

Here are the main changes:

  • The api_reference.rst is now up-to-date after running the create_api_rst.py locally and committing the generated files. Not sure it makes sense to commit all these files or if we simply want to generate them when we build the project
  • Ensure that we run the create_api_rst.py script in the pre_build step. I think this makes sense, but please let me know if you thing differently. I took inspiration from how the langchain project seems to have solved this

Update 1 - Did the two following changes:

  • Bumped sphinx to 5.0.0, after removing non-maintained package sphinx_panels that required an older version of sphinx
  • Mocked two packages that are installed as experimental, since these where causing an error when building the docs, since the packages were expected to be installed.

Update 2 - Did the following change:

  • Ensures the auto-generated docs are not commited to version control

@@ -65,7 +65,6 @@
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_copybutton",
"sphinx_panels",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that I removed this package because I wanted to update sphinx to 5.0.0 since:

  • We were seeing this error in the docs build pipeline (see link).
  • This package, which was not being uses anywhere, is not maintained anymore (link) and impeding us to update to this more recent version of sphinx.

@@ -86,6 +85,7 @@
autodoc_member_order = "groupwise"
autoclass_content = "both"
autodoc_typehints_format = "short"
autodoc_mock_imports = ["tree_sitter_languages", "llama-index"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After updating sphinx to 5.0.0, when building the docs, I was running into a different error:

Handler <function process_automodsumm_generation at 0x7fedb8d30430> for event 'builder-inited' threw an exception (exception: No module named 'gpt_engineer.tools.experimental.document_chunker')
make: *** [html] Error 2

I followed the advice here and ensure that the two files were mocked when building the docs. This fixed the issue.

Copy link
Collaborator

@TheoMcCabe TheoMcCabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good thank you

@TheoMcCabe TheoMcCabe merged commit 1896d83 into gpt-engineer-org:main Feb 5, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants