Skip to content
Draft
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
90 changes: 90 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
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]
steps:
- uses: actions/checkout@v6

- 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-latest
target: aarch64-apple-darwin
steps:
- uses: actions/checkout@v6

- 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@v7
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@v6

- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist

- name: Upload sdist
uses: actions/upload-artifact@v7
with:
name: sdist
path: dist/*.tar.gz
if-no-files-found: error
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
/target

# Python / maturin build artifacts
/dist
/build
/wheels
*.egg-info/
__pycache__/
*.py[cod]
.venv/
venv/
.env/
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -78,4 +118,3 @@ kv completions fish # generate fish completions

- Linux
- macOS
- Windows
33 changes: 33 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[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 :: 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