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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im not so familiar with validating code block - mostly we dont use it as it makes docs build a lot slower
my concern with this change is that its setting
CodeBlock.option_spec
for any subsequent usagewith python its generally an anti-pattern to use any mutable vars on the class - for this reason - other code can change/redefine it and its not obvious on the class (or for any other instantiations). Mutable vars are generally defined post-instantiation - either in
__init__
or by returning a mutable var from a cached@property
in this case im surprised the Sphinx code allows it, but either way i think this is changing something it shouldnt
looking at the typing errors
in not sure on cause or fix tbh
in particular im trying to understand why this is flaking on some PRs and not others
the underlying issue appears to be related to this python/typeshed#11550
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... i see - its the mypy update PR that is failing here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also relevant sphinx-doc/sphinx#12067
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iiuc this PR would still fail the newer mypy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just realizing that all prs are failing this which is strange
trying to understand what changed - it kinda shouldnt have started without some code change
either way we need to address it asap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checking again and we dont actually pin versions (kinda by design, but perhaps we should do so for external deps)
some are set by pants/mypy setup - not sure how they can be pinned