Skip to content

Commit 7cd409e

Browse files
authored
Merge pull request #31 from b-long/develop
Version 0.2.3 : wheels for aarch64 (Linux), managed python builds (locally) and performance improvements
2 parents b0335d3 + c06f907 commit 7cd409e

19 files changed

Lines changed: 445 additions & 329 deletions

.github/workflows/build-golang-macos.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ jobs:
4343
# FIXME: Add more caching
4444
- name: Configure gopy / dependencies, and build wheel
4545
run: |
46-
./ci-build.sh
46+
./build-scripts/ci-build.sh
4747
4848
# - uses: ./.github/workflows/platform-integration-test.yaml
4949
# with:
50-
# wheel: dist/otdf_python-0.1.13-py3-none-any.whl
50+
# wheel: dist/otdf_python-0.2.3-py3-none-any.whl

.github/workflows/build-golang-ubuntu.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ jobs:
3939
# FIXME: Add more caching
4040
- name: Configure gopy / dependencies, and build wheel
4141
run: |
42-
./ci-build.sh
42+
./build-scripts/ci-build.sh
4343
4444
- uses: actions/cache/restore@v4
4545
with:
46-
path: dist/otdf_python-0.1.13-py3-none-any.whl
46+
path: dist/otdf_python-0.2.3-py3-none-any.whl
4747
key: ${{ runner.os }}${{ matrix.python3_version }}-data-${{ github.sha }}
4848

4949
- uses: actions/cache/save@v4
5050
with:
51-
path: dist/otdf_python-0.1.13-py3-none-any.whl
51+
path: dist/otdf_python-0.2.3-py3-none-any.whl
5252
key: ${{ runner.os }}${{ matrix.python3_version }}-data-${{ github.sha }}
5353
restore-keys: |
5454
${{ runner.os }}${{ matrix.python3_version }}-data-
@@ -61,5 +61,5 @@ jobs:
6161
needs: build
6262
uses: ./.github/workflows/platform-integration-test.yaml
6363
with:
64-
wheel: dist/otdf_python-0.1.13-py3-none-any.whl
64+
wheel: dist/otdf_python-0.2.3-py3-none-any.whl
6565
python_version: ${{ matrix.python3_version }}

.github/workflows/platform-integration-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
- uses: actions/cache/restore@v4
3131
with:
32-
path: dist/otdf_python-0.1.13-py3-none-any.whl
32+
path: dist/otdf_python-0.2.3-py3-none-any.whl
3333
key: ${{ runner.os }}${{ inputs.python_version }}-data-${{ github.sha }}
3434

3535
- name: Prove that the input file is available
@@ -52,7 +52,7 @@ jobs:
5252
- name: Set up go
5353
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
5454
with:
55-
go-version: "1.22.3"
55+
go-version: "1.22.x"
5656
check-latest: false
5757
cache-dependency-path: |
5858
platform/service/go.sum

.github/workflows/publish-test.yaml

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: TestPyPIBuild
22

3-
# Based on https://github.com/tuananh/py-event-ruler/blob/0129d15e17d0023863a4d0e0e25e5256988b5c5b/.github/workflows/publish.yml
3+
# Based on:
4+
# - https://github.com/tuananh/py-event-ruler/blob/0129d15e17d0023863a4d0e0e25e5256988b5c5b/.github/workflows/publish.yml
5+
# - https://github.com/adhadse/excelFormExtractor/blob/1f82a97808b3cf3cdb25dcefdc1c6a1c74c5ad45/.github/workflows/build.yaml
46

57

68
on:
@@ -9,13 +11,6 @@ on:
911
- develop
1012
workflow_dispatch:
1113

12-
# on:
13-
# # release:
14-
# # types: [created]
15-
# push:
16-
# tags:
17-
# - '*'
18-
1914
jobs:
2015
build_macos:
2116
# if: false
@@ -30,7 +25,7 @@ jobs:
3025
- [ "arm64", "arm64" ]
3126
runs-on: macos-${{ matrix.os_version }}
3227
steps:
33-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
3429

3530
- name: set up Go
3631
uses: actions/setup-go@v3
@@ -88,11 +83,11 @@ jobs:
8883

8984
build_linux_x86_64:
9085
# if: false
91-
name: Linux Python 3.x x86_64
86+
name: Linux Python x86_64
9287
runs-on: ubuntu-latest
9388

9489
steps:
95-
- uses: actions/checkout@v3
90+
- uses: actions/checkout@v4
9691

