Skip to content

Conversation

@mfisher87
Copy link
Member

@mfisher87 mfisher87 commented Mar 20, 2025

Description

The API docs are currently not building because of a failure to import the documented module. Worse, this only displays as a warning, so this has been happening silently for some time (since #412). The content in the HTML has been missing 😱

--fail-on-warning: Warnings fail the build

--keep-going: Don't stop building when warnings occur; complete the build, show all warnings, and fail at the end.

--nitpicky: Fail on bad internal links

Checklist

  • PR has a descriptive title and content.
  • PR description contains references to any issues the PR resolves, e.g. Resolves #XXX.
  • PR has one of the labels: documentation, bug, enhancement, feature, maintenance
  • Checks are passing.
    Failing lint checks can be resolved with:
    • pre-commit run --all-files
    • jlpm run lint

📚 Documentation preview: https://jupytergis--556.org.readthedocs.build/en/556/
💡 JupyterLite preview: https://jupytergis--556.org.readthedocs.build/en/556/lite

@github-actions
Copy link
Contributor

Binder 👈 Launch a Binder on branch mfisher87/jupytergis/fix-api-docs

@mfisher87 mfisher87 added the documentation Improvements or additions to documentation label Mar 20, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Mar 20, 2025

Integration tests report: appsharing.space

Setting up the environment should probably be decoupled from the build
helper script.
@mfisher87
Copy link
Member Author

mfisher87 commented Mar 20, 2025

Some context: https://github.com/geojupyter/jupytergis/pull/412/files#r1942477561

cc @martinRenou @davidbrochart

Could you all please provide a summary of that discussion thread? I'm struggling to understand why the lines which installed the built JupyterGIS wheels into the docs environment were removed; that turned out to be the root cause of the missing API docs. I'm also curious about what we should do about requirements-build.txt if the dependencies within conflict with the Lite build. Should we have a separate requirements-build-lite.txt?

This actually worked locally 🙏
```
/home/docs/micromamba/envs/jupytergis-docs/lib/python3.12/site-packages/jupytergis_lab/notebook/gis_document.py:docstring of jupytergis_lab.notebook.gis_document.GISDocument:5: WARNING: Field list ends without a blank line; unexpected unindent. [docutils]
```
@mfisher87
Copy link
Member Author

Whew, finally got it! To get it passing without any warnings I needed to change some docstrings and type annotations.

@mfisher87 mfisher87 marked this pull request as ready for review March 20, 2025 15:27
feature: str | None = None,
operator: str | None = None,
value: Union[str, number, float] | None = None,
value: Union[str, int, float] | None = None,
Copy link
Member Author

Choose a reason for hiding this comment

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

Switching between typescript and python is a big oof on my brain 🤕

:param normalize: Select whether to normalize values between 0..1, if false than min/max have no effect, defaults to True
:param wrapX: Render tiles beyond the tile grid extent, defaults to False
:param opacity: The opacity, between 0 and 1, defaults to 1.0
:param color_expr: The style expression used to style the layer, defaults to None
Copy link
Member Author

Choose a reason for hiding this comment

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

Repeating the types in the docstring is not necessary, the documentation generator will find the annotations in the function signature!

"""Build all JupyterGIS packages.
IMPORTANT: Requires dependencies in requirements-build.txt
"""
Copy link
Member Author

Choose a reason for hiding this comment

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

I felt we should decouple dependency install from building.

Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

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

Agreed! Thanks

The removal of jupyterlite-qgis was to not have the extension installed for jupyterlite. But it may be harmless as I see the jupyterlite deployment working well.

@martinRenou martinRenou merged commit 44a0ee3 into geojupyter:main Mar 20, 2025
14 checks passed
@mfisher87 mfisher87 deleted the fix-api-docs branch March 20, 2025 15:49
@mfisher87 mfisher87 linked an issue Mar 20, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python API reference docs not being rendered

2 participants