From 25b92d632700fc15f156114bda3bef3e9c25920f Mon Sep 17 00:00:00 2001 From: "Wu, Zhenyu" Date: Fri, 17 Jul 2026 05:47:47 +0800 Subject: [PATCH] :construction_worker: Update CD for windows --- .github/workflows/main.yml | 65 +++++--------------------------------- pyproject.toml | 30 +++++++++++------- 2 files changed, 27 insertions(+), 68 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7b39e74..c0d5669 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,33 +20,11 @@ env: cache: pip jobs: - # windows doesn't use cibuildwheel test: - strategy: - fail-fast: false - matrix: - include: - # E ImportError: DLL load failed while importing pyrime: - # The specified module could not be found. - # - runs-on: windows-latest - # shell: msys2 - - runs-on: ubuntu-latest - shell: bash - defaults: - run: - shell: ${{matrix.shell}} {0} - runs-on: ${{matrix.runs-on}} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: msys2/setup-msys2@v2 - if: runner.os == 'Windows' - with: - install: | - mingw-w64-x86_64-pkg-config mingw-w64-x86_64-librime - mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja - mingw-w64-x86_64-python-pip - name: Install dependencies - if: runner.os == 'Linux' run: | sudo apt-get -y update sudo apt-get -y install librime-dev @@ -62,46 +40,22 @@ jobs: build-wheels: needs: test - strategy: - fail-fast: false - matrix: - include: - - runs-on: ubuntu-latest - shell: bash - - runs-on: windows-latest - shell: msys2 - defaults: - run: - shell: ${{matrix.shell}} {0} - runs-on: ${{matrix.runs-on}} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: msys2/setup-msys2@v2 - if: runner.os == 'Windows' - with: - install: | - mingw-w64-x86_64-pkg-config mingw-w64-x86_64-librime - mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja - mingw-w64-x86_64-uv - name: Install dependencies - if: runner.os == 'Linux' run: | sudo apt-get -y update sudo apt-get -y install librime-dev - uses: astral-sh/setup-uv@v6 - if: runner.os == 'Linux' with: python-version: "3.13" - name: Build run: | - uv build --wheel - - name: Build sdist - if: runner.os == 'Linux' - run: | - uv build --sdist + uv build - uses: actions/upload-artifact@v4 with: - name: artifact-${{matrix.runs-on}}-noci + name: artifact-linux path: | ${{env.files}} @@ -112,11 +66,15 @@ jobs: runs-on: - ubuntu-latest - macos-latest + - windows-latest runs-on: ${{matrix.runs-on}} steps: - uses: actions/checkout@v4 - uses: docker/setup-qemu-action@v3 if: runner.os == 'Linux' + - name: Install Scoop + uses: MinoruSekine/setup-scoop@v4 + if: runner.os == 'Windows' - uses: actions/setup-python@v5 # /bin/sh: pip: command not found if: runner.os == 'macOS' @@ -142,13 +100,6 @@ jobs: pattern: artifact-* merge-multiple: true path: dist - - name: Rename - run: | - sudo apt-get -y update - sudo apt-get -y install rename - rename \ - 's/-(linux)/-many$1_2_17/;s/mingw_x86_64_msvcrt_gnu/win_amd64/' \ - dist/* - uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{secrets.PYPI_API_TOKEN}} diff --git a/pyproject.toml b/pyproject.toml index 0f9982f..9a325e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,43 +1,43 @@ [build-system] # https://github.com/elijahr/python-autopxd2/issues/60 -requires = ['meson-python', 'cython', 'autopxd2 != 3.0.*, !=3.1.*'] -build-backend = 'mesonpy' +requires = ["autopxd2 != 3.0.*, !=3.1.*", "cython", "meson-python"] +build-backend = "mesonpy" [project] name = "pyrime" -dynamic = ["version"] description = "rime for python, attached to prompt-toolkit keybindings for some prompt-toolkit applications such as ptpython" readme = "README.md" # Self requires-python = ">= 3.11" -keywords = ["rime", "ptpython", "prompt-toolkit"] +keywords = ["prompt-toolkit", "ptpython", "rime"] classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", - "Topic :: Software Development :: Build Tools", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", - "Operating System :: MacOS", - "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Software Development :: Build Tools", ] # change wcwidth to pyime after pyime is standalone dependencies = ["platformdirs", "wcwidth"] +dynamic = ["version"] [project.optional-dependencies] cli = ["getch"] color = ["colorama"] dev = ["pytest-cov", "prompt-toolkit"] +nvim = ["pynvim"] prompt-toolkit = ["prompt-toolkit"] ptpython = ["ptpython"] -nvim = ["pynvim"] [[project.authors]] name = "Wu, Zhenyu" @@ -47,9 +47,9 @@ email = "wuzhenyu@ustc.edu" text = "GPL v3" [project.urls] -Homepage = "https://pyrime.readthedocs.io" -Download = "https://github.com/rimeinn/pyrime/releases" "Bug Report" = "https://github.com/rimeinn/pyrime/issues" +Download = "https://github.com/rimeinn/pyrime/releases" +Homepage = "https://pyrime.readthedocs.io" Source = "https://github.com/rimeinn/pyrime" [tool.mdformat] @@ -101,7 +101,7 @@ archs = ["all"] # Almalinux 8's librime 1.3 is too old # cp314t-macosx-*: # /bin/sh: pip: command not found -skip = "*37-* *38-* *39-* *310-* cp314t-macosx_* *_universal2 *-macosx_x86_64 *-win* *-manylinux_*" +skip = "*37-* *38-* *39-* *310-* cp314t-macosx_* *_universal2 *-macosx_x86_64 *-win32 *-manylinux_*" # pyrime-0.2.3-cp311-cp311-macosx_26_0_arm64.whl) dependency is incompatible with the current platform # hint: The wheel is compatible with macOS (`macosx_26_0_arm64`), but you're on macOS (`macosx_15_0_arm64`) test-skip = "*-macosx_*" @@ -135,6 +135,14 @@ select = ["*-macosx_*"] # AssertionError: uv not found before-all = "brew install librime uv" +[[tool.cibuildwheel.overrides]] +select = ["*-win_*"] +before-all = """ +pip install uv +scoop bucket add siku https://github.com/amorphobia/siku +scoop install librime pkg-config +""" + # https://github.com/astral-sh/uv/issues/10260 [[tool.cibuildwheel.overrides]] select = ["*-musllinux_s390x", "*-musllinux_ppc64*", "*-musllinux_riscv64"]