Summary
In this chapter, we have built a fully fleshed-out Python pip
module with command-line tools, interfaces, and Rust code. We managed gitignore
for both Rust and Python development. We then defined our setup tools for packaging our Python code and module with the compilation of Rust code that has Python bindings. Once these were defined, we learned how to build Rust functions that spanned multiple Rust files that could be wrapped in pyo3
bindings.
Our development did not just stop at Rust. We also explored Python's singleton and adapter design patterns to build more advanced Python interfaces for our users. We then tested our code with unit tests and speed checking. It must be noted that we did not cover GitHub actions in this chapter. GitHub actions are defined in the same way as they were in the previous chapter. Instead of running tests using the Python unit test, we run our tests using Cargo and so on. However, uploading to PyPI is a little more complicated. To cover...