Skip to content
Merged
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
39 changes: 25 additions & 14 deletions native-lib/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,41 @@

Python FFI bindings for the DataWeave native library.

## Prerequisites
## Installation

1. Build the native library:
```bash
./gradlew :native-lib:nativeCompile
```
Install the prebuilt native wheel from PyPI:

2. The shared library will be at:
- macOS: `native-lib/build/native/nativeCompile/dwlib.dylib`
- Linux: `native-lib/build/native/nativeCompile/dwlib.so`
- Windows: `native-lib/build/native/nativeCompile/dwlib.dll`
```bash
python3 -m pip install dataweave-native
```

## Installation
`pip` selects the wheel that matches your operating system and architecture.
The released wheel already bundles the native library.

## Development and local builds

Build the native library before creating a local wheel or using an editable
installation:

```bash
./gradlew :native-lib:nativeCompile
```

The shared library is built at:

- macOS: `native-lib/build/native/nativeCompile/dwlib.dylib`
- Linux: `native-lib/build/native/nativeCompile/dwlib.so`
- Windows: `native-lib/build/native/nativeCompile/dwlib.dll`

### Option A: Install the wheel (recommended)
### Build and install a local wheel

After building:

```bash
./gradlew :native-lib:buildPythonWheel
python3 -m pip install native-lib/python/dist/dataweave_native-*-py3-*.whl
```

### Option B: Editable install for development
### Editable install

```bash
./gradlew :native-lib:stagePythonNativeLib
Expand All @@ -41,7 +52,7 @@ cd native-lib/python
python3 -m pip install '.[test]'
```

### Option C: Use externally-built library via environment variable
### Use an externally-built library

```bash
export DATAWEAVE_NATIVE_LIB=/path/to/dwlib.dylib
Expand Down
14 changes: 14 additions & 0 deletions native-lib/python/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
name = dataweave-native
version = 0.0.1
description = Python bindings for the DataWeave native library
long_description = file: README.md
long_description_content_type = text/markdown
url = https://dataweave.mulesoft.com/
author = MuleSoft
license = BSD-3-Clause
license_files = ../../LICENSE.txt
classifiers =
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
License :: OSI Approved :: BSD License
project_urls =
Source = https://github.com/mulesoft/data-weave-cli
Issues = https://github.com/mulesoft/data-weave-cli/issues
Documentation = https://github.com/mulesoft/data-weave-cli/tree/master/native-lib/python

[options]
package_dir =
Expand Down
Loading