-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
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
Stub pyi file autogen using pyo3-stub-gen #237
base: master
Are you sure you want to change the base?
Conversation
@@ -48,3 +48,8 @@ serde_json.workspace = true | |||
ctrlc.workspace = true | |||
|
|||
argmin_testfunctions.workspace = true | |||
pyo3-stub-gen = { path = "../../pyo3-stub-gen/pyo3-stub-gen", features = ["numpy"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change in Jij-Inc/pyo3-stub-gen#142 required.
@@ -21,7 +21,8 @@ build-backend = "maturin" | |||
requires = ["maturin>=1.0, <2.0"] | |||
|
|||
[tool.maturin] | |||
python-source = "./" | |||
python-source = "egobox" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will make pyo3-stub-gen to put egobox.pyi
inside python/egobox
, I hope it is corrected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the research. Indeed, it's even better if we can generate the pyi file. At the moment, maybe we can use #235 to commit the generated egobox.pyi
and wait for pyo3-stub-gen
being "fixed" to merge this PR?
Sure, I think that is a feasible plan. I'll move the auto-gen part into another PR and keep this one with only the |
derived from #235, I think this way is a bit more elegant and can avoid duplicating the docstring.
It require extra proc-macros to be added (unavoidable because
pyo3-stub-gen
not part of PyO3).Since in egobox, it use the
PyReadonlyArray
which not cover by pyo3-stub-gen, the conversion would fail. I open a PR with the change of Jij-Inc/pyo3-stub-gen#142 to support it.@relf what do you think? I just did without change any docstring in Rust side, but if the auto stub gen framework is there, the change can only happened for the rust docstring, then out the scope of this PR.
EDIT: this one should wait until Jij-Inc/pyo3-stub-gen#142 adapted and back port to with 0.6.x