yuqi1129 opened a new issue, #12660:
URL: https://github.com/apache/gravitino/issues/12660

   ### Describe what's wrong
   
   Every CI job that runs `:mcp-server:formatCheckPython` fails, which 
currently blocks all backend integration test jobs (they run the check before 
the tests). Example: 
https://github.com/apache/gravitino/actions/runs/33028666622/job/98375952096
   
   ```
    + isort==9.0.0
   /home/runner/work/gravitino/gravitino/mcp-server/.venv/bin/python: No code 
object available for isort.__main__;
   'isort' is a package and cannot be directly executed
   
   > Task :mcp-server:formatCheckPython FAILED
   ```
   
   Root cause: `mcp-server/build.gradle.kts` installs the formatters without a 
version constraint —
   
   ```kotlin
   commandLine(getUvExecutable(), "pip", "install", "--python", venvPython, 
"black", "isort")
   ```
   
   so CI picked up the freshly released **isort 9.0.0**, which no longer ships 
`isort/__main__.py`. Both `formatCheckPython` and `formatApplyPython` invoke it 
as `python -m isort`, which now exits 1.
   
   Reproduced locally:
   
   ```
   $ pip install isort==9.0.0
   $ python -m isort --version
   python: No code object available for isort.__main__; 'isort' is a package 
and cannot be directly executed
   $ isort --version      # console script still works
                       VERSION 9.0.0 (compiled yes)
   ```
   
   `black` is installed unpinned the same way, so a future black release that 
changes formatting will break the check in the same way.
   
   ### Error message and/or stacktrace
   
   ```
   Execution failed for task ':mcp-server:formatCheckPython'.
   > Process 'command '.../mcp-server/.venv/bin/python'' finished with non-zero 
exit value 1
   ```
   
   ### How to reproduce
   
   Run `./gradlew :mcp-server:formatCheckPython` on a clean checkout (any 
branch) — the venv resolves isort 9.0.0 and the task fails.
   
   ### Additional context
   
   Fix: invoke the `isort` / `black` console scripts from the venv instead of 
`python -m`, and pin both versions so the formatters cannot drift under CI.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to