You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "kou (via GitHub)" <gi...@apache.org> on 2025/05/22 08:34:33 UTC

[PR] GH-46544: [CI][Dev][Python] Use pre-commit for autopep8 [arrow]

kou opened a new pull request, #46552:
URL: https://github.com/apache/arrow/pull/46552

   ### Rationale for this change
   
   We want to migrate to pre-commit from `archery lint`.
   
   ### What changes are included in this PR?
   
   Use pre-commit for `autoepep8`.
   
   The current `archery lint` configuration limits only the following patterns:
   
   https://github.com/apache/arrow/blob/197afc02026d6ded3c45f25dcee15a94294cc5ca/dev/archery/archery/utils/lint.py#L190-L198
   
   ```python
       patterns = ["python/benchmarks/**/*.py",
                   "python/examples/**/*.py",
                   "python/pyarrow/**/*.py",
                   "python/pyarrow/**/*.pyx",
                   "python/pyarrow/**/*.pxd",
                   "python/pyarrow/**/*.pxi",
                   "dev/*.py",
                   "dev/archery/**/*.py",
                   "dev/release/**/*.py"]
   ```
   
   But this configuration targets all Python and Cython files under `c_glib/`, `dev/` and python/` except `python/pyarrow/vendored/**`.
   
   So this includes format fixes. 
   
   ### Are these changes tested?
   
   Yes.
   
   ### Are there any user-facing changes?
   
   No.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-46544: [CI][Dev][Python] Use pre-commit for autopep8 [arrow]

Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on code in PR #46552:
URL: https://github.com/apache/arrow/pull/46552#discussion_r2104179243


##########
.pre-commit-config.yaml:
##########
@@ -121,6 +110,43 @@ repos:
         alias: matlab-cpp-format
         files: >-
           ^matlab/src/cpp/
+  - repo: https://github.com/hhatto/autopep8
+    rev: v2.3.2
+    hooks:
+      - id: autopep8
+        name: Python Format
+        alias: python-format
+        args:
+          - "--global-config"
+          - "python/setup.cfg"
+          - "--ignore-local-config"
+          - "--in-place"

Review Comment:
   should we use `--diff` instead of `--in-place`?
   >  -d, --diff            print the diff for the fixed source
   >  -i, --in-place        make changes to files in place
   ```suggestion
             - "--diff"
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-46544: [CI][Dev][Python] Use pre-commit for autopep8 [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #46552:
URL: https://github.com/apache/arrow/pull/46552#discussion_r2105550541


##########
.pre-commit-config.yaml:
##########
@@ -121,6 +110,43 @@ repos:
         alias: matlab-cpp-format
         files: >-
           ^matlab/src/cpp/
+  - repo: https://github.com/hhatto/autopep8
+    rev: v2.3.2
+    hooks:
+      - id: autopep8
+        name: Python Format
+        alias: python-format
+        args:
+          - "--global-config"
+          - "python/setup.cfg"
+          - "--ignore-local-config"
+          - "--in-place"

Review Comment:
   Yes.
   pre-commit shows diff on format error. So autopep8 doesn't need to show diff by itself. 



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-46544: [CI][Dev][Python] Use pre-commit for autopep8 [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou merged PR #46552:
URL: https://github.com/apache/arrow/pull/46552


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-46544: [CI][Dev][Python] Use pre-commit for autopep8 [arrow]

Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #46552:
URL: https://github.com/apache/arrow/pull/46552#issuecomment-2906624930

   After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 153da3053b62f8f9bcafb87546e12a979e605734.
   
   There were no benchmark performance regressions. 🎉
   
   The [full Conbench report](https://github.com/apache/arrow/runs/42826362725) has more details. It also includes information about 4 possible false positives for unstable benchmarks that are known to sometimes produce them.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-46544: [CI][Dev][Python] Use pre-commit for autopep8 [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #46552:
URL: https://github.com/apache/arrow/pull/46552#issuecomment-2900372833

   :warning: GitHub issue #46544 **has been automatically assigned in GitHub** to PR creator.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-46544: [CI][Dev][Python] Use pre-commit for autopep8 [arrow]

Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on code in PR #46552:
URL: https://github.com/apache/arrow/pull/46552#discussion_r2104184960


##########
.pre-commit-config.yaml:
##########
@@ -121,6 +110,43 @@ repos:
         alias: matlab-cpp-format
         files: >-
           ^matlab/src/cpp/
+  - repo: https://github.com/hhatto/autopep8
+    rev: v2.3.2
+    hooks:
+      - id: autopep8
+        name: Python Format
+        alias: python-format
+        args:
+          - "--global-config"
+          - "python/setup.cfg"
+          - "--ignore-local-config"
+          - "--in-place"

Review Comment:
   For a second I just thought on CI but this is run locally, sure, `--in-place` is better for 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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org