[CLIENT-4425] Docs: fix broken cross references for type aliases#991
Open
juliannguyen4 wants to merge 173 commits intodevfrom
Open
[CLIENT-4425] Docs: fix broken cross references for type aliases#991juliannguyen4 wants to merge 173 commits intodevfrom
juliannguyen4 wants to merge 173 commits intodevfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #991 +/- ##
==========================================
- Coverage 83.87% 83.86% -0.02%
==========================================
Files 99 99
Lines 14514 14490 -24
==========================================
- Hits 12174 12152 -22
+ Misses 2340 2338 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…t documented _cdt_ctx (or private classes in general). TODO: add this error to ignore list
…typing module to make easier to read
… sphinx doesn't raise an error then.
…name to work, we need to add back these lines.
… to them as types
…. Do the same for the other type aliases.
…ing, just make them public for now. Trying to see if the doc's cross references now work for the other errors
…documented by default. Also fix more errors
…he anchor instead
…xpression isn't actually defined anywhere except in .rst
…ed as None to the user, otherwise maybe this should just be annotated as tuple
…es, and the latter is missing the type hint in the docs. So try unquoting to see if it shows up in docs preview. TODO - if it does then I should report this as an issue in repo
1 task
eda1a2b to
aec5004
Compare
…roken-internal-references # Conflicts: # aerospike_helpers/batch/records.py # aerospike_helpers/cdt_ctx.py # aerospike_helpers/expressions/arithmetic.py # aerospike_helpers/expressions/resources.py # doc/aerospike_helpers.expressions.rst # doc/client.rst # doc/conf.py # doc/query.rst # doc/transaction.rst
…roken-internal-references
…e type hints from the docstrings and adding them to the signatures so that the extension can insert the type hints in the docstrings. TODO there is a lot so just use AI
… TODO using a formatter would be easier i.e black
…and 2) remove the duplicate type hints in the docstrings after they are already in the signature
…n which should be documented)
…docstring if it only documents the type being returned.
…a cross ref to TypeExpression
…xpanded, since it's not defined in cdt_ctx.py
… to be expanded, since it's not defined in cdt_ctx.py" This reverts commit 0d7d81e.
…dt_ctx.py. (although not sure where cdt_ctx.py is being imported from)
…they are not evaluated at runtime. They are only used for type checking
…y we don't need to import Union, and this will hopefully fix the sphinx nitpicky errors around Union not being available at runtime"
…cstrings type hints should be documented in the classes
…_reference errors related to it. It also reduces repetition
…ne module. TODO - just use cursor from now on
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
list[TypeKey]as a type hint in a function signature.Drawbacks of using sphinx-autodoc-typehints
More compute energy and time is spent to inject the type hints into the docstrings
Extra Changes
_BaseExpr.compile()have long return types, but that's more of an internal implementation detail IMOaerospike_helpers.sphinx-autodoc-typehintsgenerates the type hints in the docstrings using the signatures.TODO
Replace outdated / deprecated typing classes with native ones. Check for option to trigger warning/err in ci/cd probably through mypyWill make a separate jira ticketsphinx-autodoc-typehints additional dependency requires Python 3.12+Shouldn't be a problem as long as the docs are compiled on readthedocs.orgKnown issues introduced here
fixed_cdt_ctxreturn value formatting is duplicated in cdt_ctx.py docsOut of scope
Manual testing
devaren't clickable and don't show up when searched. Now the type aliases are evaluated directly in the description. Before and after