-
Notifications
You must be signed in to change notification settings - Fork 255
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
Refactor of env.py #541
Refactor of env.py #541
Conversation
Thanks, this looks promising, and indeed wrapping up the logic into classes each with the specifics of the platform they care about will make things much clearer. For android, i'm not sure how much we need, as it's not the JVM running, but instead we connect to the Android Runtime (ART) that is already running, through SDL function, as a comment hints at, but there is still what happens in setup.py, that needs checking. For missing platforms, i wouldn't be too concerned, windows/osx/linux should cover most of our users, and we can add missing ones if people complain. |
Thanks. I agree with your comments. For Android, I couldn’t see any code setting arch in pyjnius, perhaps somewhere else in Kivy calls this? And could you test for Android please? Getting it through the GitHub Actions would also give me comfort. |
I'm also tempted to add |
@tshirtman I enabled Github Actions on my fork, and Python 2 failed. Would you be able to give a look: |
It's probably not hard to fix, i can have a look later, but i think we said we'd drop python2 in next version, so we could also just remove python2 in another PR and rebase this one. |
Thanks chief, I'll leave that up to you. |
I have updated this patch and its now passing on Windows too. I haven't addressed Python 2, and disabled that from the Github Workflow. |
Though I note this possible failure on Windows? https://github.com/cmacdonald/pyjnius/runs/795134983?check_suite_focus=true#step:8:41 |
I have rebased this patch. All CI pass including the x86 Linux one:
Though the Windows segfault of #561 is still exhibited. What's needed to get this in?
should be enough? |
@tshirtman Are there any plans to merge this PR in the future before a new release? It also solves a problem for us and would be great to know for planning! |
Sorry, i’ve been really unattentive to pyjnius lately, i’m ok with merging it as-is if it helps, as it seems i’m not going to find the focus to completely understand it, it seems not to break things, and certainly help with further maintenance. edit: ah right, we need to ensure it doesn’t break android, i’ll test it there later. |
Thanks @tshirtman. I am still subscribed if there are questions on this PR. The #561 issue is unrelated. I experienced this in PyTerrier - pytest has a faulthandler that tries to identify segfaults - I /think/ these are false positives for pyjnius on Windows, and it appears it can be safely ignored (c.f. https://github.com/terrier-org/pyterrier/blob/master/.github/workflows/push.yml#L82) |
Thanks for the quick response! If the Android tests turn out ok too, would you also consider making a new release after this merge? You mentioned you don’t have much time for pyjnius these days, but just asking since that would be very useful for us. |
This was merged on master through a local rebase. Closing. |
Thanks for merging @tshirtman ! |
Also forgot to mention and you might have missed it, but i released 1.4.0 with it last night. So many of your improvements are live now :) thanks for the patience ! |
Yes. I saw, thank you for your efforts too. |
Please consider this PR for review and testing.
I couldn't see an easy way to fix the challenge posed in #537, so I refactored env.py. There is now a base class for JavaLocation, which is overridden in platform specific manners. The role of each method is clearly specified. We also use a common, one-time logic for identifying the location of Java.
I have tested on:
It requires testing on:
Semantics changes:
We should also write a unit test for env.py