jorisvandenbossche commented on code in PR #55264:
URL: https://github.com/apache/arrow/pull/55264#discussion_r4536005662


##########
docs/source/developers/python/development.rst:
##########
@@ -114,6 +114,18 @@ Running Type Checkers
 We support multiple type checkers. Their configurations are in
 ``pyproject.toml``.
 
+The easiest way to run all of them is with ``pre-commit``, which installs
+the same versions of the type checkers and stub packages for everyone. This
+also lints and formats the stubs with ruff:
+
+.. code-block::
+
+   $ pre-commit run --hook-stage manual python-stubs --all-files

Review Comment:
   Example: 
   
   ```
   Python Stubs Type Check 
(ty).............................................Failed
   - hook id: ty
   - exit code: 1
   
   error[import-not-found]: Cannot resolve imported module `pytest`
     --> python/pyarrow-stubs-tests/test_array.py:21:8
      |
   21 | import pytest
      |        ^^^^^^
   info: Searched in the following paths during module resolution:
   info:   1. /home/joris/scipy/repos/arrow/python (first-party code)
   info:   2. vendored://stdlib (stdlib typeshed stubs vendored by ty)
   info:   3. /home/joris/.pixi/envs/pre-commit/lib/python3.13/site-packages 
(site-packages)
   info: make sure your Python environment is properly configured: 
https://docs.astral.sh/ty/modules/#python-environment
   ```
   
   So while that documentation note indicates that using it through `uv run` 
should typically have `ty` pick up that env, that does not seem to be happening 
here (but it is picking up the isolated conda env where pre-commit is installed 
(I installed it with pixi global)
   



-- 
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