This is an automated email from the ASF dual-hosted git repository.

ruifengz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new bf71e593a87c [SPARK-54949][PYTHON] Move pyproject.toml to repo root
bf71e593a87c is described below

commit bf71e593a87c6dd7399047de5c89362bbf888fd6
Author: Tian Gao <[email protected]>
AuthorDate: Fri Jan 9 15:10:57 2026 +0800

    [SPARK-54949][PYTHON] Move pyproject.toml to repo root
    
    ### What changes were proposed in this pull request?
    
    Move `pyproject.toml` to repo root.
    
    ### Why are the changes needed?
    
    `pyproject.toml` is now the official way to specify configurations. A lot 
of tools are supporting it. The way they search for it is to go up in the 
directory tree until they find it. They will consider that as the root of the 
project. Having it in `dev/` is not useful for users to run tools individually. 
We should try to avoid custom scripts as much as possible.
    
    After this change, users can do `ruff check` in either repo root, or 
`python/` and get the correct result with our configurations.
    
    This would also be very useful when we introduce `pytest`, which also 
utilizes `pyproject.toml` to config.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    `dev/lint-python` passed, and CI should pass.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No
    
    Closes #53716 from gaogaotiantian/move-pyproject.
    
    Authored-by: Tian Gao <[email protected]>
    Signed-off-by: Ruifeng Zheng <[email protected]>
---
 dev/gen-protos.sh                    | 2 +-
 dev/lint-python                      | 5 ++---
 dev/reformat-python                  | 2 +-
 dev/pyproject.toml => pyproject.toml | 0
 4 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/dev/gen-protos.sh b/dev/gen-protos.sh
index d169964feb85..7952711c4289 100755
--- a/dev/gen-protos.sh
+++ b/dev/gen-protos.sh
@@ -116,7 +116,7 @@ for f in `find gen/proto/python -name "*.py*"`; do
   rm $f.bak
 done
 
-black --config $SPARK_HOME/dev/pyproject.toml gen/proto/python
+black --config $SPARK_HOME/pyproject.toml gen/proto/python
 
 # Last step copy the result files to the destination module.
 for f in `find gen/proto/python -name "*.py*"`; do
diff --git a/dev/lint-python b/dev/lint-python
index db445a89cdd1..30b498cbe45f 100755
--- a/dev/lint-python
+++ b/dev/lint-python
@@ -164,7 +164,6 @@ function mypy_data_test {
     fi
 
     PYTEST_REPORT=$( (MYPYPATH=python $PYTEST_BUILD \
-      -c dev/pyproject.toml \
       --rootdir python \
       --mypy-only-local-stub \
       --mypy-ini-file python/mypy.ini \
@@ -299,7 +298,7 @@ ruff checks failed."
     fi
 
     echo "starting $RUFF_BUILD test..."
-    RUFF_REPORT=$( ($RUFF_BUILD check --config dev/pyproject.toml) 2>&1)
+    RUFF_REPORT=$( ($RUFF_BUILD check) 2>&1)
     RUFF_STATUS=$?
 
     if [ "$RUFF_STATUS" -ne 0 ]; then
@@ -327,7 +326,7 @@ function black_test {
     fi
 
     echo "starting black test..."
-    BLACK_REPORT=$( ($BLACK_BUILD  --config dev/pyproject.toml --check 
python/pyspark dev python/packaging) 2>&1)
+    BLACK_REPORT=$( ($BLACK_BUILD --check python/pyspark dev python/packaging) 
2>&1)
     BLACK_STATUS=$?
 
     if [ "$BLACK_STATUS" -ne 0 ]; then
diff --git a/dev/reformat-python b/dev/reformat-python
index 9a1199faa938..4bc3a733ec2b 100755
--- a/dev/reformat-python
+++ b/dev/reformat-python
@@ -29,4 +29,4 @@ if [ $? -ne 0 ]; then
     exit 1
 fi
 
-$BLACK_BUILD --config dev/pyproject.toml python/pyspark dev python/packaging
+$BLACK_BUILD python/pyspark dev python/packaging
diff --git a/dev/pyproject.toml b/pyproject.toml
similarity index 100%
rename from dev/pyproject.toml
rename to pyproject.toml


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to