syncing Pythonista / laptop
I've seen a few methods here in the forums for keeping things in-sync between the phone and "other" device.
I am wondering if anyone has hacked a way to make it work effectively?
WebIDE - closest I have to a working solution, except as good as CodeMirror is, it can't compete with PyCharm.
I made some changes to it so I can optionally run the script in question using threading and runpy.
If I spend more time on it I am sure I can make it a bit closer
Many sync programs, even a simple ssh sync one I wrote to work with my macbook, but requires an extra step to work.
I have a comfortable structure on my laptop, and messy symbolic links relying on a cloud provider like dropbox isn't solid
Same problem as above, and its super annoying to to do commits before you are ready, and it clogs your history, not great if you want to preserve the history for an open source app (which is my plan)
The biggest issues:
test driven development is difficult with any of the above scenarios - the WebIDE concept could work if I either write a plugin (not a java guy).. or
The fact that the ios libs are not available on the laptop.
Using the pythonista kit - not until Python 3 is ready, I am personally moving away from using Python 2 even if it is faster, or just as capable.
Taking a note from PyCharm's ability to run remote interpreters - this would be ideal!
I am just not sure how I can go about it, since Pythonista doesn't offer a real pty, using ipython to embed isn't possible.
Does anyone have better thoughts? or had anyone hacked a working remote interpreter?
Okay, rant over, but if anyone has found a working solution please let me know.
The full keyboard and better screen real estate, atop an IDE which I have become accustomed, would make my life way easier.
For instance - as I am developing the aforementioned modal class, I had to test numerous ideas on maintaining the current UI state, moving code around on the phone is more cumbersome.
Either way- any tips/tricks would be grand!
I really don't do any Python development off my iPad or iPhone really as most of the things I work on require the UI module in Pythonista. I thought I would share how I keep sync'd up.
I use git, if you are worried about commit history you could try developing on separate branch (which also has other benefits), and then submitting a pull request if you are using GitHub and squash all your commits when you are ready to merge it back in to your main branch (not that I do this but I am pretty sure it is possible).
If you have Working Copy and the new Beta of Pythonista this allows for opening from external files which makes using Working Copy a lot easier now otherwise there are scripts that help interact with working copy if you don't.
This is how I keep things sync'd up anyway, it doesn't really help with having a remote interpreter though.
I will try working copy, I wish i saw it before buying Clone which as of this writing doesn't work with local files.
I am not on the beta yet either.
Its food for thought - I won't squash my commits because that is a lot of work, as my intention is to ensure have a clear history for the project.
Thanks though- Working Copy might just be what I need, at least it avoids the stash client.
Maybe ill just keep the ftpd up on my phone while developing and script it to sync often.
If you haven't seen this it is Pythonista interacting with working copy in the new beta.
I also took another approach: write a socket program, define some bytes to request files, checksums etc. something to send files, to receive files, and run the script on pc and pythonista device. add a dict to store timestamp and md5 +pickle to save to file.
This way I ‚sync‘ files between iphone and Pc and can work on both.
Only important thing: whenever you change code, run a sync before changing it on the other device as well. If both timestamps differ and md5 differs then sync creates a file version of your own and one of the remote file.
Then just add that folder on your pc to your preferred version control and do the backup/committa there.