diff --git a/native-lib/python/README.md b/native-lib/python/README.md index dbcc255a..b9cbaefc 100644 --- a/native-lib/python/README.md +++ b/native-lib/python/README.md @@ -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 @@ -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 diff --git a/native-lib/python/setup.cfg b/native-lib/python/setup.cfg index 1f1b6d02..d5243cf8 100644 --- a/native-lib/python/setup.cfg +++ b/native-lib/python/setup.cfg @@ -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 =