Dynamically opened python library
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.2k
- Forks
- 1k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 66
Description
I want to optionally allow python plugins for my project. It would be nice if PyO3 could be configured such that python isn't linked at compile time and instead the .so is loaded dynamically at runtime and symbols are also loaded dynamically.
An alternative would be to statically link python to my project so that it's always available but that would drastically increase my binary size.
I believe this can be implemented using the libloading crate, maybe macros can be used in some way to convert the extern "C" blocks into dynamic symbol lookups? I'm not too familiar with macros, so I cannot say for sure.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by reviewing PyO3's current compile-time Python linking and the proposed libloading approach, then determine the configuration and runtime symbol-loading design; done means optional dynamic loading works without linking Python at compile time while preserving the existing mode.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100