9792
- name: Setup project files
9893
run: |
@@ -108,7 +103,7 @@ jobs:
108103
CIBW_ENVIRONMENT: >
109104
PATH=$PATH:/usr/local/go/bin
110105
CIBW_BEFORE_ALL_LINUX: |
111-
curl -o go.tar.gz https://dl.google.com/go/go1.22.5.linux-amd64.tar.gz
106+
curl -o go.tar.gz https://dl.google.com/go/go1.22.7.linux-amd64.tar.gz
112107
tar -C /usr/local -xzf go.tar.gz
113108
go install github.com/go-python/gopy@v0.4.10
114109
go install golang.org/x/tools/cmd/goimports@latest
@@ -123,26 +118,59 @@ jobs:
123118
# # Test wheel functionality
124119
# python3 validate_otdf_python.py
125120

126-
- name: Upload atifacts
121+
- name: Upload artifacts
127122
uses: actions/upload-artifact@v4
128123
with:
129124
name: wheels-linux-amd64
130125
path: ./wheelhouse/*.whl
131126

127+
build_linux_arm:
128+
name: Linux Python ARM
129+
runs-on: ubuntu-latest
130+
131+
steps:
132+
- uses: actions/checkout@v4
133+
134+
- name: Setup project files
135+
run: |
136+
rm -rf poetry.lock pyproject.toml
137+
cp setup_ci.py setup.py
138+
139+
# QEMU is used by cibuildwheel to cross-compile wheels
140+
# https://cibuildwheel.pypa.io/en/stable/faq/#emulation
141+
- name: Set up QEMU
142+
if: runner.os == 'Linux'
143+
uses: docker/setup-qemu-action@v3
144+
with:
145+
platforms: all
146+
147+
- name: Build wheels
148+
uses: pypa/cibuildwheel@v2.21.3
149+
env:
150+
CIBW_BUILD: "cp3*_aarch64"
151+
CIBW_SKIP: "cp36-* cp37-* cp38-* cp39-* cp310-* cp313-* *-musllinux_x86_64"
152+
CIBW_ARCHS: "aarch64"
153+
CIBW_ENVIRONMENT: >
154+
PATH=$PATH:/usr/local/go/bin
155+
CIBW_BEFORE_ALL_LINUX: |
156+
curl -o go.tar.gz https://dl.google.com/go/go1.22.7.linux-arm64.tar.gz
157+
tar -C /usr/local -xzf go.tar.gz
158+
go install github.com/go-python/gopy@v0.4.10
159+
go install golang.org/x/tools/cmd/goimports@latest
132160
133161
- name: Upload artifacts
134162
uses: actions/upload-artifact@v4
135163
with:
136164
name: wheels-linux-arm
137-
path: /tmp/output/*.whl
165+
path: ./wheelhouse/*.whl
138166

139167
# build_windows:
140168
# if: false # not working
141169
# name: Windows 310,311 x86_64
142170
# runs-on: windows-2019
143171

144172
# steps:
145-
# - uses: actions/checkout@v3
173+
# - uses: actions/checkout@v4
146174

147175
# - name: Setup project files
148176
# run: |
@@ -182,9 +210,10 @@ jobs:
182210
contents: write
183211
# This permission is mandatory for PyPI's trusted publishing
184212
id-token: write
185-
needs: [build_macos, build_linux_x86_64]
213+
needs: [build_macos, build_linux_x86_64, build_linux_arm]
186214
runs-on: ubuntu-latest
187-
# if: github.ref == 'refs/heads/main'
215+
# If branch is 'develop'
216+
if: github.ref == 'refs/heads/develop'
188217

189218
steps:
190219
- uses: actions/checkout@v4

.github/workflows/publish.yaml

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: PyPIBuild
22

3-
# Based on https://github.com/tuananh/py-event-ruler/blob/0129d15e17d0023863a4d0e0e25e5256988b5c5b/.github/workflows/publish.yml
3+
# Based on:
4+
# - https://github.com/tuananh/py-event-ruler/blob/0129d15e17d0023863a4d0e0e25e5256988b5c5b/.github/workflows/publish.yml
5+
# - https://github.com/adhadse/excelFormExtractor/blob/1f82a97808b3cf3cdb25dcefdc1c6a1c74c5ad45/.github/workflows/build.yaml
46

57

68
on:
@@ -9,13 +11,6 @@ on:
911
- main
1012
workflow_dispatch:
1113

12-
# on:
13-
# # release:
14-
# # types: [created]
15-
# push:
16-
# tags:
17-
# - '*'
18-
1914
jobs:
2015
build_macos:
2116
# if: false
@@ -30,7 +25,7 @@ jobs:
3025
- [ "arm64", "arm64" ]
3126
runs-on: macos-${{ matrix.os_version }}
3227
steps:
33-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
3429

3530
- name: set up Go
3631
uses: actions/setup-go@v3
@@ -88,11 +83,11 @@ jobs:
8883

8984
build_linux_x86_64:
9085
# if: false
91-
name: Linux Python 3.x x86_64
86+
name: Linux Python x86_64
9287
runs-on: ubuntu-latest
9388

9489
steps:
95-
- uses: actions/checkout@v3
90+
- uses: actions/checkout@v4
9691

9792
- name: Setup project files
9893
run: |
@@ -108,7 +103,7 @@ jobs:
108103
CIBW_ENVIRONMENT: >
109104
PATH=$PATH:/usr/local/go/bin
110105
CIBW_BEFORE_ALL_LINUX: |
111-
curl -o go.tar.gz https://dl.google.com/go/go1.22.5.linux-amd64.tar.gz
106+
curl -o go.tar.gz https://dl.google.com/go/go1.22.7.linux-amd64.tar.gz
112107
tar -C /usr/local -xzf go.tar.gz
113108
go install github.com/go-python/gopy@v0.4.10
114109
go install golang.org/x/tools/cmd/goimports@latest
@@ -123,26 +118,59 @@ jobs:
123118
# # Test wheel functionality
124119
# python3 validate_otdf_python.py
125120

126-
- name: Upload atifacts
121+
- name: Upload artifacts
127122
uses: actions/upload-artifact@v4
128123
with:
129124
name: wheels-linux-amd64
130125
path: ./wheelhouse/*.whl
131126

127+
build_linux_arm:
128+
name: Linux Python ARM
129+
runs-on: ubuntu-latest
130+
131+
steps:
132+
- uses: actions/checkout@v4
133+
134+
- name: Setup project files
135+
run: |
136+
rm -rf poetry.lock pyproject.toml
137+
cp setup_ci.py setup.py
138+
139+
# QEMU is used by cibuildwheel to cross-compile wheels
140+
# https://cibuildwheel.pypa.io/en/stable/faq/#emulation
141+
- name: Set up QEMU
142+
if: runner.os == 'Linux'
143+
uses: docker/setup-qemu-action@v3
144+
with:
145+
platforms: all
146+
147+
- name: Build wheels
148+
uses: pypa/cibuildwheel@v2.21.3
149+
env:
150+
CIBW_BUILD: "cp3*_aarch64"
151+
CIBW_SKIP: "cp36-* cp37-* cp38-* cp39-* cp310-* cp313-* *-musllinux_x86_64"
152+
CIBW_ARCHS: "aarch64"
153+
CIBW_ENVIRONMENT: >
154+
PATH=$PATH:/usr/local/go/bin
155+
CIBW_BEFORE_ALL_LINUX: |
156+
curl -o go.tar.gz https://dl.google.com/go/go1.22.7.linux-arm64.tar.gz
157+
tar -C /usr/local -xzf go.tar.gz
158+
go install github.com/go-python/gopy@v0.4.10
159+
go install golang.org/x/tools/cmd/goimports@latest
132160
133161
- name: Upload artifacts
134162
uses: actions/upload-artifact@v4
135163
with:
136164
name: wheels-linux-arm
137-
path: /tmp/output/*.whl
165+
path: ./wheelhouse/*.whl
138166

139167
# build_windows:
140168
# if: false # not working
141169
# name: Windows 310,311 x86_64
142170
# runs-on: windows-2019
143171

144172
# steps:
145-
# - uses: actions/checkout@v3
173+
# - uses: actions/checkout@v4
146174

147175
# - name: Setup project files
148176
# run: |
@@ -182,9 +210,10 @@ jobs:
182210
contents: write
183211
# This permission is mandatory for PyPI's trusted publishing
184212
id-token: write
185-
needs: [build_macos, build_linux_x86_64]
213+
needs: [build_macos, build_linux_x86_64, build_linux_arm]
186214
runs-on: ubuntu-latest
187-
# if: github.ref == 'refs/heads/main'
215+
# If branch is 'main'
216+
if: github.ref == 'refs/heads/main'
188217

189218
steps:
190219
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)