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

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


The following commit(s) were added to refs/heads/master by this push:
     new 89d65d2743 [GH-2365] Modernize Sedona Python project by switching to 
pyproject.toml and uv (#2393)
89d65d2743 is described below

commit 89d65d274330ba5cb273692ba8beda17c88c5f65
Author: Kristin Cowalcijk <[email protected]>
AuthorDate: Tue Oct 14 12:10:04 2025 +0800

    [GH-2365] Modernize Sedona Python project by switching to pyproject.toml 
and uv (#2393)
---
 .github/workflows/pyflink.yml          |  25 ++++----
 .github/workflows/python-extension.yml |  51 +++++++----------
 .github/workflows/python.yml           |  92 ++++++++++++++----------------
 docs/community/develop.md              |  36 +++++++++---
 docs/setup/compile.md                  |  69 ++++++++--------------
 docs/setup/install-python.md           |   2 +-
 python/.gitignore                      |   4 ++
 python/Pipfile                         |  36 ------------
 python/build_wheel.sh                  |  21 -------
 python/pyproject.toml                  | 101 +++++++++++++++++++++++++++++++++
 python/setup.py                        |  85 ---------------------------
 11 files changed, 236 insertions(+), 286 deletions(-)

diff --git a/.github/workflows/pyflink.yml b/.github/workflows/pyflink.yml
index 572fec4051..afc2fc109f 100644
--- a/.github/workflows/pyflink.yml
+++ b/.github/workflows/pyflink.yml
@@ -59,18 +59,17 @@ jobs:
       - uses: actions/setup-python@v5
         with:
           python-version: ${{ matrix.python }}
-      - run: sudo apt-get -y install python3-pip python-dev-is-python3
+      - name: Install uv
+        uses: astral-sh/setup-uv@v6
       - run: mvn package -pl "org.apache.sedona:sedona-flink-shaded_2.12" -am 
-DskipTests
-      - run: sudo pip3 install -U setuptools
-      - run: sudo pip3 install -U wheel
-      - run: sudo pip3 install -U virtualenvwrapper
-      - run: python3 -m pip install uv
-      - run: cd python
-      - run: rm pyproject.toml
-      - run: uv init --no-workspace
-      - run: uv add apache-flink==1.20.1 shapely attr setuptools
-      - run: uv add pytest --dev
-      - run: |
-          wget 
https://repo1.maven.org/maven2/org/datasyslab/geotools-wrapper/1.8.0-33.1-rc1/geotools-wrapper-1.8.0-33.1-rc1.jar
+      - name: Install python package + flink extra
+        run: |
+          cd python
+          uv add apache-flink==1.20.1
+          uv sync
+      - name: Run PyFlink tests
+        run: |
+          wget -q 
https://repo1.maven.org/maven2/org/datasyslab/geotools-wrapper/1.8.0-33.1-rc1/geotools-wrapper-1.8.0-33.1-rc1.jar
           export SEDONA_PYFLINK_EXTRA_JARS=${PWD}/$(find flink-shaded/target 
-name sedona-flink*.jar),${PWD}/geotools-wrapper-1.8.0-33.1-rc1.jar
-          (cd python; PYTHONPATH=$(pwd) uv run pytest -v -s ./tests/flink)
+          cd python
+          PYTHONPATH=$(pwd) uv run pytest -v -s ./tests/flink
diff --git a/.github/workflows/python-extension.yml 
b/.github/workflows/python-extension.yml
index eef0c26e61..3a2302ad92 100644
--- a/.github/workflows/python-extension.yml
+++ b/.github/workflows/python-extension.yml
@@ -56,46 +56,39 @@ jobs:
     defaults:
       run:
         shell: bash
+        working-directory: python
     steps:
       - uses: actions/checkout@v4
       - uses: actions/setup-python@v5
         with:
           python-version: ${{ matrix.python }}
-      - name: Install pipenv
-        run: pip install -U pipenv
-      - name: Install dependencies
+      - name: Install uv
+        uses: astral-sh/setup-uv@v6
+      - name: Install dependencies (dev)
         run: |
-          cd python
-          if [[ "$RUNNER_OS" == "Windows" ]]; then
-              PYTHON_EXE_PATH="$pythonLocation/python.exe"
-          else
-              PYTHON_EXE_PATH="$pythonLocation/python"
-          fi
-          echo "Using Python executable at: $PYTHON_EXE_PATH"
-          pipenv install --dev --python "$PYTHON_EXE_PATH"
-      - name: Build extension
+          uv sync
+      - name: Build extension (explicit)
         run: |
-          cd python
-          pipenv run python setup.py build_ext --inplace
+          uv pip install -e .
       - name: Run tests
         run: |
-          cd python
-          pipenv run pytest tests/utils/test_geomserde_speedup.py
-      - name: Run tests on Shapely 2.0
+          uv run pytest tests/utils/test_geomserde_speedup.py
+      - name: Install pip
+        run: uv pip install pip
+      - name: Run tests on Shapely 2
         run: |
-          cd python
-          pipenv install shapely~=2.0
-          pipenv run pytest tests/utils/test_geomserde_speedup.py
-      - name: Run tests on Shapley 1.7
-        # Shapely 1.7 only provides wheels for cp36 ~ cp39, so we'll skip 
running
-        # this test for recent python versions.
+          uv add "shapely~=2.0"
+          uv run pytest tests/utils/test_geomserde_speedup.py
+      - name: Run tests on Shapely 1.8
+        run: |
+          uv add "shapely~=1.8"
+          uv run pytest tests/utils/test_geomserde_speedup.py
+      - name: Run tests on Shapely 1.7
         if: ${{ matrix.python == '3.9' || matrix.python == '3.8' }}
         run: |
-          cd python
-          pipenv install shapely~=1.7
-          pipenv run pytest tests/utils/test_geomserde_speedup.py
+          uv add "shapely==1.7.1"
+          uv run pytest tests/utils/test_geomserde_speedup.py
       - name: Install from sdist
         run: |
-          cd python
-          pipenv run python setup.py sdist
-          pipenv run python -m pip install dist/*sedona-*.tar.gz
+          uv build
+          uv pip install dist/*sedona-*.tar.gz --force-reinstall
diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml
index c42be7d04e..8871840791 100644
--- a/.github/workflows/python.yml
+++ b/.github/workflows/python.yml
@@ -99,8 +99,6 @@ jobs:
             python: '3.8'
             shapely: '1'
 
-    env:
-      VENV_PATH: /home/runner/.local/share/virtualenvs/python-${{ 
matrix.python }}
     steps:
       - uses: actions/checkout@v4
       - uses: actions/setup-java@v4
@@ -110,6 +108,8 @@ jobs:
       - uses: actions/setup-python@v5
         with:
           python-version: ${{ matrix.python }}
+      - name: Install uv
+        uses: astral-sh/setup-uv@v6
       - name: Cache Maven packages
         uses: actions/cache@v4
         with:
@@ -122,71 +122,65 @@ jobs:
         run: |
           SPARK_COMPAT_VERSION=${SPARK_VERSION:0:3}
           mvn -q clean install -DskipTests -Dspark=${SPARK_COMPAT_VERSION} 
-Dscala=${SCALA_VERSION:0:4} -Dgeotools
-      - run: sudo apt-get -y install python3-pip python-dev-is-python3
-      - run: sudo pip3 install -U setuptools
-      - run: sudo pip3 install -U wheel
-      - run: sudo pip3 install -U virtualenvwrapper
-      - run: python3 -m pip install pipenv
-      - run: cd python; python3 setup.py build_ext --inplace
-      - env:
+      - name: Setup Python build environment
+        env:
           SPARK_VERSION: ${{ matrix.spark }}
-          PYTHON_VERSION: ${{ matrix.python }}
           SHAPELY_VERSION: ${{ matrix.shapely }}
-          PANDAS_VERSION: ${{ matrix.pandas }}
         run: |
           cd python
+
+          # Conditional shapely version adjustments
           if [ "${SHAPELY_VERSION}" == "1" ]; then
-            echo "Patching Pipfile to use Shapely 1.x"
-            sed -i 's/^shapely.*$/shapely="<2.0.0"/g' Pipfile
+            uv add "shapely<2.0.0"
           fi
-          if [ "${PANDAS_VERSION}" == "1" ]; then
-            echo "Patching Pipfile to use Pandas 1.x"
-            sed -i 's/^pandas.*$/pandas="<2.0.0"/g' Pipfile
+
+          if [ "${SPARK_VERSION:0:1}" == "4" ]; then
+            # Spark 4.0 requires Python 3.9+, and we remove flink since it 
conflicts with pyspark 4.0
+            uv remove apache-flink --optional flink
+            uv add "pyspark==4.0.0; python_version >= '3.9'"
+          else
+            # Install specific pyspark version matching matrix
+            uv add pyspark==${SPARK_VERSION}
           fi
-          export PIPENV_CUSTOM_VENV_NAME=python-${PYTHON_VERSION}
-          pipenv --python ${PYTHON_VERSION}
-          pipenv install pyspark==${SPARK_VERSION}
-          pipenv install --dev
-          pipenv graph
-      - env:
-          PYTHON_VERSION: ${{ matrix.python }}
+
+          uv sync
+
+          uv run python -c "import pyspark,sys;print('Using pyspark', 
pyspark.__version__)"
+      - name: Install sedona package
+        run: cd python; uv pip install -e .
+      - name: Prepare Sedona Spark Dependencies
         run: |
           wget --retry-connrefused --waitretry=10 --read-timeout=20 
--timeout=15 --tries=5 
https://repo.osgeo.org/repository/release/javax/media/jai_core/${JAI_CORE_VERSION}/jai_core-${JAI_CORE_VERSION}.jar
           wget --retry-connrefused --waitretry=10 --read-timeout=20 
--timeout=15 --tries=5 
https://repo.osgeo.org/repository/release/javax/media/jai_codec/${JAI_CODEC_VERSION}/jai_codec-${JAI_CODEC_VERSION}.jar
           wget --retry-connrefused --waitretry=10 --read-timeout=20 
--timeout=15 --tries=5 
https://repo.osgeo.org/repository/release/javax/media/jai_imageio/${JAI_IMAGEIO_VERSION}/jai_imageio-${JAI_IMAGEIO_VERSION}.jar
-          mv -v jai_core-${JAI_CORE_VERSION}.jar 
${VENV_PATH}/lib/python${PYTHON_VERSION}/site-packages/pyspark/jars
-          mv -v jai_codec-${JAI_CODEC_VERSION}.jar 
${VENV_PATH}/lib/python${PYTHON_VERSION}/site-packages/pyspark/jars
-          mv -v jai_imageio-${JAI_IMAGEIO_VERSION}.jar 
${VENV_PATH}/lib/python${PYTHON_VERSION}/site-packages/pyspark/jars
-      - env:
-          PYTHON_VERSION: ${{ matrix.python }}
-        run: find spark-shaded/target -name sedona-*.jar -exec cp {} 
${VENV_PATH}/lib/python${PYTHON_VERSION}/site-packages/pyspark/jars/ \;
+
+          PY_SITE=$(cd python; uv run python -c "import site; 
print(site.getsitepackages()[0])")
+          echo "Python site-packages: $PY_SITE"
+          mv -v jai_core-${JAI_CORE_VERSION}.jar ${PY_SITE}/pyspark/jars
+          mv -v jai_codec-${JAI_CODEC_VERSION}.jar ${PY_SITE}/pyspark/jars
+          mv -v jai_imageio-${JAI_IMAGEIO_VERSION}.jar ${PY_SITE}/pyspark/jars
+      - name: Copy Sedona Spark JARs
+        run: |
+          PY_SITE=$(cd python; uv run python -c "import site; 
print(site.getsitepackages()[0])")
+          find spark-shaded/target -name sedona-*.jar -exec cp {} 
${PY_SITE}/pyspark/jars/ \;
       - name: Run tests
-        env:
-          PYTHON_VERSION: ${{ matrix.python }}
         run: |
-          export 
SPARK_HOME=${VENV_PATH}/lib/python${PYTHON_VERSION}/site-packages/pyspark
           cd python
-          source ${VENV_PATH}/bin/activate
-          pytest -v tests
+          export SPARK_HOME=$(uv run python -c "import site; 
print(site.getsitepackages()[0]+'/pyspark')")
+          uv run pytest -v tests
       - name: Run basic tests without rasterio
-        env:
-          PYTHON_VERSION: ${{ matrix.python }}
         run: |
-          export 
SPARK_HOME=${VENV_PATH}/lib/python${PYTHON_VERSION}/site-packages/pyspark
           cd python
-          source ${VENV_PATH}/bin/activate
-          pip uninstall -y rasterio
-          pytest -v tests/core/test_rdd.py tests/sql/test_dataframe_api.py
+          export SPARK_HOME=$(uv run python -c "import site; 
print(site.getsitepackages()[0]+'/pyspark')")
+          uv remove rasterio --optional all
+          uv remove rasterio --dev
+          uv sync
+          uv run pytest -v tests/core/test_rdd.py 
tests/sql/test_dataframe_api.py
       - name: Run Spark Connect tests
-        env:
-          PYTHON_VERSION: ${{ matrix.python }}
-          SPARK_VERSION: ${{ matrix.spark }}
         if: ${{ matrix.spark >= '3.4.0' }}
         run: |
-          export 
SPARK_HOME=${VENV_PATH}/lib/python${PYTHON_VERSION}/site-packages/pyspark
-          export SPARK_REMOTE=local
-
           cd python
-          source ${VENV_PATH}/bin/activate
-          pip install "pyspark[connect]==${SPARK_VERSION}"
-          pytest -v tests/sql/test_dataframe_api.py
+          export SPARK_REMOTE=local
+          export SPARK_HOME=$(uv run python -c "import site; 
print(site.getsitepackages()[0]+'/pyspark')")
+          uv pip install "pyspark[connect]==${{ matrix.spark }}" --reinstall
+          uv run pytest -v tests/sql/test_dataframe_api.py
diff --git a/docs/community/develop.md b/docs/community/develop.md
index 264d349c85..53783aeeaf 100644
--- a/docs/community/develop.md
+++ b/docs/community/develop.md
@@ -138,25 +138,47 @@ If you want to test changes with different Spark/Scala 
versions, you can select
 
 We recommend [PyCharm](https://www.jetbrains.com/pycharm/).
 
-### Run Python tests
+### Run tests
 
 #### Run all Python tests
 
 To run all Python test cases, follow steps mentioned 
[here](../setup/compile.md#run-python-test).
 
-#### Run all Python tests in a single test file
+Once the environment is set up, you can run all tests using the following 
command in python directory:
 
-To run a particular Python test file, specify the path of the `.py` file to 
`pipenv`.
-
-For example, to run all tests in `test_function.py` located in 
`python/tests/sql/`, use: `pipenv run pytest tests/sql/test_function.py`.
+```bash
+cd python
+uv run pytest -v tests
+```
 
 #### Run a single test
 
+To run a particular Python test file, specify the path of the `.py`.
+
+For example, to run all tests in `test_function.py` located in 
`python/tests/sql/`, use:
+
+```bash
+cd python
+uv run pytest -v tests/sql/test_function.py
+```
+
 To run a particular test in a particular `.py` test file, specify 
`file_name::class_name::test_name` to the `pytest` command.
 
-For example, to run the test on `ST_Contains` function located in 
`sql/test_predicate.py`, use: `pipenv run pytest 
tests/sql/test_predicate.py::TestPredicate::test_st_contains`
+For example, to run the test on `ST_Contains` function located in 
`sql/test_predicate.py`, use:
 
-### Import the project
+```bash
+cd python
+uv run pytest -v tests/sql/test_predicate.py::TestPredicate::test_st_contains
+```
+
+### Build packages
+
+The following command will build the sdist and whl packages in the `dist` 
folder.
+
+```bash
+cd python
+uv build
+```
 
 ## R developers
 
diff --git a/docs/setup/compile.md b/docs/setup/compile.md
index 1c66c49244..4eca16f3aa 100644
--- a/docs/setup/compile.md
+++ b/docs/setup/compile.md
@@ -77,27 +77,20 @@ Sedona uses GitHub Actions to automatically generate jars 
per commit. You can go
 
 ## Run Python test
 
-1) Set up the environment variable SPARK_HOME and PYTHONPATH
+1) Set up Spark (download if needed) and environment variables
 
-For example,
-
-```
-export SPARK_VERSION=3.4.0
-export SPARK_HOME=$PWD/spark-${SPARK_VERSION}-bin-hadoop3
-export PYTHONPATH=$SPARK_HOME/python
-```
-
-2) Install Spark if you haven't already
-
-```
+```bash
+export SPARK_VERSION=3.4.0   # or another supported version
 wget 
https://archive.apache.org/dist/spark/spark-${SPARK_VERSION}/spark-${SPARK_VERSION}-bin-hadoop3.tgz
 tar -xvzf spark-${SPARK_VERSION}-bin-hadoop3.tgz
 rm spark-${SPARK_VERSION}-bin-hadoop3.tgz
+export SPARK_HOME=$PWD/spark-${SPARK_VERSION}-bin-hadoop3
+export PYTHONPATH=$SPARK_HOME/python
 ```
 
-3) Put JAI jars to ==SPARK_HOME/jars/== folder.
+2) Add required JAI jars into $SPARK_HOME/jars
 
-```
+```bash
 export JAI_CORE_VERSION="1.1.3"
 export JAI_CODEC_VERSION="1.1.3"
 export JAI_IMAGEIO_VERSION="1.1"
@@ -106,52 +99,38 @@ wget -P $SPARK_HOME/jars/ 
https://repo.osgeo.org/repository/release/javax/media/
 wget -P $SPARK_HOME/jars/ 
https://repo.osgeo.org/repository/release/javax/media/jai_imageio/${JAI_IMAGEIO_VERSION}/jai_imageio-${JAI_IMAGEIO_VERSION}.jar
 ```
 
-4) Compile the Sedona Scala and Java code with `-Dgeotools` and then copy the 
==sedona-spark-shaded-{{ sedona.current_version }}.jar== to 
==SPARK_HOME/jars/== folder.
+3) Build Sedona Scala/Java jars with GeoTools shaded (from repo root)
 
-```
+```bash
+mvn clean install -DskipTests -Dgeotools
 cp spark-shaded/target/sedona-spark-shaded-*.jar $SPARK_HOME/jars/
 ```
 
-5) Install the following libraries
+4) Setup Python development environment
 
-```
-sudo apt-get -y install python3-pip python-dev libgeos-dev
-sudo pip3 install -U setuptools
-sudo pip3 install -U wheel
-sudo pip3 install -U virtualenvwrapper
-sudo pip3 install -U pipenv
-```
-
-Homebrew can be used to install libgeos-dev in macOS:
-
-```
-brew install geos
-```
+The Python package uses `pyproject.toml` (PEP 517/518) with setuptools as the 
build backend. We recommend using [uv](https://docs.astral.sh/uv/) to manage 
virtual environments and dependencies.
 
-6) Set up pipenv to the desired Python version: 3.8, 3.9, or 3.10
-
-```
+```bash
 cd python
-pipenv --python 3.8
+python -m pip install --upgrade uv
+uv venv --python 3.10   # or any supported version (>=3.8)
 ```
 
-7) Install the PySpark version and the other dependency
+5) Install the PySpark version and the other dependency
 
-```
+```bash
 cd python
-pipenv install pyspark==${SPARK_VERSION}
-pipenv install --dev
+# Use the correct PySpark version, otherwise latest version will be installed
+uv add pyspark==${SPARK_VERSION} --optional spark
+uv sync
 ```
 
-`pipenv install pyspark` installs the latest version of pyspark.
-In order to remain consistent with the installed spark version, use `pipenv 
install pyspark==<spark_version>`
+6) Install Sedona (editable) and run the Python tests
 
-8) Run the Python tests
-
-```
+```bash
 cd python
-pipenv run python setup.py build_ext --inplace
-pipenv run pytest tests
+uv pip install -e .
+uv run pytest -v tests
 ```
 
 ## Compile the documentation
diff --git a/docs/setup/install-python.md b/docs/setup/install-python.md
index 02cb51d475..d70e4a163c 100644
--- a/docs/setup/install-python.md
+++ b/docs/setup/install-python.md
@@ -45,7 +45,7 @@ Clone Sedona GitHub source code and run the following command
 
 ```bash
 cd python
-python3 setup.py install
+python3 -m pip install .
 ```
 
 ### Prepare sedona-spark jar
diff --git a/python/.gitignore b/python/.gitignore
index cefb82e8e2..7d978c9988 100644
--- a/python/.gitignore
+++ b/python/.gitignore
@@ -17,11 +17,15 @@
 
 /.idea/
 /venv/
+/.venv/
 /.ipynb_checkpoints/
 /.pytest_cache/
+/.hypothesis/
 /apache_sedona.egg-info/
 /build/
 /dist/
 /sedona/utils/*.so
 __pycache__
 /sedona/doc/_build/
+geomserde_speedup.cpython-*.so
+uv.lock
diff --git a/python/Pipfile b/python/Pipfile
deleted file mode 100644
index 526dbce55f..0000000000
--- a/python/Pipfile
+++ /dev/null
@@ -1,36 +0,0 @@
-[[source]]
-name = "pypi"
-url = "https://pypi.org/simple";
-verify_ssl = true
-
-[dev-packages]
-pytest="*"
-notebook="==6.4.12"
-jupyter="*"
-mkdocs="*"
-pytest-cov = "*"
-
-scikit-learn = "*"
-esda = "*"
-libpysal = "*"
-matplotlib = "*" # implicit dependency of esda
-scipy = "<=1.10.0" # prevent incompatibility with pysal 4.7.0, which is what 
is resolved to when shapely >2 is specified
-
-[packages]
-pandas=">=2.0.0"
-numpy="<2"
-geopandas="*"
-# 
https://stackoverflow.com/questions/78949093/how-to-resolve-attributeerror-module-fiona-has-no-attribute-path
-# cannot set geopandas>=0.14.4 since it doesn't support python 3.8, so we pin 
fiona to <1.10.0
-fiona="<1.10.0"
-shapely=">=1.7.0"
-pyspark=">=2.3.0"
-attrs="*"
-pyarrow="*"
-keplergl = "==0.3.2"
-pydeck = "===0.8.0"
-pystac = "===1.5.0"
-rasterio = ">=1.2.10"
-
-[requires]
-python_version = "3.8"
diff --git a/python/build_wheel.sh b/python/build_wheel.sh
deleted file mode 100755
index e5658255f9..0000000000
--- a/python/build_wheel.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-
-#   http://www.apache.org/licenses/LICENSE-2.0
-
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-pipenv run python setup.py sdist bdist_wheel
diff --git a/python/pyproject.toml b/python/pyproject.toml
new file mode 100644
index 0000000000..35c2e2c13a
--- /dev/null
+++ b/python/pyproject.toml
@@ -0,0 +1,101 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[build-system]
+requires = ["setuptools>=69", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "apache-sedona"
+version = "1.8.0"
+description = "Apache Sedona is a cluster computing system for processing 
large-scale spatial data"
+readme = "README.md"
+license = { text = "Apache-2.0" }
+authors = [ { name = "Apache Sedona", email = "[email protected]" } ]
+requires-python = ">=3.8"
+classifiers = [
+  "Programming Language :: Python :: 3",
+  "License :: OSI Approved :: Apache Software License",
+]
+dependencies = [
+  "attrs",
+  "shapely>=1.7.0",
+]
+
+[project.optional-dependencies]
+spark = ["pyspark>=3.4.0"]
+pydeck-map = ["geopandas", "pydeck==0.8.0"]
+kepler-map = ["geopandas", "keplergl==0.3.2"]
+flink = ["apache-flink>=1.19.0"]
+db = ["sedonadb[geopandas]; python_version >= '3.9'"]
+all = [
+  "pyspark>=3.4.0",
+  "geopandas",
+  "pydeck==0.8.0",
+  "keplergl==0.3.2",
+  "rasterio>=1.2.10",
+]
+
+[dependency-groups]
+dev = [
+  "pytest",
+  "pytest-cov",
+  "notebook==6.4.12",
+  "jupyter",
+  "mkdocs",
+  "scikit-learn",
+  "esda",
+  "libpysal",
+  "matplotlib",  # implicit dependency of esda
+  # prevent incompatibility with pysal 4.7.0, which is what is resolved to 
when shapely >2 is specified
+  "scipy<=1.10.0",
+  "pandas>=2.0.0",
+  "numpy<2",
+  "geopandas",
+  # 
https://stackoverflow.com/questions/78949093/how-to-resolve-attributeerror-module-fiona-has-no-attribute-path
+  # cannot set geopandas>=0.14.4 since it doesn't support python 3.8, so we 
pin fiona to <1.10.0
+  "fiona<1.10.0",
+  "pyarrow",
+  "pyspark>=3.4.0",
+  "keplergl==0.3.2",
+  "pydeck==0.8.0",
+  "pystac==1.5.0",
+  "rasterio>=1.2.10",
+]
+
+[project.urls]
+HomePage = "https://sedona.apache.org";
+Documentation = "https://sedona.apache.org";
+"Source code" = "https://github.com/apache/sedona";
+"Bug Reports" = "https://issues.apache.org/jira/projects/SEDONA";
+
+[tool.setuptools]
+include-package-data = true
+
+[tool.setuptools.packages.find]
+include = ["sedona*"]
+exclude = ["*.tests", "*.tests.*", "tests", "tests.*"]
+
+# C extension module for geometry serialization speedup
+[[tool.setuptools.ext-modules]]
+name = "sedona.spark.utils.geomserde_speedup"
+sources = [
+  "src/geomserde_speedup_module.c",
+  "src/geomserde.c",
+  "src/geom_buf.c",
+  "src/geos_c_dyn.c",
+]
diff --git a/python/setup.py b/python/setup.py
deleted file mode 100644
index ef8a78b4bb..0000000000
--- a/python/setup.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-import os
-
-from setuptools import Extension, find_packages, setup
-
-from sedona import version
-
-with open("README.md") as fh:
-    long_description = fh.read()
-
-extension_args = {}
-
-if os.getenv("ENABLE_ASAN"):
-    extension_args = {
-        "extra_compile_args": ["-fsanitize=address"],
-        "extra_link_args": ["-fsanitize=address"],
-    }
-
-ext_modules = [
-    Extension(
-        "sedona.spark.utils.geomserde_speedup",
-        sources=[
-            "src/geomserde_speedup_module.c",
-            "src/geomserde.c",
-            "src/geom_buf.c",
-            "src/geos_c_dyn.c",
-        ],
-        **extension_args
-    )
-]
-
-setup(
-    name="apache-sedona",
-    version=version,
-    description="Apache Sedona is a cluster computing system for processing 
large-scale spatial data",
-    url="https://sedona.apache.org";,
-    license="Apache License v2.0",
-    author="Apache Sedona",
-    author_email="[email protected]",
-    packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", 
"tests"]),
-    ext_modules=ext_modules,
-    long_description=long_description,
-    long_description_content_type="text/markdown",
-    python_requires=">=3.8",
-    install_requires=["attrs", "shapely>=1.7.0"],
-    extras_require={
-        "spark": ["pyspark>=2.3.0"],
-        "pydeck-map": ["geopandas", "pydeck==0.8.0"],
-        "kepler-map": ["geopandas", "keplergl==0.3.2"],
-        "flink": ["apache-flink>=1.19.0"],
-        "db": ["sedonadb[geopandas]"],
-        "all": [
-            "pyspark>=2.3.0",
-            "geopandas",
-            "pydeck==0.8.0",
-            "keplergl==0.3.2",
-            "rasterio>=1.2.10",
-        ],
-    },
-    project_urls={
-        "Documentation": "https://sedona.apache.org";,
-        "Source code": "https://github.com/apache/sedona";,
-        "Bug Reports": "https://issues.apache.org/jira/projects/SEDONA";,
-    },
-    classifiers=[
-        "Programming Language :: Python :: 3",
-        "License :: OSI Approved :: Apache Software License",
-    ],
-)

Reply via email to