-
Notifications
You must be signed in to change notification settings - Fork 231
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
Patch stash to run with Pythonista 3.4 beta #463
Conversation
`launch_stash.py` will work. But an ignore exception `No method found for selector "setAutomaticallyAdjustsContentInsetForKeyboard:"` is raised. pip seams to fail to download files.
Thank you for your bug report and the patch.
|
Sorry, my mistake. I've re-added them now.
|
Looks like we need to change isAlive to is_alive in shthreads.py also, is it just me, or do you have to call _stash.launch() from a background thread? I’m getting a crash on iPadOS 15 otherwise. |
Using `Thread.is_alive` in Python 3.9+ and fallback to `Thread.isAlive` to keep backward compatibility.
Using `SUITextView` by default and switch to `SUITextView_PY3` if available. Thanks goes to @jsbain for finding out the solution.
Thank you for your information. I've added these to the PR. And thanks for your hint with the
Which line of code you mean exactly? |
Come on guys, millions of eyes are watching you right now like never before. If OMZ could do it, so can you. |
I think adding them to setup.py would be the best, as it would mean less difference between the test environment and user enviroments. Either way, the changes seem to be good now, I'll merge this PR as soon as
I think millions of eyes may be a bit optimistic... unless you have like a lot of them in a jar somewhere... |
|
Since Pythonista 3.4 won‘t support Python 2 anymore and comes with Python 3.10 only, I think it is high time for stash to say Good-Bye to Python 2 as well and make the next release Python 3.10 only. Everybody having scripts that need earlier Python versions will have to stay on Pythonista 3.3 anyway or migrate them to 3.10. … Coming to think of it, stash might be used in other places than Pythonista as well. Thus it might not be that simple to drop at least Python 2 support. |
We could just fork and rename to stash3. On my iPad 6th gen running ipados15.1 I was getting a crash when running launch_stash. I chenged
To something wrapping in_background
|
Sorry for the delay.
That's a good point, I hadn't checked. I agree with the others that it may finally be time to drop py2, as much as it hurts (py27 FTW!). I propose the following course of action:
Anyone here opposed to this proposal? As for the PR, I'll merge it and #465 once we've decided on the future of py2 stash. It all looks ok, I don't think any more changes are necessary. Once again, thank you for your contribution. |
I see it has been a month since there was any further activity on this PR, is there an ETA on when it can be merged in to work with Pythonista 3.4 Beta? |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics | ||
- name: Running tests | ||
run: | | ||
py.test --version |
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.
It is deprecated to run pytest with the dot.
py.test --version | |
pytest --version |
system/shui/pythonista_ui.py
Outdated
# `Thread.isAlive()` was removed in Python 3.9 | ||
is_render_thread_alive = None | ||
if self.render_thread is not None: | ||
if hasattr(self.render_thread, 'is_alive'): | ||
is_render_thread_alive = self.render_thread.is_alive() | ||
else: | ||
is_render_thread_alive = self.render_thread.isAlive() | ||
|
||
if self.render_thread is None or not is_render_thread_alive: |
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.
Thread.is_alive()
was added in Python 2.6 so we can merely change .isAlive()
to .is_alive()
everywhere. See #478
# `Thread.isAlive()` was removed in Python 3.9 | |
is_render_thread_alive = None | |
if self.render_thread is not None: | |
if hasattr(self.render_thread, 'is_alive'): | |
is_render_thread_alive = self.render_thread.is_alive() | |
else: | |
is_render_thread_alive = self.render_thread.isAlive() | |
if self.render_thread is None or not is_render_thread_alive: | |
if self.render_thread is None or not self.render_thread.is_alive(): |
system/shthreads.py
Outdated
|
||
# `Thread.isAlive()` was removed in Python 3.9 | ||
if hasattr(self, 'is_alive'): | ||
is_alive = self.is_alive() | ||
else: | ||
is_alive = self.isAlive() | ||
|
||
if is_alive: |
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.
Thread.is_alive()
was added in Python 2.6 so we can merely change .isAlive()
to .is_alive()
everywhere. See #478
# `Thread.isAlive()` was removed in Python 3.9 | |
if hasattr(self, 'is_alive'): | |
is_alive = self.is_alive() | |
else: | |
is_alive = self.isAlive() | |
if is_alive: | |
if self.is_alive(): |
Please rebase and resolve git conflicts. |
Thank you for your conttribution and you patience. I'll merge it now (Edit: once the tests finish.). Regarding merge conflicts: No need to rebase and resolve this, this is trivial enough that I can do this quickly myself. (Edit 2 oops, I've messed it up, give me a minute...) |
Thanks @cclauss Co-authored-by: Christian Clauss <cclauss@me.com>
Let's add the test run on Python 3.10 because that is what the beta runs. |
On legacy Python:
Can we |
Yes, we could, but shouldn't we rather figure out why the binary install is failing? Basic wheel support is included and worked rather well so far (which is why our pip implementation prefers it over our setuptools mock). Either way, this seems like its not caused by the PR itself but rather due to the merge with the |
I don't think that Apple's security guidelines for iOS are going to allow a binary install. Please add py310 (see above) and run the tests again. That long run might have been a fluke. |
See discussion in ywangd#463 Co-authored-by: Christian Clauss <cclauss@me.com>
In this case "Binary" does not refer to a compiled file, but rather a distribution that does not require the execution of an installer. It's been a while since I worked on Anyway, you were right that the py36 failure was a fluke, I'll go ahead and finally merge this PR. |
launch_stash.py
will work. But an ignored exceptionNo method found for selector "setAutomaticallyAdjustsContentInsetForKeyboard:"
is raised.pip seams to fail to download files.
Edit:
The issue with
pip
is an exception raising inwget
.<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>