Prepare v0.22.0 #244
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Pull Request Test | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build_manylinux2014: | |
| name: Build for manylinux2014 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| cp: [cp312-cp312, cp313-cp313, cp314-cp314, cp314-cp314t] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| lfs: true | |
| - uses: bab2min/run-on-arch-action@multiple-step-v2 | |
| id: runcmd | |
| with: | |
| image: quay.io/pypa/manylinux2014_x86_64 | |
| githubToken: ${{ github.token }} | |
| multipleRun: | | |
| - name: Build | |
| run: | | |
| mv Kiwi/models/cong/base/sj.* model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/*.mdl model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/*.dict model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/combiningRule.txt model/kiwipiepy_model/ | |
| /opt/python/${{ matrix.cp }}/bin/pip install "cmake<4" | |
| rm /usr/local/bin/cmake || true | |
| ln -s /opt/python/${{ matrix.cp }}/bin/cmake /usr/local/bin/cmake | |
| /opt/python/${{ matrix.cp }}/bin/python -m pip install setuptools numpy==`/opt/python/${{ matrix.cp }}/bin/python .github/workflows/numpy_version.py` tqdm | |
| cd model | |
| /opt/python/${{ matrix.cp }}/bin/python setup.py build install | |
| cd .. | |
| /opt/python/${{ matrix.cp }}/bin/python setup.py build install | |
| /opt/python/${{ matrix.cp }}/bin/python -m pip install numpy==`/opt/python/${{ matrix.cp }}/bin/python .github/workflows/numpy_version.py v1` || true | |
| - name: Test kiwipiepy | |
| run: | | |
| /opt/python/${{ matrix.cp }}/bin/python -m pip install pytest | |
| /opt/python/${{ matrix.cp }}/bin/python -m pytest -svv test/test_kiwipiepy.py test/test_nogil_safety.py | |
| - name: Test transformers_addon | |
| run: | | |
| for v in {12..46} | |
| do | |
| echo "Test with transformers 4.$v ..." | |
| if /opt/python/${{ matrix.cp }}/bin/python -m pip install -U "transformers<4.$(($v+1))"; then | |
| /opt/python/${{ matrix.cp }}/bin/python -m pytest --verbose test/test_transformers_addon.py | |
| fi | |
| done | |
| - run: tar -zcvf build.tgz build | |
| - name: Archive binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Linux Binary ${{ matrix.cp }} | |
| path: build.tgz | |
| build_macos: | |
| name: Build for macOS | |
| runs-on: macOS-15 | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: [3.12, 3.13, 3.14, 3.14t] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| lfs: true | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v1 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: arm64 | |
| - name: Build | |
| run: | | |
| mv Kiwi/models/cong/base/sj.* model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/*.mdl model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/*.dict model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/combiningRule.txt model/kiwipiepy_model/ | |
| python -m pip install numpy==`python .github/workflows/numpy_version.py` setuptools tqdm | |
| cd model | |
| python setup.py build install | |
| cd .. | |
| MACOSX_DEPLOYMENT_TARGET=10.14 KIWI_CPU_ARCH=arm64 USE_MIMALLOC=1 python setup.py build | |
| python -m pip install numpy==`python .github/workflows/numpy_version.py v1` || true | |
| - name: Archive binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macOS Binary ${{ matrix.python-version }} | |
| path: | | |
| build/* | |
| - name: Test kiwipiepy | |
| run: | | |
| python -m pip install pytest | |
| python -m pytest -svv test/test_kiwipiepy.py test/test_nogil_safety.py | |
| build_macos_intel: | |
| name: Build for macOS Intel | |
| runs-on: macOS-15-intel | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: [3.13, 3.14t] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| lfs: true | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v1 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: x64 | |
| - name: Build | |
| run: | | |
| mv Kiwi/models/cong/base/sj.* model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/*.mdl model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/*.dict model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/combiningRule.txt model/kiwipiepy_model/ | |
| python -m pip install numpy==`python .github/workflows/numpy_version.py` setuptools tqdm | |
| cd model | |
| python setup.py build install | |
| cd .. | |
| MACOSX_DEPLOYMENT_TARGET=10.14 KIWI_CPU_ARCH=x86_64 USE_MIMALLOC=1 python setup.py build install | |
| python -m pip install numpy==`python .github/workflows/numpy_version.py v1` || true | |
| - name: Archive binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macOS Intel Binary ${{ matrix.python-version }} | |
| path: | | |
| build/* | |
| - name: Test kiwipiepy | |
| run: | | |
| python -m pip install pytest | |
| python -m pytest -svv test/test_kiwipiepy.py test/test_nogil_safety.py | |
| build_windows: | |
| name: Build for Windows | |
| runs-on: windows-2022 | |
| strategy: | |
| max-parallel: 5 | |
| matrix: | |
| python-version: [3.12, 3.13, 3.14, 3.14t] | |
| architecture: [x64] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| lfs: true | |
| - name: Set up Python ${{ matrix.python-version }} ${{ matrix.architecture }} | |
| uses: actions/setup-python@v1 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: ${{ matrix.architecture }} | |
| - name: Build | |
| run: | | |
| python -m pip install --upgrade pip setuptools tqdm | |
| python -m pip install numpy==$(python .github/workflows/numpy_version.py) | |
| mv Kiwi/models/cong/base/sj.* model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/*.mdl model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/*.dict model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/combiningRule.txt model/kiwipiepy_model/ | |
| cd model | |
| python setup.py build install | |
| cd .. | |
| $env:USE_MIMALLOC = 1; python setup.py build install | |
| Try { python -m pip install numpy==$(python .github/workflows/numpy_version.py v1) } Catch {} | |
| - name: Archive binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Windows Binary ${{ matrix.python-version }} ${{ matrix.architecture }} | |
| path: | | |
| build/* | |
| - name: Test kiwipiepy | |
| run: | | |
| python -m pip install pytest | |
| python -m pytest -vv test/test_kiwipiepy.py test/test_nogil_safety.py | |
| build_other_arch: | |
| name: Build for manylinux (other arch) | |
| runs-on: ubuntu-24.04-arm | |
| strategy: | |
| max-parallel: 8 | |
| matrix: | |
| cp: [cp311-cp311, cp312-cp312, cp313-cp313, cp314-cp314, cp314-cp314t] | |
| arch: [aarch64] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| lfs: true | |
| - uses: bab2min/run-on-arch-action@multiple-step-v2 | |
| id: runcmd | |
| with: | |
| image: quay.io/pypa/manylinux2014_${{ matrix.arch }} | |
| githubToken: ${{ github.token }} | |
| setup: | | |
| mkdir -p "${PWD}/artifacts" | |
| dockerRunArgs: | | |
| --volume "${PWD}/artifacts:/artifacts" | |
| multipleRun: | | |
| - name: Copy Model files | |
| run: | | |
| mv Kiwi/models/cong/base/sj.* model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/*.mdl model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/*.dict model/kiwipiepy_model/ | |
| mv Kiwi/models/cong/base/combiningRule.txt model/kiwipiepy_model/ | |
| - name: Install dependencies | |
| run: | | |
| /opt/python/${{ matrix.cp }}/bin/pip install "cmake<4" | |
| rm /usr/local/bin/cmake || true | |
| ln -s /opt/python/${{ matrix.cp }}/bin/cmake /usr/local/bin/cmake | |
| /opt/python/${{ matrix.cp }}/bin/python -m pip install wheel setuptools numpy==`/opt/python/${{ matrix.cp }}/bin/python .github/workflows/numpy_version.py` tqdm | |
| - name: Build model | |
| run: | | |
| cd model | |
| /opt/python/${{ matrix.cp }}/bin/python setup.py build install | |
| cd .. | |
| - name: Build | |
| run: | | |
| /opt/python/${{ matrix.cp }}/bin/python setup.py build install bdist_wheel | |
| /opt/python/${{ matrix.cp }}/bin/python -m pip install numpy==`/opt/python/${{ matrix.cp }}/bin/python .github/workflows/numpy_version.py v1` || true | |
| tar -zcvf /artifacts/build.tgz build/* | |
| cp -r dist /artifacts/ | |
| - name: Test | |
| run: | | |
| /opt/python/${{ matrix.cp }}/bin/python -m pip install pytest | |
| /opt/python/${{ matrix.cp }}/bin/python -m pytest -svv test/test_kiwipiepy.py test/test_nogil_safety.py | |
| - name: Archive binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Linux ${{ matrix.arch }} Binary ${{ matrix.cp }} | |
| path: artifacts/build.tgz | |
| - name: Archive binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Linux ${{ matrix.arch }} Wheel ${{ matrix.cp }} | |
| path: artifacts/dist/*.whl |