Metadata-Version: 2.4
Name: nvim-bin
Version: 0.12.5.1
Summary: Neovim from PyPI: official builds as wheels, installed with one setup command.
Author: nvim-bin contributors
License-Expression: MIT AND Apache-2.0 AND Vim
Project-URL: Homepage, https://github.com/nickeisenberg/nvim-bin
Project-URL: Issues, https://github.com/nickeisenberg/nvim-bin/issues
Project-URL: Source, https://github.com/nickeisenberg/nvim-bin
Keywords: neovim,nvim,editor,binary,wheels,vim
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: User Interfaces
Classifier: Topic :: Text Editors
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
License-File: src/nvim_bin/_nvim/LICENSE.nvim-0.12.txt
Dynamic: license-file

# nvim-bin

Neovim from PyPI, in seconds, without root: pick a Neovim line with pip and get
the official build for Linux (including RHEL 8-era systems), macOS or Windows,
as a plain directory you put where you want. Great for CI, containers, fresh
servers and machines without root, and just as nice on your own machine.

From nothing to a working `nvim` takes 3 to 4 seconds:

```console
$ time bash -c 'python3 -m venv get-nvim && \
    get-nvim/bin/pip install -q nvim-bin && \
    get-nvim/bin/nvim-bin setup --prefix ~/nvim && \
    ~/nvim/bin/nvim --version | head -1'
installed Neovim v0.12.6 into /home/you/nvim
  /home/you/nvim/bin/nvim
NVIM v0.12.6

real    0m3.390s
```

The wheel is 10-13 MB, with the binaries inside: nothing is downloaded from
GitHub, at install time or later.

## Install

```console
$ pip install "nvim-bin==0.12.*"     # the newest Neovim 0.12
$ pip install "nvim-bin==0.11.7.*"   # exactly Neovim v0.11.7
$ nvim-bin setup --prefix ~/.local
installed Neovim v0.12.6 into /home/you/.local
  /home/you/.local/bin/nvim
$ ~/.local/bin/nvim --verion | head -1
NVIM v0.12.6
```

`pipx install` and `uv tool install` work the same way, and so does uvx in one
command: `uvx --from "nvim-bin==0.11.*" nvim-bin setup --prefix ~/.local`.

