Skip to content

fix(pre-commit): use single pytest dependency specifier#39137

Closed
deepujain wants to merge 2 commits into
openclaw:mainfrom
deepujain:fix/pre-commit-pytest-dep
Closed

fix(pre-commit): use single pytest dependency specifier#39137
deepujain wants to merge 2 commits into
openclaw:mainfrom
deepujain:fix/pre-commit-pytest-dep

Conversation

@deepujain

@deepujain deepujain commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Problem: The pre-commit config had additional_dependencies: [pytest>=8, <9]. In YAML this is parsed as two list items (pytest>=8 and <9), so pip tries to install a package named <9 and fails with Invalid requirement: '<9': Expected package name at the start of dependency specifier.
  • Why it matters: Pre-commit environment setup fails for anyone running hooks; the skills-python-tests hook cannot install.
  • What changed: Single specifier as one string: ["pytest>=8,<9"] so pip receives a valid PEP 440 range.
  • What did NOT change (scope boundary): No other files; no voice-call or other plugin changes. (Schema fixes are in fix(voice-call): add missing fields to plugin config JSON Schema #38892.)

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

User-visible / Behavior Changes

None. Pre-commit hook env install succeeds; no runtime behavior change.

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: any
  • pre-commit with the skills-python-tests hook

Steps

  1. Run pre-commit run --all-files or trigger a commit that runs hooks.
  2. Before: install step fails with invalid requirement <9.
  3. After: dependency installs; hook can run (or skip if no skills/*.py changed).

Expected

Pre-commit installs the local hook env without error.

Actual

As expected after the fix.

Evidence

  • Single-line YAML fix; pip accepts pytest>=8,<9 as one specifier.
  • Trace/log snippets: N/A
  • Screenshot/recording: N/A

Human Verification (required)

  • Verified scenarios: Changed to ["pytest>=8,<9"]; confirmed YAML list has one element and pip install succeeds.
  • Edge cases checked: N/A.
  • What you did not verify: Full pre-commit matrix on all platforms.

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Failure Recovery (if this breaks)

  • Revert the single line in .pre-commit-config.yaml.
  • No config to restore.

Risks and Mitigations

None. One-string dependency spec; no behavior change beyond fixing install.

Real behavior proof

Behavior or issue addressed: The skills-python-tests pre-commit hook now carries one valid pytest dependency string instead of a YAML list that splits into pytest>=8 and an invalid standalone <9.

Real environment tested: Local checkout of the PR branch in a real terminal session.

Exact steps or command run after this patch:

sed -n '104,116p' .pre-commit-config.yaml
ruby -e 'require "yaml"; data = YAML.load_file(".pre-commit-config.yaml"); hook = data["repos"].find { |r| r["repo"] == "local" }["hooks"].find { |h| h["id"] == "skills-python-tests" }; p hook["additional_dependencies"]'

Evidence after fix:

$ sed -n '104,116p' .pre-commit-config.yaml
  - repo: local
    hooks:
      - id: skills-python-tests
        name: skills python tests
        entry: pytest -q skills
        language: python
        additional_dependencies: ["pytest>=8,<9"]
        pass_filenames: false
        files: "^skills/.*\\.py$"
$ ruby -e 'require "yaml"; data = YAML.load_file(".pre-commit-config.yaml"); hook = data["repos"].find { |r| r["repo"] == "local" }["hooks"].find { |h| h["id"] == "skills-python-tests" }; p hook["additional_dependencies"]'
["pytest>=8,<9"]

Observed result after fix: The hook definition on this branch loads as a single dependency entry, so pre-commit no longer forwards a bogus standalone <9 requirement to pip.

What was not tested: A full end-to-end pre-commit run --all-files install in a fresh environment on every platform.

@greptile-apps

greptile-apps Bot commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a YAML parsing bug in .pre-commit-config.yaml where additional_dependencies: [pytest>=8, <9] was being interpreted as two separate list items (pytest>=8 and <9), causing pip to fail with Invalid requirement: '<9'. The fix wraps the full specifier in quotes as a single string "pytest>=8,<9", which is a valid PEP 440 version range.

  • The fix is correct and minimal — YAML inline sequences split on commas, so the combined constraint must be a single quoted element.
  • No other files are affected; no runtime behavior changes.

Confidence Score: 5/5

  • This PR is safe to merge — it is a trivial, clearly correct one-line YAML fix with no risk of regressions.
  • The change is a single-line correction to a YAML dependency specifier. The root cause (YAML list parsing splitting on commas) is well understood, the fix is the canonical solution, and there are no other affected files or side effects.
  • No files require special attention.

Last reviewed commit: 219f3fc

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Apr 23, 2026
@deepujain
deepujain force-pushed the fix/pre-commit-pytest-dep branch from 219f3fc to 8049eca Compare April 23, 2026 06:01
@deepujain

Copy link
Copy Markdown
Contributor Author

Rebased this onto current main and reran a focused YAML sanity check. additional_dependencies now loads as a single pytest>=8,<9 requirement, so this should be ready for another look.

@deepujain

Copy link
Copy Markdown
Contributor Author

Refreshing this thread so stale does not close it out. This branch is already rebased on current main, the YAML sanity check looked good locally, and the GitHub checks are green.

@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Apr 24, 2026
@deepujain

Copy link
Copy Markdown
Contributor Author

Swept this PR again after the stale ping. The branch is still current enough for the existing fix, CI is green, and I did not find any actionable review comments to address.

@clawsweeper

clawsweeper Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Latest ClawSweeper review: 2026-05-24 04:16 UTC / May 24, 2026, 12:16 AM ET.

Workflow note: Future ClawSweeper reviews update this same comment in place.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

PR Surface
Other 0. Total 0 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 1 1 1 0

Summary
The PR quotes the skills-python-tests pytest version range in .pre-commit-config.yaml so pre-commit passes one pytest>=8,<9 dependency to pip.

Reproducibility: yes. Current main parses the hook dependency as pytest>=8 plus standalone <9, and Python packaging rejects standalone <9 as an invalid requirement.

PR rating
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Summary: The patch is clean and well-proven for the narrow config bug, with merge readiness limited by stale failed CI that maintainers need to refresh or adjudicate.

Rank-up moves:

  • Rerun or adjudicate check-test-types and the aggregate check job on a current merge ref before merge.
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Real behavior proof
Sufficient (terminal): The PR body includes terminal proof from the fixed branch showing the hook dependency parses as one pytest>=8,<9 entry, which directly demonstrates the YAML parsing fix.

Risk before merge

  • The latest live PR status is UNSTABLE with failed check-test-types and aggregate check, so maintainers should refresh the current merge ref or explicitly record that the failures are unrelated before merging automation config.
  • The PR head is older than current main; GitHub reports it as mergeable, but final validation should happen on a current merge ref.

Maintainer options:

  1. Refresh Required CI (recommended)
    Rerun the current merge ref and require check-test-types plus the aggregate check job to pass before merge.
  2. Adjudicate Failed Jobs
    If maintainers know the failed jobs are unrelated to this YAML-only change, record that decision before merging with the known check state.
  3. Apply The Fix Fresh
    If the source branch cannot get a clean current check state, apply the same one-line config change from current main on a fresh branch.

Next step before merge
No repair job is needed; maintainers should rerun or adjudicate the failed CI jobs before merging the otherwise valid one-line fix.

Security
Cleared: The diff only changes an existing pytest version constraint string in pre-commit config and does not add a dependency source, permission, secret path, or runtime execution surface.

Review details

Best possible solution:

Land the one-line quoted dependency fix on a current merge ref after required checks pass or maintainers record that the failed jobs are unrelated.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main parses the hook dependency as pytest>=8 plus standalone <9, and Python packaging rejects standalone <9 as an invalid requirement.

Is this the best way to solve the issue?

Yes. Quoting the full version range as one YAML scalar is the narrow maintainable fix, with no need for a broader pre-commit refactor.

Label justifications:

  • P3: This is a low-blast-radius repository automation fix for a pre-commit dependency string, not runtime product behavior.
  • merge-risk: 🚨 automation: The PR changes automation config while live required-check state still includes failed check-test-types and aggregate check jobs.
  • rating: 🐚 platinum hermit: Current PR rating is 🐚 platinum hermit because proof is 🦞 diamond lobster, patch quality is 🐚 platinum hermit, and The patch is clean and well-proven for the narrow config bug, with merge readiness limited by stale failed CI that maintainers need to refresh or adjudicate.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes terminal proof from the fixed branch showing the hook dependency parses as one pytest>=8,<9 entry, which directly demonstrates the YAML parsing fix.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes terminal proof from the fixed branch showing the hook dependency parses as one pytest>=8,<9 entry, which directly demonstrates the YAML parsing fix.

Acceptance criteria:

  • gh pr view 39137 --repo openclaw/openclaw --json mergeable,mergeStateStatus,statusCheckRollup
  • ruby -e 'require "yaml"; data = YAML.load_file(".pre-commit-config.yaml"); hook = data["repos"].find { |r| r["repo"] == "local" }["hooks"].find { |h| h["id"] == "skills-python-tests" }; p hook["additional_dependencies"]'
  • python -c 'from packaging.requirements import Requirement; Requirement("pytest>=8,<9")'

What I checked:

  • Current main source: Current main still has additional_dependencies: [pytest>=8, <9] for the skills-python-tests hook at line 67. (.pre-commit-config.yaml:67, d0751111a472)
  • Current-main reproduction: Ruby YAML parsing of current main loads the dependency list as two entries: ["pytest>=8", "<9"]. (.pre-commit-config.yaml:67, d0751111a472)
  • Dependency parser contract: Python packaging accepts pytest>=8,<9 and rejects standalone <9 with InvalidRequirement Expected package name at the start of dependency specifier.
  • PR diff: The branch changes only the dependency list from [pytest>=8, <9] to ["pytest>=8,<9"]. (.pre-commit-config.yaml:67, 1cefa4a75fba)
  • Live PR status: GitHub reports the PR as mergeable but UNSTABLE; check-test-types and aggregate check failed on the latest head check run. (1cefa4a75fba)
  • Feature history: git log -S shows the skills Python pre-commit hook was introduced in commit 76dabd5214..., which added the unquoted pytest dependency range. (.pre-commit-config.yaml:86, 76dabd5214b4)

Likely related people:

  • vincentkoc: Authored the commit that added the skills Python CI/pre-commit hook containing the affected pytest dependency entry. (role: introduced behavior; confidence: high; commits: 76dabd5214b4; files: .pre-commit-config.yaml, .github/workflows/ci.yml)
  • Vignesh Natarajan: Authored the later formatting commit that touched the exact dependency spelling, though the unquoted YAML split behavior already existed. (role: adjacent contributor; confidence: medium; commits: 5a0eb695fa0f; files: .pre-commit-config.yaml)
  • steipete: Recent commits recreated or carried the current .pre-commit-config.yaml contents with the same split dependency line. (role: recent area contributor; confidence: medium; commits: 459cee53153c, a374c3a5bfd5; files: .pre-commit-config.yaml)

Codex review notes: model gpt-5.5, reasoning high; reviewed against d0751111a472.

@vincentkoc vincentkoc self-assigned this Apr 26, 2026
@vincentkoc vincentkoc added the stale Marked as stale due to inactivity label Apr 26, 2026
@vincentkoc

Copy link
Copy Markdown
Member

This assigned pull request has been marked as stale after being open for 27 days.
Please add updates or it will be closed.

@deepujain

Copy link
Copy Markdown
Contributor Author

Refreshing this after the latest stale ping. Current main still has the split pytest dependency entry, while this PR keeps it as one valid pytest>=8,<9 requirement string. CI is green, Greptile is 5/5, and the PR is clean/mergeable.

@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Apr 27, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Apr 27, 2026
@deepujain

Copy link
Copy Markdown
Contributor Author

Refreshing this after the latest stale ping. Current upstream/main (05a93c1) still has the split additional_dependencies: [pytest>=8, <9] entry for skills-python-tests, so this PR remains the narrow one-line fix to pass pip one valid pytest>=8,<9 requirement string. Existing CI is green and Greptile is 5/5.

@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Apr 28, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Apr 28, 2026
@deepujain

Copy link
Copy Markdown
Contributor Author

Refreshing this after the latest stale ping. Current upstream/main (7b2b0d0) still has the split additional_dependencies: [pytest>=8, <9] entry for skills-python-tests, so this PR is still the narrow one-line fix to pass pip one valid pytest>=8,<9 requirement string. Existing CI is green and Greptile is 5/5.

@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Apr 29, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Apr 29, 2026
@deepujain

Copy link
Copy Markdown
Contributor Author

Refreshing this after the latest stale ping. Current upstream/main (2a7d83b) still has the split additional_dependencies: [pytest>=8, <9] entry for the skills-python-tests hook, so this PR is still the narrow one-line fix to pass pip one valid pytest>=8,<9 requirement string. CI is green and Greptile is 5/5.

@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Apr 30, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added stale Marked as stale due to inactivity and removed stale Marked as stale due to inactivity labels Apr 30, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added stale Marked as stale due to inactivity and removed stale Marked as stale due to inactivity labels May 14, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added stale Marked as stale due to inactivity and removed stale Marked as stale due to inactivity labels May 15, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label May 16, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. labels May 16, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label May 17, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label May 17, 2026
@clawsweeper clawsweeper Bot added the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label May 18, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label May 18, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label May 18, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. label May 18, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label May 19, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label May 19, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels May 19, 2026
@clawsweeper

clawsweeper Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🥚 common Pearl Signal Puff

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🥚 common.
Trait: hums during re-review.
Image traits: location flaky test forest; accessory proof snapshot camera; palette pearl, teal, and neon green; mood watchful; pose sitting proudly on a smooth stone; shell woven fiber shell; lighting cool dashboard glow; background subtle branch markers.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Pearl Signal Puff in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label May 20, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@barnacle-openclaw

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #clawtributors on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS stale Marked as stale due to inactivity status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants