Questions tagged [maturin]
11 questions
1
vote
1 answer
maturin build not working with older python versions
I created anaconda environment
$ python --version
Python 3.7.13
$ pip --version
pip 22.2.2 from C:\tools\miniconda3\envs\py37\lib\site-packages\pip (python 3.7)
In pyproject.toml I have requires-python = ">=3.7"
[build-system]
requires =…

alagris
- 1,838
- 16
- 31
1
vote
2 answers
Using Pylint with PyModule generated using PyO3 and maturin
Pylint will not recognize any of the functions from a PyModule that I created using PyO3 and maturin. All of the functions import and run fine in the python code base, but for some reason Pylint is throwing E1011: no-member warnings.
Below is a…

codeAndStuff
- 507
- 6
- 19
1
vote
2 answers
Rust string comparison same speed as Python . Want to parallelize the program
I am new to rust. I want to write a function which later can be imported into Python as a module using the pyo3 crate.
Below is the Python implementation of the function I want to implement in Rust:
def pcompare(a, b):
letters = []
for i,…

William Rosenbaum
- 255
- 2
- 7
0
votes
1 answer
How to Pickle / deepcopy Python class created with maturin?
I've been working on integrating rust code into python using PyO3 and Maturin. I've successfully written my Rust class and gotten most of the functionality to work, however I haven't been able to successfully deepcopy the object. I've tried…

wfjohns1
- 31
- 2
0
votes
0 answers
using maturin to publish to private PyPi (code artifact)
I have a rust project, using pyo3. The project is built and installed via Maturin and locally everything works ok.
I'm trying to publish the package into an AWS Code Artifact PyPi, however, even after configuring MATURIN_PYPI_TOKEN and providing the…

picki23
- 53
- 4
0
votes
0 answers
Using pyo3 and maturin for Python bindings. How to structure it?
For an existing library, what is the best (or at least good) way to structure the project when creating Python bindings via pyo3 / maturin ?
So far I figure I can either just annotate all the structs and impls with #[pyclass] and #[pymethods]…

FISR
- 13
- 1
- 5
0
votes
0 answers
Rust package compiled with Maturin for use in Python causes significant runtime overhead compared to pure Rust
I am currently attempting to gain a speed-up for some computationally expensive parts of my Python code by instead rewriting them in Rust with PyO3 and using Maturin to create a Python package. I noticed that the Rust implementation was more than 3…

Brayden Freitas
- 1
- 1
0
votes
1 answer
How to iterate over vector of pyclass objects in rust?
I am using maturin and I am trying to implement the method get_car() for my class.
But using the following code
use pyo3::prelude::*;
#[pyclass]
struct Car {
name: String,
}
#[pyclass]
struct Garage {
cars: Vec,
}
#[pymethods]
impl…

Prokie
- 66
- 7
0
votes
1 answer
Updating project name in maturin build
I recently asked about how to have a CI pipeline create a wheel from a branch that could be selectively used by downstream projects. The best answer was to have it publish a wheel for my-project-branch-name instead of my-project. I have it set up…

Troy Daniels
- 3,270
- 2
- 25
- 57
0
votes
0 answers
Error with compiling Python code that includes Rust written modules
So I have written an app that uses a bit of Rust code, and while using "auto-py-to-exe" to turn it into an executable, it gives this error when I run it:
ModuleNotFoundError: No module named 'data_clean'
(data_clean is my rust module)
I used maturin…

NedNoodleHead
- 33
- 5
0
votes
1 answer
Cargo run using PyO3
I'm working on a rust/python package using PyO3 and its working great from python after I run maturin develop. I can import my rust code into Python and run my functions as I expect.
I would also like to still run my code from Rust though, and so…

dvreed77
- 2,217
- 2
- 27
- 42