The package version is the Neovim version plus a revision of this tool
(`0.12.6.1` is Neovim v0.12.6). Keep the trailing `.*`, so you get the newest
revision; see [How versions work](#how-versions-work).

## Use cases

**Testing a Neovim plugin in CI against several Neovim versions.**

```yaml
jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        nvim: ["0.10", "0.11", "0.12"]
    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-python@v6
        with:
          python-version: "3.12"
      - run: pip install "nvim-bin==${{ matrix.nvim }}.*"

      # either: run the bundled Neovim directly
      - run: nvim-bin run -- --headless -c "PlenaryBustedDirectory tests"

      # or: put `nvim` on PATH, for tests that call it themselves (a Makefile, a script)
      - run: nvim-bin setup --prefix ~/.local && echo "$HOME/.local/bin" >> "$GITHUB_PATH"
      - run: nvim --headless -c "PlenaryBustedDirectory tests"
```

**Containers.** In a glibc-based image (Debian, Ubuntu, `python:*-slim`, RHEL
and the like) you are usually root, so install straight into `/usr/local`:

```console
$ docker exec -it mycontainer bash
# pip install nvim-bin
# nvim-bin setup --prefix /usr/local
```

**No root or sudo.** Install for your user and put Neovim in `~/.local/bin`:

```console
$ python3 -m venv ~/.venvs/nvim && ~/.venvs/nvim/bin/pip install -q nvim-bin
$ ~/.venvs/nvim/bin/nvim-bin setup --prefix ~/.local
```

**Older Linux and HPC clusters.** The same commands work on RHEL 8 and similar
systems: pip picks a wheel with Neovim's glibc 2.17 build by itself. It needs
Python 3.9 or newer; on RHEL 8 that is `python3.9` (the `python39` package) or
a module your site provides.

**Your own machine, your own layout.** Each `setup` gives you a complete,
self-contained Neovim tree, so you can keep versions side by side and decide
yourself which one is `nvim`:

```console
$ uvx --from "nvim-bin==0.11.*" nvim-bin setup --prefix ~/opt/nvim-0.11
$ uvx --from "nvim-bin==0.12.*" nvim-bin setup --prefix ~/opt/nvim-0.12
$ ln -sf ~/opt/nvim-0.12/bin/nvim ~/.local/bin/nvim
```

Nothing updates behind your back: to move a prefix to a newer patch, upgrade
the package and run `setup --force` again.

**Restricted or offline networks.** Only PyPI, or an internal PyPI mirror, is
needed. For machines with no network at all, see
[Installing for other machines](#installing-for-other-machines).

## Platforms

| Line | Linux x86_64 | Linux arm64 | Older Linux x86_64 | Older Linux arm64 | macOS (Intel, Apple silicon) | Windows x64 | Windows arm64 |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `0.10` | ✓ | — ¹ | ✓ | — | ✓ | ✓ | — ² |
| `0.11` | ✓ | ✓ | ✓ | — | ✓ | ✓ | ✓ |
| `0.12` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |

"Linux" means glibc 2.34 or newer (Neovim's official builds); "Older Linux"
means glibc 2.17 to 2.33 (RHEL 8 and similar), with the builds Neovim publishes
in [`neovim/neovim-releases`](https://github.com/neovim/neovim-releases). You
never choose between them: pip installs the right one. macOS needs 11 or newer.

¹ Neovim's 0.10 arm64 build needs glibc 2.38, more than the other Linux builds.
² Neovim published no Windows arm64 build of 0.10.

Everything else gets no wheel ("no matching distribution"): Alpine and other
musl systems, macOS before 11, armv7, and Linux arm64 with a glibc too old for
the lines marked above. pip picks the wheel from the running Python, so an
x86_64 Python under Rosetta 2 (or on Windows on ARM) gets the x86_64 build,
which works but runs emulated.

## Where the binaries come from

The wheels carry Neovim's own release builds, unmodified: the archives
published in [`neovim/neovim`](https://github.com/neovim/neovim/releases) and,
for older Linux, `neovim/neovim-releases`. Each archive's sha256 is pinned in
[`lines.json`](https://github.com/nickeisenberg/nvim-bin/blob/master/lines.json)
and checked when the wheel is built. Wheels are built and uploaded only by this
repository's [release workflow](https://github.com/nickeisenberg/nvim-bin/blob/master/.github/workflows/release.yml),
with PyPI attestations that tie every file to the workflow run that made it
(shown on each file's page on PyPI). A weekly job proposes new Neovim patches,
with GitHub's checksums, as a pull request.

## How versions work

A version is `<Neovim version>.<revision>`: `0.12.6.1` is Neovim v0.12.6 with
revision 1 of this tool. A new Neovim patch is released as a new version
(`0.12.7.1`). A fix in this tool raises the revision, which releases the newest
patch of every line again (`0.10.4.2`, `0.11.7.2`, `0.12.7.2`); older patches
stay on PyPI as they were. So:

* `==0.12.*` follows the 0.12 line: its newest patch, with the newest fixes;
* `==0.12.6.*` stays on Neovim v0.12.6, with the newest fixes for it.

(pip allows one `*`, at the end; `==0.12.*` already covers every `0.12.Z.K`.)

`neovim-releases` often trails the official releases by a patch. Its wheels
are then released under their own Neovim version (official v0.12.6, older
Linux v0.12.5: `0.12.5.1`), and pip on an older system falls back to that
version when the newest one has no wheel for it. Once `neovim-releases`
catches up, the older-Linux wheels are added to the newer version.

`nvim-bin --version`, the
[GitHub releases](https://github.com/nickeisenberg/nvim-bin/releases)
and `lines.json` say exactly which Neovim each version carries. There are no
plans to drop a line: every line from 0.10 on keeps getting this tool's fixes.

## Commands

| Command | What it does |
| --- | --- |
| `nvim-bin setup --prefix DIR [--force]` | Install the bundled Neovim into `DIR` |
| `nvim-bin run [--] [ARGS]` | Run the bundled nvim without installing it |
| `nvim-bin --version` | This tool's version and the Neovim it carries |

`setup` writes only into `--prefix` (there is no default), with an ordinary
Neovim layout:

```console
<prefix>/bin/nvim                     # the executable, which belongs on PATH
<prefix>/lib/nvim/...                 # libraries it needs
<prefix>/share/nvim/runtime/...       # runtime files it needs
<prefix>/share/nvim-bin/              # records what was installed here
```

A prefix holds one Neovim, so use separate prefixes to keep several. `setup`
never deletes or overwrites anything without `--force`: not an earlier
install of its own (another version, or another machine's on a shared home
directory), and not files from elsewhere. It lists what it would replace and
stops. Other files in `<prefix>/bin` are always left alone. If `<prefix>/bin`
is not on `PATH`, `setup` says so.

`run` hands everything after it to Neovim verbatim:
`nvim-bin run -- -u NONE --headless "+q"`.

To uninstall, delete what `setup` put into the prefix:

```console
$ rm -r <prefix>/bin/nvim <prefix>/lib/nvim <prefix>/share/nvim/runtime <prefix>/share/nvim-bin
```

On Windows, `<prefix>\bin` also holds Neovim's DLLs and other files;
`<prefix>\share\nvim-bin\install.json` lists every entry there that `setup`
installed. `pip uninstall nvim-bin` removes only the package, not what
`setup` installed.

Do not delete `<prefix>/share/nvim` itself: with `--prefix ~/.local` that is
also Neovim's data directory (`stdpath("data")`), where plugin managers keep
your plugins. The other way round, resetting Neovim with
`rm -rf ~/.local/share/nvim` also removes the runtime; run `setup --force`
again afterwards.

**Stability.** Since the version number names the Neovim inside, it cannot
announce breaking changes in this tool. Instead, the command line is stable:
the commands and flags above, the prefix layout, the exit codes (0 success,
1 error, 2 bad usage; `run` exits with Neovim's own code) and the `--version`
line keep working. Commands and
flags may be added, never removed or changed in meaning. Everything else
`setup` prints is for people and may change.

## Installing for other machines

Each wheel carries one platform's build. To prepare all of them, for example
for machines without internet access, let pip download the other platforms'
wheels of a line:

```console
for p in manylinux_2_34_x86_64 manylinux_2_34_aarch64 macosx_11_0_x86_64 \
         macosx_11_0_arm64 win_amd64 win_arm64 manylinux2014_x86_64 manylinux2014_aarch64; do
  pip download "nvim-bin==0.12.*" --no-deps --only-binary=:all: --platform $p -d wheels/
done
```

On each machine, `pip install --no-index --find-links wheels/ nvim-bin`
picks the matching wheel. Without Python on the target, unzip the wheel:
`nvim_bin/_nvim/` inside it is a complete Neovim tree.

## Other ways to get Neovim

If you want Neovim to update along with the rest of your system, use your
package manager. For nightly builds, or switching versions with one command,
use [bob](https://github.com/MordechaiHadad/bob). nvim-bin is for when you
want a pinned official build and PyPI is the easiest place to get it from.
It starts at 0.10; for anything older, use Neovim's own release archives.

## Contributing

Building the wheels, releasing and following Neovim's releases are described
in [`CONTRIBUTING.md`](https://github.com/nickeisenberg/nvim-bin/blob/master/CONTRIBUTING.md).

## License

nvim-bin is MIT licensed. The bundled Neovim binaries and runtime are
distributed under Neovim's license (Apache-2.0, plus the Vim license for parts
of the runtime); see
[`THIRD_PARTY_NOTICES.md`](https://github.com/nickeisenberg/nvim-bin/blob/master/THIRD_PARTY_NOTICES.md)
and the `nvim_bin/_nvim/LICENSE.nvim-<line>.txt` file inside the wheel.
