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
2 changes: 1 addition & 1 deletion .github/actions/python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ runs:
uses: actions/upload-artifact@v7.0.1
with:
name: python-wheel-${{ inputs.native-version }}-${{ inputs.platform }}
path: native-lib/python/dist/dataweave_native-0.0.1-py3-*.whl
path: native-lib/python/dist/dataweave_native-*-py3-*.whl
archive: false
if-no-files-found: error

Expand Down
2 changes: 1 addition & 1 deletion native-lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ The wheel will be created in:
After `:native-lib:buildPythonWheel`:

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

This wheel includes the `dwlib.*` shared library inside the Python package.
Expand Down
2 changes: 2 additions & 0 deletions native-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ tasks.register('buildPythonWheel', Exec) {
inputs.file("${projectDir}/python/setup.py")
inputs.file("${projectDir}/python/setup.cfg")
inputs.file("${projectDir}/python/pyproject.toml")
inputs.property('nativeVersion', project.version.toString())
outputs.dir("${projectDir}/python/dist")
doFirst {
// Clean old wheels and build artifacts to ensure fresh build
Expand All @@ -145,6 +146,7 @@ tasks.register('buildPythonWheel', Exec) {
// Use setup.py bdist_wheel to generate platform-specific wheel tags
// The custom setup.py overrides bdist_wheel to set correct platform tags
// for the bundled native library (dwlib)
environment 'NATIVE_VERSION', project.version.toString()
commandLine(pythonExe, 'setup.py', 'bdist_wheel', '-d', 'dist')
}

Expand Down
2 changes: 1 addition & 1 deletion native-lib/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ After building:

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

### Option B: Editable install for development
Expand Down
9 changes: 0 additions & 9 deletions native-lib/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "dataweave-native"
version = "0.0.1"
description = "Python bindings for the DataWeave native library"
requires-python = ">=3.9"

[project.optional-dependencies]
test = ["pytest", "pytest-cov"]
5 changes: 5 additions & 0 deletions native-lib/python/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ python_requires = >=3.9
[options.packages.find]
where = src

[options.extras_require]
test =
pytest
pytest-cov

[options.package_data]
dataweave =
native/*
6 changes: 5 additions & 1 deletion native-lib/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
tags based on the current build environment.
"""

import os
import platform
import struct
import sys
Expand Down Expand Up @@ -106,4 +107,7 @@ def get_tag(self):
if bdist_wheel is not None:
cmdclass["bdist_wheel"] = bdist_wheel

setup(cmdclass=cmdclass)
setup(
version=os.environ.get("NATIVE_VERSION", "0.0.1"),
cmdclass=cmdclass,
)
Loading