Skip to content

Commit 5094eb2

Browse files
committed
Refactor the wrapper based on Dynamsoft Capture Vision SDK
1 parent 6ac3ed2 commit 5094eb2

53 files changed

Lines changed: 820 additions & 6823 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 37 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,61 +3,54 @@ name: Build and upload to PyPI
33
on: [push, pull_request]
44

55
jobs:
6-
build_wheels:
7-
name: Build wheels on ${{ matrix.os }}
8-
runs-on: ${{ matrix.os }}
9-
strategy:
10-
matrix:
11-
os: [windows-latest, ubuntu-latest]
12-
python-version: ['3.10']
13-
6+
build:
7+
name: Build sdist + wheel (pure Python)
8+
runs-on: ubuntu-latest
149
steps:
15-
- uses: actions/checkout@v3
10+
- uses: actions/checkout@v4
1611

17-
- name: Set up Python
18-
uses: actions/setup-python@v4
12+
- name: Set up Python 3.x
13+
uses: actions/setup-python@v5
1914
with:
20-
python-version: ${{ matrix.python-version }}
21-
22-
- name: Run test.py in develop mode
15+
python-version: '3.12'
16+
cache: pip
17+
18+
- name: Run test.py
2319
run: |
24-
python -m pip install opencv-python setuptools
25-
python setup_setuptools.py develop
26-
python --version
20+
python -m pip install opencv-python dynamsoft-capture-vision-bundle
2721
python test.py
2822
29-
- name: Set up QEMU
30-
if: runner.os == 'Linux'
31-
uses: docker/setup-qemu-action@v2
32-
with:
33-
platforms: all
23+
- name: Install build tooling
24+
run: |
25+
python -m pip install -U pip build twine
3426
35-
- name: Build wheels
36-
uses: pypa/cibuildwheel@v2.6.1
37-
env:
38-
CIBW_BUILD: "cp39-*"
39-
CIBW_ARCHS_LINUX: auto, aarch64
40-
41-
- uses: actions/upload-artifact@v4
42-
with:
43-
name: wheel-${{ matrix.os }}-${{ matrix.python-version }}
44-
path: ./wheelhouse/*.whl
45-
46-
build_sdist:
47-
name: Build source distribution
48-
runs-on: ubuntu-latest
49-
steps:
50-
- uses: actions/checkout@v2
27+
- name: Build distributions
28+
run: |
29+
python -m build # creates dist/*.whl and dist/*.tar.gz
5130
52-
- name: Build sdist
53-
run: pipx run build --sdist
31+
- name: Check metadata
32+
run: |
33+
python -m twine check dist/*
34+
35+
- name: Ensure universal wheel for pure Python
36+
shell: bash
37+
run: |
38+
set -e
39+
WHEEL="$(ls dist/*.whl | head -n1)"
40+
echo "Built wheel: $WHEEL"
41+
# Expect *-py3-none-any.whl for pure-Python universal wheels
42+
if [[ "$WHEEL" != *"-py3-none-any.whl" ]]; then
43+
echo "::warning::Wheel is not tagged 'py3-none-any'. Verify package is pure Python or build config."
44+
fi
5445
55-
- uses: actions/upload-artifact@v4
46+
- name: Upload build artifacts
47+
uses: actions/upload-artifact@v4
5648
with:
57-
path: dist/*.tar.gz
49+
name: dist
50+
path: dist/*
5851

5952
upload_pypi:
60-
needs: [build_wheels, build_sdist]
53+
needs: build
6154
runs-on: ubuntu-latest
6255
# upload to PyPI on every tag starting with 'v'
6356
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
@@ -66,7 +59,7 @@ jobs:
6659
steps:
6760
- uses: actions/download-artifact@v4
6861
with:
69-
name: artifact
62+
name: dist
7063
path: dist
7164

7265
- uses: pypa/gh-action-pypi-publish@v1.4.2

CMakeLists.txt

Lines changed: 0 additions & 71 deletions
This file was deleted.

MANIFEST.in

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
include LICENSE
2-
include README.md
3-
recursive-include include *
4-
recursive-include lib *
5-
recursive-include src *
6-
include CMakeLists.txt
2+
include README.md

0 commit comments

Comments
 (0)