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


##########
docs/source/developers/python/development.rst:
##########
@@ -105,15 +105,41 @@ Type Checking
 =============
 
 PyArrow provides type stubs (``*.pyi`` files) for static type checking. These
-stubs are located in the ``pyarrow-stubs/`` directory and are automatically
-included in the distributed wheel packages.
+stubs are located in the ``pyarrow-stubs/`` directory, which is laid out as a
+:pep:`561` stub-only package for ``pyarrow``, so type checkers and IDEs pick
+it up from the ``arrow/python`` directory. The stubs aren't included in the
+distributed wheel packages until they are complete (see
+`GH-49831 <https://github.com/apache/arrow/issues/49831>`_).
 
 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 type checkers and stub packages pinned in ``requirements-stubs.txt`` (with
+uv). This also lints and formats the stubs with ruff:
+
+.. code-block::
+
+   $ pre-commit run --hook-stage manual python-stubs --all-files
+
+The type checkers only run on request, while ruff also runs on commit. The
+Lint CI job runs all of them as well. CI also runs the type checkers, the type
+stub tests and stubtest (see below) against the PyArrow it builds, with
+``ci/scripts/python_test_type_annotations.sh``.
+
+To run a type checker directly instead, install the pinned type checkers and
+stub packages in your PyArrow development environment:
+
+.. code-block::
+
+   $ pip install -r requirements-stubs.txt

Review Comment:
   We have `$ cd arrow/python` in some places of this docs, and in some places 
it is missing. I think it is worth being explicit at the beginning of this 
section that type checking needs to be run from arrow/python folder (all 
commands, I think).
   
   I also had to update mypy settings in VSCode as the Workplace imports full 
arrow folder but mypy should take arrow/python folder as the cwd. Worth adding 
that in for setting up dev env.
   
   Happy to do that.



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