base on Solve and install Python packages quickly with rip (pip in Rust) <a href="https://github.com/prefix-dev/pixi/"> <picture> <source srcset="https://github.com/prefix-dev/rip/assets/4995967/aab133a8-b335-4942-bf56-335071c76db2" type="image/webp"> <source srcset="https://github.com/prefix-dev/rip/assets/4995967/3599ae56-42c5-4f3f-9db7-d844fa9558c9" type="image/png"> <img src="https://github.com/prefix-dev/rip/assets/4995967/3599ae56-42c5-4f3f-9db7-d844fa9558c9" alt="banner"> </picture> </a> # RIP: Fast, barebones **pip** implementation in Rust ![License][license-badge] [![Build Status][build-badge]][build] [![Project Chat][chat-badge]][chat-url] [![docs main][docs-main-badge]][docs-main] # Introduction `rip` is a library that allows the resolving and installing of Python [PyPI](https://pypi.org/) 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](https://github.com/prefix-dev/pixi) 📦 `rip` is based on the quite excellent work of [posy](https://github.com/njsmith/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 run install flask /tmp/flask` we get something like this: ![rip-install](https://github.com/prefix-dev/rip/assets/417374/1d55754f-de3a-474f-8ee8-06f7dd098eea) This showcases the downloading and caching of metadata from PyPI. As well as the package resolution using our incremental SAT solver: [Resolvo](https://github.com/mamba-org/resolvo), more on this below. Finally, after resolution it installs the package into a venv. We cache everything locally so that we can reuse the PyPI metadata. ## Features This is a list of current features of `rip`, the biggest are listed below: - [x] Async downloading and aggressive caching of PyPI metadata. - [x] Resolving of PyPI packages using [Resolvo](https://github.com/mamba-org/resolvo). - [x] Installation of wheel files. - [x] Support sdist files (must currently adhere to the `PEP 517` and `PEP 518` standards). - [x] Caching of locally built wheels. More intricacies of the PyPI ecosystem need to be implemented, see our [GitHub issues](https://github.com/prefix-dev/rip/issues) for more details. # Details ## Resolving We have integrated the stand-alone packaging SAT solver [Resolvo](https://github.com/mamba-org/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 run -- 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](./CONTRIBUTING.md) for more info. For questions, requests or a casual chat, we are very active on our [Discord server][chat-url]. [//]: # "[![crates.io][crates-badge]][crates]" [license-badge]: https://img.shields.io/badge/license-BSD--3--Clause-blue?style=flat-square [build-badge]: https://img.shields.io/github/actions/workflow/status/prefix-dev/rip/rust-compile.yml?style=flat-square&branch=main [build]: https://github.com/prefix-dev/rip/actions [chat-badge]: https://img.shields.io/discord/1082332781146800168.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2&style=flat-square [chat-url]: https://discord.gg/kKV8ZxyzY4 [docs-main-badge]: https://img.shields.io/badge/docs-main-yellow.svg?style=flat-square [docs-main]: https://prefix-dev.github.io/rip [crates]: https://crates.io/crates/rattler_installs_packages [crates-badge]: https://img.shields.io/crates/v/rattler_installs_packages.svg [rattler]: https://github.com/mamba-org/rattler ", Assign "at most 3 tags" to the expected json: {"id":"4056","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"