Recipes/Templates for Python project with Rust extensions?

I release a Python package: rateslib. The last version that successfully worked on conda-forge was 1.1.0, which was pure Python and worked right out of the box, since I published it as a no-arch distribution on PyPi, it relied on a boiler plate template to setup in conda-feedstock: GitHub - conda-forge/rateslib-feedstock: A conda-smithy repository for rateslib..

I have since added a Rust extension module within the package, and shifted the build process to maturin. Everything works locally and new versions have been pushed to PyPi (1.2.0 and 1.3.0). But I could not successful get this released in conda.

Package distribution is not my forte, I have no real knowledge of it, other than it being a somewhat trial and error process every 6 weeks or so. Is there any, simple, boiler plate setup I can copy to get this up and running on conda with a rust/maturin build process. I have only distributed Windows and Mac-OS wheels (and that is fine as an initial target) since I haven’t yet figured out the Many-Linux process either.

I have tried to take a look at the polars setup but it is far more complicated than I expect I need or can understand at this juncture.

There seems to be no activity on the feedstock PRs. Can you link to the place where you are trying to fix any issues? This setup is quite common, sadly polars is way more complex than it needs to be. Maybe pydantic-core-feedstock/recipe/meta.yaml at 38d4bda0879ce8e7315126a93fd143e5298cbcd6 · conda-forge/pydantic-core-feedstock · GitHub is a better starting point for you.

Hi, thanks for response. I looked at Pydantic, but it was not obvious how this was a different from a regular no-arch Pure Python project to one with rust - they seemed to use the build tool “hatch”.

Anyway, I created a manual pull request to my feedstock : 1.3.0 manual by attack68 · Pull Request #13 · conda-forge/rateslib-feedstock · GitHub

I changed the package builder to maturin and added rust to the meta.yaml host and the CI tests seemed to get further. They actually reported:

Successfully built rateslib
Installing collected packages: rateslib
Successfully installed rateslib-1.3.0
Removed build tracker: '/tmp/pip-build-tracker-w2ouf6nu'

However the next block still failed:

Packaging rateslib
Packaging rateslib-1.3.0-pyhd8ed1ab_0
WARNING: The install/build script(s) for rateslib deleted the following files (from dependencies) from the prefix:
['x86_64-conda-linux-gnu/lib/libgfortran.so.5', 'x86_64-conda-linux-gnu/lib/libgfortran.so', 'lib/gcc/x86_64-conda-linux-gnu/14.1.0/libhwasan.so', 'x86_64-conda-linux-gnu/lib/libgfortran.so.5.0.0']
This will cause the post-link checks to mis-report. Please try not to delete and files (DSOs in particular) from the prefix

conda_build.exceptions.OverLinkingError: <exception str() failed>

Any pointers?