You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/community/develop.md
+29-7Lines changed: 29 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,25 +138,47 @@ If you want to test changes with different Spark/Scala versions, you can select
138
138
139
139
We recommend [PyCharm](https://www.jetbrains.com/pycharm/).
140
140
141
-
### Run Python tests
141
+
### Run tests
142
142
143
143
#### Run all Python tests
144
144
145
145
To run all Python test cases, follow steps mentioned [here](../setup/compile.md#run-python-test).
146
146
147
-
#### Run all Python tests in a single test file
147
+
Once the environment is set up, you can run all tests using the following command in python directory:
148
148
149
-
To run a particular Python test file, specify the path of the `.py` file to `pipenv`.
150
-
151
-
For example, to run all tests in `test_function.py` located in `python/tests/sql/`, use: `pipenv run pytest tests/sql/test_function.py`.
149
+
```bash
150
+
cd python
151
+
uv run pytest -v tests
152
+
```
152
153
153
154
#### Run a single test
154
155
156
+
To run a particular Python test file, specify the path of the `.py`.
157
+
158
+
For example, to run all tests in `test_function.py` located in `python/tests/sql/`, use:
159
+
160
+
```bash
161
+
cd python
162
+
uv run pytest -v tests/sql/test_function.py
163
+
```
164
+
155
165
To run a particular test in a particular `.py` test file, specify `file_name::class_name::test_name` to the `pytest` command.
156
166
157
-
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`
167
+
For example, to run the test on `ST_Contains` function located in `sql/test_predicate.py`, use:
158
168
159
-
### Import the project
169
+
```bash
170
+
cd python
171
+
uv run pytest -v tests/sql/test_predicate.py::TestPredicate::test_st_contains
172
+
```
173
+
174
+
### Build packages
175
+
176
+
The following command will build the sdist and whl packages in the `dist` folder.
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.
Homebrew can be used to install libgeos-dev in macOS:
126
-
127
-
```
128
-
brew install geos
129
-
```
111
+
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.
130
112
131
-
6) Set up pipenv to the desired Python version: 3.8, 3.9, or 3.10
132
-
133
-
```
113
+
```bash
134
114
cd python
135
-
pipenv --python 3.8
115
+
python -m pip install --upgrade uv
116
+
uv venv --python 3.10 # or any supported version (>=3.8)
136
117
```
137
118
138
-
7) Install the PySpark version and the other dependency
119
+
5) Install the PySpark version and the other dependency
139
120
140
-
```
121
+
```bash
141
122
cd python
142
-
pipenv install pyspark==${SPARK_VERSION}
143
-
pipenv install --dev
123
+
# Use the correct PySpark version, otherwise latest version will be installed
124
+
uv add pyspark==${SPARK_VERSION} --optional spark
125
+
uv sync
144
126
```
145
127
146
-
`pipenv install pyspark` installs the latest version of pyspark.
147
-
In order to remain consistent with the installed spark version, use `pipenv install pyspark==<spark_version>`
128
+
6) Install Sedona (editable) and run the Python tests
0 commit comments