Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 8 additions & 57 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}}

Expand All @@ -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'
Expand All @@ -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}}
Expand Down
30 changes: 19 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -47,9 +47,9 @@ email = "[email protected]"
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]
Expand Down Expand Up @@ -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_*"
Expand Down Expand Up @@ -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"]
Expand Down
Loading