Skip to content

fix: quote pip version specifier in ci.yml & move asyncio import to module level - #7

Closed
salem221094 wants to merge 3 commits into
HKUDS:mainfrom
salem221094:fix/ci-lint-errors
Closed

fix: quote pip version specifier in ci.yml & move asyncio import to module level#7
salem221094 wants to merge 3 commits into
HKUDS:mainfrom
salem221094:fix/ci-lint-errors

Conversation

@salem221094

Copy link
Copy Markdown
Contributor

What broke

CI run #24933019577 failed due to two bugs introduced in the feat/mcp-server merge (PR #6).

Bug 1 — Shell interprets >= as a redirect in ci.yml

# Before (broken)
- run: pip install ruff>=0.4

# After (fixed)
- run: pip install "ruff>=0.4"

Without quotes, bash treats >= as an output redirect (>) followed by =0.4 (a filename), so the install command fails before any linting can even begin.

Bug 2 — import asyncio inside function body in mcp_server.py

# Before (broken) — import buried at bottom of serve() body
def serve() -> None:
    ...
    import asyncio          # ← ruff E402 / isort violation
    async def _run(): ...
    asyncio.run(_run())

# After (fixed) — import at module level with other stdlib imports
import asyncio
import json
import logging

Ruff's I (isort) and E402 rules require all standard-library imports to be at the top of the file. Having import asyncio inside the function body causes ruff check to fail.

Changes

  • .github/workflows/ci.yml — quote the pip install "ruff>=0.4" argument
  • catchme/mcp_server.py — move import asyncio to the module-level imports block

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