Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,18 @@ jobs:
# Update this key to force a new cache (sync with packaging.yml)
prefix-key: "python-v3"

- name: Install
- name: Install sedonadb-expr
run: |
pip install -e "python/sedonadb-expr" -vv

- name: Install sedonadb
run: |
# Keep this export in sync with the export in dev/release/verify-release-candidate.sh
export MATURIN_PEP517_ARGS="--features s2geography"
pip install -e "python/sedonadb/[test]" -vv
# Unset so `--features s2geography` (sedonadb-only) doesn't
# carry into the plugin install.
unset MATURIN_PEP517_ARGS

- name: Install sedonadb-zarr
run: |
pip install -e "python/sedonadb-zarr/[test]" -vv

- name: Download minimal geoarrow-data assets
Expand Down
76 changes: 76 additions & 0 deletions python/sedonadb-expr/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# 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.

# Generated files
python/sedonadb_expr/_version.py
python/sedonadb_expr/_generated/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
*.egg

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# IDE
.idea/
.vscode/
*.swp
*.swo
36 changes: 36 additions & 0 deletions python/sedonadb-expr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!---
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.
-->

# SedonaDB Expr

A standalone Python package for SedonaDB expressions.

## Installation

```shell
pip install sedonadb-expr
```

## Example

```python
import sedonadb_expr

print(sedonadb_expr.__version__)
```
47 changes: 47 additions & 0 deletions python/sedonadb-expr/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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.

"""
Version source for hatchling - reads from workspace Cargo.toml.

This file is used by hatchling at build time to determine the version.
The build hook then generates a static _version.py inside the package.
"""

import re
from pathlib import Path


def get_version() -> str:
"""Read version from the workspace root Cargo.toml."""
here = Path(__file__).parent
cargo_toml = here.parent.parent / "Cargo.toml"

if not cargo_toml.exists():
raise FileNotFoundError(f"Could not find workspace Cargo.toml at {cargo_toml}")

content = cargo_toml.read_text()

match = re.search(
r'\[workspace\.package\].*?version\s*=\s*"([^"]+)"',
content,
re.DOTALL,
)
if match:
return match.group(1)

raise ValueError("Could not find workspace.package.version in Cargo.toml")
Loading
Loading