Skip to content

build(deps): bump griffe to ~=2.1.0#242

Merged
rich-iannone merged 18 commits into
posit-dev:mainfrom
has2k1:bump-griffe-2.1.0
Jun 30, 2026
Merged

build(deps): bump griffe to ~=2.1.0#242
rich-iannone merged 18 commits into
posit-dev:mainfrom
has2k1:bump-griffe-2.1.0

Conversation

@has2k1

@has2k1 has2k1 commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Raise the floor from <2.0.0 to ~=2.1.0 and drop the now-dead version-conditional code that supported older griffe:

  • Remove _patch_griffe; griffe 2.x always exports CyclicAliasError and AliasResolutionError at the top level, so it was a no-op.
  • Detect PEP 695 type X = ... aliases in is_typealias via the dedicated TypeAlias kind (resolves the standing TODO); old-style X: TypeAlias = ... attributes still use the annotation heuristic.

has2k1 and others added 16 commits June 29, 2026 12:38
Add _symbol_info_for_dotted helper to resolve dotted names by walking the
griffe tree. Teach snapshot_from_griffe to capture documented_names
(nested symbols via dotted names) when provided; default (no documented_names)
preserves existing top-level __all__ behavior for back-compat.
Drop the class-prefix heuristic in _is_valid_ref_name in favour of exact
set membership: with deep snapshots, every valid page stem (including method
stems like Class.method) is present as a snapshot key, so a two-argument
name-in-set check is sufficient. Remove the now-unused valid_classes /
snapshot_classes path throughout _prune_reference_index, _prune_quarto_sidebar,
and _rebuild_api_from_snapshot.
Add test_resolver_matches_renderer_sections to assert documented_symbol_names
output equals the flattened _create_api_sections_from_config contents, so the
resolver and renderer can never silently diverge.

Add test_deduplication_preserves_first_occurrence_order to exercise the
dedup path: a config with the same symbol in two sections asserts the result
has no duplicates and preserves first-occurrence order.
`documented_symbol_names` now calls `_create_api_sections_with_config`
instead of `_create_api_sections_from_config`, so it consumes the same
nodoc-filtered section set the dev renderer uses. Symbols marked with
`%nodoc` are therefore excluded from the resolver output, eliminating
the over-inclusion bug where a versioned snapshot could render pages
the dev build hides.

Also routes diagnostic warning prints that appear in the discovery
pipeline to `sys.stderr` and suppresses all build-pipeline output
inside `documented_symbol_names` (a programmatic query that owns no
output stream), keeping the `api-diff --json` CLI path clean.
Raise the floor from <2.0.0 to ~=2.1.0 and drop the now-dead
version-conditional code that supported older griffe:

- Remove `_patch_griffe`; griffe 2.x always exports `CyclicAliasError`
  and `AliasResolutionError` at the top level, so it was a no-op.
- Detect PEP 695 `type X = ...` aliases in `is_typealias` via the
  dedicated `TypeAlias` kind (resolves the standing TODO); old-style
  `X: TypeAlias = ...` attributes still use the annotation heuristic.
  Fix incomplete API reference for versioned (tagged) docs (posit-dev#190)
@rich-iannone rich-iannone self-requested a review June 29, 2026 21:04
has2k1 and others added 2 commits June 29, 2026 17:15
Raise the floor from <2.0.0 to ~=2.1.0 and drop the now-dead
version-conditional code that supported older griffe:

- Remove `_patch_griffe`; griffe 2.x always exports `CyclicAliasError`
  and `AliasResolutionError` at the top level, so it was a no-op.
- Detect PEP 695 `type X = ...` aliases in `is_typealias` via the
  dedicated `TypeAlias` kind (resolves the standing TODO); old-style
  `X: TypeAlias = ...` attributes still use the annotation heuristic.

@rich-iannone rich-iannone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM and thank you!

@rich-iannone rich-iannone merged commit d2c668c into posit-dev:main Jun 30, 2026
8 checks passed
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