We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Link to POC implementation
Manually maintaining a .PYI for your PYO3 project sucks
Place pyi-macros in the root of your PYO3 project.
Replace "INSERT_MODULE_NAME_HERE" with the name of your PYO3 module.
"INSERT_MODULE_NAME_HERE"
Make a dependency to the pyi_macros and add an optional feature:
[dependencies] pyo3 = { version = "0.20.3", features = ["chrono"] } pyi_macros = { path = "../pyi-macros", optional = true } [features] pyi = ["pyi_macros"]
#[cfg_attr(feature = "pyi", pyi_macros::pyi)] #[pyclass] pub enum MyEnum { /// Some doc string High, /// Some doc string Low } #[cfg_attr(feature = "pyi", pyi_macros::pyi)] #[pyclass] pub struct MyClass { /// Some doc string pub value: i64 } #[cfg_attr(feature = "pyi", pyi_macros::pyi_impl)] #[pyclass] pub struct MyClass { /// Some doc string pub value: i64 }
> cargo build --features pyi
--all-features
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Link to POC implementation
Motivation
Manually maintaining a .PYI for your PYO3 project sucks
Setup
Unpack
Place pyi-macros in the root of your PYO3 project.
Modify the path
Replace
"INSERT_MODULE_NAME_HERE"
with the name of your PYO3 module.Dependencies
Make a dependency to the pyi_macros and add an optional feature:
Usage
Create the PYI interface file:
> cargo build --features pyi
Know limitations
--all-features
flags for other cargo commandsThe text was updated successfully, but these errors were encountered: