Skip to content

Environment refresh + ty as pre-commit hook - #213

Merged
hmgaudecker merged 1 commit into
mainfrom
update-env-ty-prek-hook
Jul 3, 2026
Merged

Environment refresh + ty as pre-commit hook#213
hmgaudecker merged 1 commit into
mainfrom
update-env-ty-prek-hook

Conversation

@hmgaudecker

@hmgaudecker hmgaudecker commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Environment refresh plus migration of type checking from a pixi task to the
official ty-pre-commit hook, following the updated
ai-instructions
boilerplate.

ty: pixi task → pre-commit hook

  • Add astral-sh/ty-pre-commit (v0.0.56) with --no-project so uv neither
    creates a .venv/uv.lock nor resolves deps; ty resolves third-party imports
    from [tool.ty] environment.python = ".pixi/envs/default".
  • Drop the ty conda dependency and the ty pixi task.
  • Skip the ty hook on pre-commit.ci (no pixi env, no network at hook
    runtime); the GitHub Actions run-ty job now runs
    pixi run prek run ty --all-files.
  • Update AGENTS.md to describe the new flow.

Environment / tooling refresh

  • Bump the .ai-instructions submodule to latest (d15d55468dc3f4):
    modular tiers, distilled modules, ty-hook overhaul.
  • pixi self-update to 0.72.0 and a full pixi update of pixi.lock
    (numpy 2.5, pandas 3.0.3, python 3.14.6, …).
  • prek autoupdate: ruff v0.15.20, check-jsonschema 0.37.4,
    pyproject-fmt v2.25.1.
  • Workflow version bumps (supersedes Bump the github-actions group across 1 directory with 3 updates #211): actions/checkout@v7,
    prefix-dev/setup-pixi@v0.10.0, pixi-version: v0.72.0,
    codecov/codecov-action@v7.
  • .gitignore: add pytask.lock / pytask.lock.journal (newer pytask writes a
    root-level lock).

nodejs pinned to <26 (temporary)

The full pixi update pulled node 26, which breaks the run-docs job
(GET /favicon.ico 500ERR_STREAM_PREMATURE_CLOSE). Root cause is a known
Node regression (nodejs/node#63989):
a security backport added a data listener on idle http.Agent sockets, which
trips a latent node-fetch@2 keep-alive+gzip bug — and mystmd's book-theme
fetches the favicon over exactly that path. Same bug hit 24.17.0 (fixed 24.18.0)
and 22.23.0 (fixed 22.23.1); fix PR #64004
merged to main 2026-06-20 but is not yet in a released 26.x. node 25.9 is
unaffected only because it predates the backport — note it is EOL (2026-06-01),
so this pin should move to a fixed 26.x (and drop) once conda-forge ships one.

Superseded PRs

Verification (local)

  • prek run ty --all-files ✅ · full prek run --all-files ✅ (idempotent)
  • All Python tests ✅ · paper PDF build ✅ · docs HTML build ✅ (node 25)
  • task_compile_presentation (Slidev PDF export) needs a headless Chromium and
    is only exercised on CI.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.34%. Comparing base (ae91725) to head (d6b8ec0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #213   +/-   ##
=======================================
  Coverage   99.34%   99.34%           
=======================================
  Files          10       10           
  Lines         153      153           
=======================================
  Hits          152      152           
  Misses          1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Migrate type checking from a pixi task to the official ty-pre-commit hook,
matching the ai-instructions boilerplate:

- Add astral-sh/ty-pre-commit (v0.0.56) with `--no-project`; ty resolves
  third-party imports from `[tool.ty] environment.python = .pixi/envs/default`.
- Drop the `ty` conda dependency and the `ty` pixi task.
- Skip the ty hook on pre-commit.ci (no pixi env / no network there); the
  GitHub Actions run-ty job runs `prek run ty --all-files` instead.
- Update AGENTS.md accordingly.

Also:
- Bump .ai-instructions submodule to latest (modular tiers, ty-hook overhaul).
- pixi self-update to 0.72.0 and full `pixi update` of pixi.lock.
- prek autoupdate: ruff v0.15.20, check-jsonschema 0.37.4, pyproject-fmt v2.25.1.
- Workflow: actions/checkout@v7, setup-pixi@v0.10.0, pixi-version v0.72.0,
  codecov-action@v7.
- gitignore pytask.lock / pytask.lock.journal.
- Pin nodejs <26: node 26's stricter stream handling breaks mystmd's book-theme
  favicon fetch during the docs build (ERR_STREAM_PREMATURE_CLOSE), which fails
  the run-docs CI job. Verified the docs build is green again on node 25.9.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@hmgaudecker
hmgaudecker force-pushed the update-env-ty-prek-hook branch from 2225d77 to d6b8ec0 Compare July 3, 2026 09:49

@hmgaudecker hmgaudecker left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Autoreview

@hmgaudecker
hmgaudecker merged commit 5d25653 into main Jul 3, 2026
9 checks passed
@hmgaudecker
hmgaudecker deleted the update-env-ty-prek-hook branch July 3, 2026 10:03
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