Chapter 5: Creating a Rust Interface for Our pip Module
In Chapter 4, Building pip Modules in Python, we built a pip
module in Python. Now, we will build the same pip
module in Rust and manage the interface. Some people might prefer Python for some tasks; others will state that Rust is better. In this chapter, we will simply utilize both as and when we want. To achieve this, we will build a pip
module in Rust that can be installed and directly imported into our Python code. We will also build Python entry points that talk directly to our compiled Rust code, and Python adapters/interfaces to make the user experience of our module easy, safe, and locked down with user interfaces (UIs) that have all features that we want our user to use.
In this chapter, we will cover the following topics:
- Packaging Rust with
pip
- Building a Rust interface with the
pyO3
crate - Building tests for our Rust package
- Comparing speed with Python, Rust, and Numba
Covering these...