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

Fix sphinx-build warnings and turn warnings into errors #942

Merged
merged 7 commits into from
Jun 13, 2023

Conversation

benhoyt
Copy link
Collaborator

@benhoyt benhoyt commented Jun 2, 2023

Fix the 100+ warnings when generating docs (and make warnings errors)

  • Hack-fix issue with hyphenated names in TypedDict fields
  • Ignore several private classes in Sphinx config's nitpick_ignore list
  • Make several things public as they're used in public methods:
    • Serializable protocol
    • Pebble plan/layer TypesDicts (and sub-dicts), as people do build those in Python
  • Remove TypedDicts for charm metadata (it's not useful, as users don't build their charm metadata in Python; it's in YAML).
  • Remove TypedDicts for event snapshots, as IMO these don't add enough value to pay for themselves.
  • Replace some named types with spelled-out types for clarity, eg: _SerializedData is just Dict[str, Any]; Numerical is just Union[int, float].
  • Use simpler Dict[str, Any] rather than _JsonObject (the more complex, "exact" type doesn't pay for itself).
  • Change EventSource and BoundEvent to non-generic classes to simplify. (TODO: not sure if this is a good idea)

Part of: #920

@benhoyt benhoyt changed the title Fix sphinx-build warnings and update some types accordingly Fix sphinx-build warnings and turn warnings into errors Jun 8, 2023
@benhoyt benhoyt marked this pull request as ready for review June 8, 2023 05:43
@benhoyt benhoyt merged commit 78ec6d5 into canonical:main Jun 13, 2023
@benhoyt benhoyt deleted the fix-docs-warnings branch June 13, 2023 20:48
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.

2 participants