Do not work in pythonista 3.5 (TestFlight)
Don't launch because of imp module removed
I've looked into this a couple of weeks ago. The problem isn't really the imp module - replacing it is trivial - it's the missing six module. StaSh was originally written for py2 and later ported to py3. However, several functions of StaSh, for example git, were never ported. As a interim solution, we instead ported StaSh to support both py2 and py3 simultaneously, so that if anyone needed a py2-only feature they could still use it. This required us to make extensive use of the six module for improved compatibility. Now, however, the six module is no longer included in pythonista3, so someone would have to rewrite all that code again.
Anyway, we could simply fix the imp problem, but until someone removes six (or, preferably, six would be included in pythonista again) it wouldn't actually fix anything. That would likely involve dropping py2 support, which in turn should involve a change in the update strategy (see https://github.com/ywangd/stash/pull/463#issuecomment-1407885936).
I've looked into this a couple of weeks ago. The problem isn't really the
impmodule - replacing it is trivial - it's the missingsixmodule. StaSh was originally written for py2 and later ported to py3. However, several functions of StaSh, for examplegit, were never ported. As a interim solution, we instead ported StaSh to support both py2 and py3 simultaneously, so that if anyone needed a py2-only feature they could still use it. This required us to make extensive use of thesixmodule for improved compatibility. Now, however, thesixmodule is no longer included in pythonista3, so someone would have to rewrite all that code again.Anyway, we could simply fix the
impproblem, but until someone removessix(or, preferably,sixwould be included in pythonista again) it wouldn't actually fix anything. That would likely involve dropping py2 support, which in turn should involve a change in the update strategy (see https://github.com/ywangd/stash/pull/463#issuecomment-1407885936).
I got you. Btw, there also pip not works if I replace imp with importlib. I think we able to use original pip, as it already done in pipTerminal
@bennr01 Do we can take six from pip/github? Looks like sources are there and we able to download it for stash
I have pyterminal original pip 25 installed with pipTerminal and then six installed with this pip, but there issuess with cli arguments handling in stash
Use this to install modern pip https://github.com/CrossDarkrix/Pythonista3_pip_Configration_Tool
I used pipTerminal v2.0.8 with lib2to3 requirements commented
I thought the Beta had a built in way to install third party modules. That would make StaSH unnecessary.
I thought the Beta had a built in way to install third party modules. That would make StaSH unnecessary.
In my opinion, either this should support regular pip, or given the lack of venv support, there should be support for resolvers like in poetry or uv, which would guarantee full compatibility of all installed modules with each other.
Apple Security Guidelines only allow users to install pure Python modules, so equivalence with Poetry/uv is not going to happen.
We need a PR that removes the six dependency because lib2to3 was deprecated in Python 3.11 and removed in 3.13.
- https://docs.python.org/3/whatsnew/3.13.html
Python 2 died 2042 days ago on 1/1/2020, so removing support for it is not controversial.
We need a PR that removes the
sixdependency becauselib2to3was deprecated in Python 3.11 and removed in 3.13.
- https://docs.python.org/3/whatsnew/3.13.html
Python 2 died 2042 days ago on 1/1/2020, so removing support for it is not controversial.
Agreed, but we need sollution to manage packages anyway
We need a PR that removes the
sixdependency becauselib2to3was deprecated in Python 3.11 and removed in 3.13.
- https://docs.python.org/3/whatsnew/3.13.html
Python 2 died 2042 days ago on 1/1/2020, so removing support for it is not controversial.
so, six is just single file module, I mean it simply can be added inside stash. Also I started revisiting stash sources, that's not looks too hard to update, possibly I will do it
Six requires lib2to3 which was removed in Python >= 3.13.
Six requires lib2to3 which was removed in Python >= 3.13.
Seem like six on pypi not require it. I'll check it again tooday soon.
Second one thing, I can replace stash/bin/pip.py (current does not work). With the bind to common pip, and add pip installation from pypa bootstrap to get-stash (it simple as f*uck), so after stash installation we will have at least common pip installed to site-packages (user) and binding in bin/. I already tested it and it works pretty fine. And it allow pip install --upgrade pip
Lots of stash tools are not require six or lib2to3. So it can be replaced simply. Other tools I can try to update to use common modern requirements instead of deprecated.
@cclauss @bennr01 I just started
- #524
@cclauss I understand that it is difficult to review such a massive PR
After this PR I will add separate small PRs with refactoring, as a lot of code requires removal of obsolete fragments and optimization
This PR is great because stash is very connected and many modules depend on each other