10 releases (breaking)

new 0.9.0 Apr 23, 2024
0.8.1 Feb 15, 2024
0.7.0 Feb 9, 2024
0.5.0 Feb 1, 2024
0.1.0 Dec 8, 2023

#375 in Development tools

Download history 100/week @ 2024-01-01 146/week @ 2024-01-08 281/week @ 2024-01-15 51/week @ 2024-01-22 127/week @ 2024-01-29 115/week @ 2024-02-05 543/week @ 2024-02-12 290/week @ 2024-02-19 569/week @ 2024-02-26 173/week @ 2024-03-04 72/week @ 2024-03-11 64/week @ 2024-03-18 35/week @ 2024-03-25 216/week @ 2024-04-01 28/week @ 2024-04-08 182/week @ 2024-04-15

471 downloads per month
Used in pixi

BSD-3-Clause

1.5MB
12K SLoC

Rust 10K SLoC // 0.1% comments Python 2.5K SLoC // 0.4% comments

Contains (DOS exe, 185KB) src/win/windows-launcher/t64-arm.exe, (DOS exe, 170KB) src/win/windows-launcher/w64-arm.exe, (DOS exe, 98KB) src/win/windows-launcher/t32.exe, (DOS exe, 110KB) src/win/windows-launcher/t64.exe, (DOS exe, 92KB) src/win/windows-launcher/w32.exe, (DOS exe, 105KB) src/win/windows-launcher/w64.exe

banner

RIP: Fast, barebones pip implementation in Rust

License Build Status Project Chat docs main

Introduction

RIP is a library that allows the resolving and installing of Python PyPI packages from Rust into a virtual environment. It's based on our experience with building Rattler and aims to provide the same experience but for PyPI instead of Conda.

What should I use this for?

Like Rattler, RIP should be fast and easy to use. This library is not a package manager itself but provides the low-level plumbing to be used in one. To see an example of this take a look at our package manager: pixi

RIP is based on the quite excellent work of posy and we have tried to credit the authors where possible.

Showcase

RIP has a very incomplete pip-like binary that can be used to test package installs. Let's resolve and install the flask python package. Running cargo r install flask /tmp/flask we get something like this:

rip-install

This showcases the downloading and caching of metadata from PyPI. As well as the package resolution using our incremental SAT solver: Resolvo, more on this below. Finally, after resolution it installs the package into a venv. We cache everything locally so that we can re-use the PyPi metadata.

Features

This is a list of current features of RIP, the biggest are listed below:

  • Async downloading and aggressive caching of PyPI metadata.
  • Resolving of PyPI packages using Resolvo.
  • Installation of wheel files.
  • Support sdist files (must currently adhere to the PEP 517 and PEP 518 standards).
  • Caching of locally built wheels.

More intricacies of the PyPI ecosystem need to be implemented, see our GitHub issues for more details.

Details

Resolving

We have integrated the stand-alone packaging SAT solver Resolvo, to resolve pypi packages. This solver is incremental and adds packaging metadata during resolution of the SAT problem. This feature can be enabled with the resolvo feature flag.

Installation

We have very simple installation support for the resolved packages. This should be used for testing purposes exclusively E.g. cargo r -- install flask /tmp/flask_env to create a venv and install the flask and it's into it. After which you can run:

  1. /tmp/flask_env/bin/python to start python in the venv.
  2. import flask #, this should import the flask package from the venv. There is no detection of existing packages in the venv yet, although this should be relatively straightforward.

Contributing 😍

We would love to have you contribute! See the CONTRIBUTING.md for more info. For questions, requests or a casual chat, we are very active on our discord server. You can join our discord server via this link.

Dependencies

~27–63MB
~1M SLoC