Fangjun Kuang
Committed by GitHub

Fix building wheels for Python 3.7 (#1933)

@@ -34,7 +34,11 @@ jobs: @@ -34,7 +34,11 @@ jobs:
34 - name: Install Python dependencies 34 - name: Install Python dependencies
35 shell: bash 35 shell: bash
36 run: | 36 run: |
37 - pip install -U pip wheel setuptools twine==5.0.0 37 + if [[ ${{ matrix.python-version }} == "3.7" ]]; then
  38 + pip install -U pip wheel setuptools twine
  39 + else
  40 + pip install -U pip wheel setuptools twine==5.0.0
  41 + fi
38 42
39 - name: Build alsa-lib 43 - name: Build alsa-lib
40 shell: bash 44 shell: bash
@@ -110,6 +110,10 @@ jobs: @@ -110,6 +110,10 @@ jobs:
110 fi 110 fi
111 111
112 python3 -m pip install $opts --upgrade pip 112 python3 -m pip install $opts --upgrade pip
113 - python3 -m pip install $opts wheel twine==5.0.0 setuptools 113 + if [[ ${{ matrix.python-version }} == "cp37" ]]; then
  114 + python3 -m pip install $opts wheel twine setuptools
  115 + else
  116 + python3 -m pip install $opts wheel twine==5.0.0 setuptools
  117 + fi
114 118
115 twine upload ./wheelhouse/*.whl 119 twine upload ./wheelhouse/*.whl
@@ -89,11 +89,16 @@ jobs: @@ -89,11 +89,16 @@ jobs:
89 git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main 89 git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main
90 90
91 - name: Publish wheels to PyPI 91 - name: Publish wheels to PyPI
  92 + shell: bash
92 env: 93 env:
93 TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} 94 TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
94 TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} 95 TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
95 run: | 96 run: |
96 python3 -m pip install --upgrade pip 97 python3 -m pip install --upgrade pip
97 - python3 -m pip install wheel twine==5.0.0 setuptools 98 + if [[ ${{ matrix.python-version }} == "3.7" ]]; then
  99 + python3 -m pip install wheel twine setuptools
  100 + else
  101 + python3 -m pip install wheel twine==5.0.0 setuptools
  102 + fi
98 103
99 twine upload ./wheelhouse/*.whl 104 twine upload ./wheelhouse/*.whl
@@ -43,7 +43,7 @@ jobs: @@ -43,7 +43,7 @@ jobs:
43 fetch-depth: 0 43 fetch-depth: 0
44 - uses: actions/setup-go@v5 44 - uses: actions/setup-go@v5
45 with: 45 with:
46 - go-version: '>=1.12' 46 + go-version: '>=1.17'
47 47
48 - name: Display go version 48 - name: Display go version
49 shell: bash 49 shell: bash
@@ -47,7 +47,7 @@ jobs: @@ -47,7 +47,7 @@ jobs:
47 47
48 - uses: actions/setup-go@v5 48 - uses: actions/setup-go@v5
49 with: 49 with:
50 - go-version: '>=1.12' 50 + go-version: '>=1.17'
51 51
52 - name: Display go version 52 - name: Display go version
53 shell: bash 53 shell: bash
@@ -17,6 +17,7 @@ echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" @@ -17,6 +17,7 @@ echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
17 function linux() { 17 function linux() {
18 echo "Process linux" 18 echo "Process linux"
19 git clone git@github.com:k2-fsa/sherpa-onnx-go-linux.git 19 git clone git@github.com:k2-fsa/sherpa-onnx-go-linux.git
  20 +
20 rm -v ./sherpa-onnx-go-linux/*.go 21 rm -v ./sherpa-onnx-go-linux/*.go
21 22
22 cp -v ./sherpa_onnx.go ./sherpa-onnx-go-linux/ 23 cp -v ./sherpa_onnx.go ./sherpa-onnx-go-linux/