-
Notifications
You must be signed in to change notification settings - Fork 15
feat: add scyjava-stubgen cli command, and scyjava.types
namespace, which provide type-safe imports with lazy init
#82
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
base: main
Are you sure you want to change the base?
Conversation
- Introduced `scyjava-stubs` executable for generating Python type stubs from Java classes. - Implemented dynamic import logic in `_dynamic_import.py`. - Added stub generation logic in `_genstubs.py`. - Updated `pyproject.toml` to include new dependencies and scripts. - Created `__init__.py` for the `_stubs` package to expose key functionalities.
…mprove stub generation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #82 +/- ##
===========================================
+ Coverage 52.72% 75.98% +23.25%
===========================================
Files 12 20 +8
Lines 1303 1653 +350
===========================================
+ Hits 687 1256 +569
+ Misses 616 397 -219 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
hey @ctrueden, I'm struggling to run the jep tests locally (on my mac). I have
it's a bit unclear to me whether I should be trying to get these to work at all with jep, or just add a skip to the test |
As a workaround, you could try setting |
got that working... and commented out the "don't run on macos cause it's flaky" bit, and now get this:
that's probably not the flaky bit right? looks like a poor setup of the python environment |
i think i see the issue, i'll work on the |
after digging a bit deeper into how jgo and jep itself is working, I'm skipping stubgen tests on jep for now. it seems extremely dependent on some careful manual setup of the python environment. I was able to get it to find my standard library, but then it lost the pure python parts of jep. After fixing that, it was unable to find my (editable) install of scyjava because it's not following |
code-wise, this is ready to go... however, I don't expect it to be "human-interpretable" yet. There are many ways we could choose to document this and encourage/discourage its usage in various scenarios. Might be best to have a zoom about it so we can tinker with it together and discuss |
many more details and tests to follow... but just wanted to open this as a WIP.
Basic idea, after checking out this branch and running
pip install -e .
again:scyjava-stubgen org.scijava:parsington:3.1.0
python -c "from scyjava.types.org.scijava.parsington import Function; print(Function(1))"
. Only at the moment of class instantiation will the jvm be started.