From 65ff2b1e9a48601271e523aa4ede659c2e91e26f Mon Sep 17 00:00:00 2001 From: Michael Shustin Date: Tue, 28 Apr 2026 23:38:16 +0300 Subject: [PATCH 1/5] Added maturin to build wheels --- .gitignore | 11 +++++++++++ README.md | 41 ++++++++++++++++++++++++++++++++++++++++- pyproject.toml | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 pyproject.toml diff --git a/.gitignore b/.gitignore index ea8c4bf..7a3a7fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,12 @@ /target + +# Python / maturin build artifacts +/dist +/build +/wheels +*.egg-info/ +__pycache__/ +*.py[cod] +.venv/ +venv/ +.env/ diff --git a/README.md b/README.md index 9067517..b30d71d 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,36 @@ CLI tool to launch and manage [KoalaVim](https://github.com/KoalaVim/KoalaVim) e ## Installation +`kv` is a Rust binary. It can be installed with `cargo`, or with `pip` / `uv` +(packaged via [maturin](https://www.maturin.rs/)). All methods require a Rust +toolchain to build the binary. + +### With `uv` (recommended) + +```bash +# From Git +uv tool install git+https://github.com/KoalaVim/kv.git + +# From a local checkout +git clone https://github.com/KoalaVim/kv.git +cd kv +uv tool install . +``` + +### With `pip` + +```bash +# From Git +pip install git+https://github.com/KoalaVim/kv.git + +# From a local checkout +git clone https://github.com/KoalaVim/kv.git +cd kv +pip install . +``` + +### With `cargo` + Make sure [Cargo](https://www.rust-lang.org/tools/install) is installed (`~/.cargo/bin` should be in your `PATH`). ```bash @@ -20,6 +50,16 @@ cd kv cargo install --locked --path . ``` +### Building a wheel + +To build a redistributable wheel (e.g. to publish or install offline): + +```bash +uvx maturin build --release +# wheel is written to target/wheels/ +pip install target/wheels/kv-*.whl +``` + ## Try Without Installing ```bash @@ -78,4 +118,3 @@ kv completions fish # generate fish completions - Linux - macOS -- Windows diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..7adeaaa --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,34 @@ +[build-system] +requires = ["maturin>=1.7,<2.0"] +build-backend = "maturin" + +[project] +name = "kv" +description = "CLI tool to launch KoalaVim" +readme = "README.md" +requires-python = ">=3.8" +license = { file = "LICENSE" } +authors = [{ name = "KoalaVim" }] +keywords = ["neovim", "koalavim", "cli"] +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Programming Language :: Rust", + "Topic :: Text Editors", + "Topic :: Utilities", +] +dynamic = ["version"] + +[project.urls] +Homepage = "https://github.com/KoalaVim/kv" +Repository = "https://github.com/KoalaVim/kv" +Issues = "https://github.com/KoalaVim/kv/issues" + +[tool.maturin] +bindings = "bin" +strip = true From 113911d2179d63fc8061e93d3ff13f69f8305ee1 Mon Sep 17 00:00:00 2001 From: Michael Shustin Date: Tue, 28 Apr 2026 23:38:52 +0300 Subject: [PATCH 2/5] Added basic CI workflow --- .github/workflows/ci.yml | 94 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fd2c228 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,94 @@ +name: CI + +on: + push: + branches: [master] + tags: ["v*"] + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: Test on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + components: clippy, rustfmt + + - uses: Swatinem/rust-cache@v2 + + - name: cargo fmt --check + run: cargo fmt --check + + - name: cargo clippy + run: cargo clippy --all-targets --locked -- -D warnings + + - name: cargo test + run: cargo test --locked + + build: + name: Build wheel (${{ matrix.target }}) + needs: test + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + - os: ubuntu-latest + target: aarch64-unknown-linux-gnu + - os: macos-13 + target: x86_64-apple-darwin + - os: macos-latest + target: aarch64-apple-darwin + - os: windows-latest + target: x86_64-pc-windows-msvc + steps: + - uses: actions/checkout@v4 + + - name: Build wheel + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.target }} + args: --release --locked --out dist + sccache: "true" + + - name: Upload wheel + uses: actions/upload-artifact@v4 + with: + name: wheel-${{ matrix.target }} + path: dist/*.whl + if-no-files-found: error + + sdist: + name: Build sdist + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + uses: PyO3/maturin-action@v1 + with: + command: sdist + args: --out dist + + - name: Upload sdist + uses: actions/upload-artifact@v4 + with: + name: sdist + path: dist/*.tar.gz + if-no-files-found: error From ed188dd089f793999a972e0f7854b613578847e6 Mon Sep 17 00:00:00 2001 From: Michael Shustin Date: Mon, 11 May 2026 09:08:13 +0300 Subject: [PATCH 3/5] ci: drop windows from test matrix and pyproject classifiers Co-authored-by: Cursor --- .github/workflows/ci.yml | 4 +--- pyproject.toml | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd2c228..8189b0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] steps: - uses: actions/checkout@v4 @@ -54,8 +54,6 @@ jobs: target: x86_64-apple-darwin - os: macos-latest target: aarch64-apple-darwin - - os: windows-latest - target: x86_64-pc-windows-msvc steps: - uses: actions/checkout@v4 diff --git a/pyproject.toml b/pyproject.toml index 7adeaaa..0f6ba98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,6 @@ classifiers = [ "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: MacOS", - "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Programming Language :: Rust", "Topic :: Text Editors", From 2af67e51ad27a58afae18f500bf08023e010a9f3 Mon Sep 17 00:00:00 2001 From: Michael Shustin Date: Mon, 11 May 2026 09:38:46 +0300 Subject: [PATCH 4/5] ci: drop x86_64 macos from build matrix Co-authored-by: Cursor --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8189b0c..8dd3d8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,8 +50,6 @@ jobs: target: x86_64-unknown-linux-gnu - os: ubuntu-latest target: aarch64-unknown-linux-gnu - - os: macos-13 - target: x86_64-apple-darwin - os: macos-latest target: aarch64-apple-darwin steps: From 963a30ffc24cf158a79bcb6a31396efa0649cb45 Mon Sep 17 00:00:00 2001 From: Michael Shustin Date: Mon, 11 May 2026 11:19:57 +0300 Subject: [PATCH 5/5] ci: bump checkout@v6 and upload-artifact@v7 for node 24 Co-authored-by: Cursor --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8dd3d8f..a4da774 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rust uses: dtolnay/rust-toolchain@stable @@ -53,7 +53,7 @@ jobs: - os: macos-latest target: aarch64-apple-darwin steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Build wheel uses: PyO3/maturin-action@v1 @@ -63,7 +63,7 @@ jobs: sccache: "true" - name: Upload wheel - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: wheel-${{ matrix.target }} path: dist/*.whl @@ -74,7 +74,7 @@ jobs: needs: test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Build sdist uses: PyO3/maturin-action@v1 @@ -83,7 +83,7 @@ jobs: args: --out dist - name: Upload sdist - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: sdist path: dist/*.tar.gz