Skip to content

fix: Fix CI failures#15

Open
joelostblom wants to merge 7 commits intomainfrom
fix/fix-ci
Open

fix: Fix CI failures#15
joelostblom wants to merge 7 commits intomainfrom
fix/fix-ci

Conversation

@joelostblom
Copy link
Copy Markdown

No description provided.

These directories are Sphinx fixture projects, not importable package code.

- Both tests/roots/test-altairplot/conf.py and tests/roots/test-altairplot-filearg/conf.py are top-level conf.py files.
- When mypy walks tests, it maps both to the same module name (conf) and raises Duplicate module named "conf".
- These files are test data for Sphinx builds (integration fixtures), so type-checking them adds little value compared to checking sphinxext_altair/ and actual test modules.

So the exclude avoids a structural false-positive from fixture layout, not a real typing bug.
…nly when option is present

- The original `**{"chart-var-name": ...}` likely existed because chart-var-name contains a hyphen, so it cannot be passed as a normal keyword argument.
- New behavior: create node first, then only set plot_node["chart-var-name"] when user provided that option.
- Downstream code uses node.get("chart-var-name", None), so behavior is effectively the same for runtime logic.
Why the old assertions were brittle:

- They asserted giant exact HTML blobs (including whitespace, token spans, and exact Vega-Lite schema URL string).
- Those details are affected by upstream tooling changes:
  - Sphinx/Pygments changed tokenized output (<span class="w"> spacing, etc.)
  - Altair schema string changed from v5.20.1 to v6.1.0
- So tests failed even though core behavior (plot rendered, options respected) was still correct.

New approach:
1. Parse HTML and assert DOM structure (order/sections/classes) instead of raw substrings.
2. Regex-match the embedded spec/actions blocks (strict on keys/values, loose on whitespace/order).
3. Keep one small “golden” snippet for critical template output, not entire page chunks.
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.

1 participant