Skip to content
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

Remote development workflow needs some serious TLC #691

Open
logicbomb421 opened this issue Mar 10, 2023 · 4 comments
Open

Remote development workflow needs some serious TLC #691

logicbomb421 opened this issue Mar 10, 2023 · 4 comments

Comments

@logicbomb421
Copy link

logicbomb421 commented Mar 10, 2023

First, I know this app is designed to allow one to build apps/scripts in python on our devices, however, for larger apps, developing the bulk of the code remotely (e.g. on a laptop) is very much preferred.

I have spent quite a bit of time trying to learn how others accomplish this, and it seems to be based around another app called Working Copy. To bootstrap remote dev, the following is performed:

  1. Install Working Copy
  2. Clone desired remote repo
  3. In Pythonista, open the WC repo via the following process:
    a. In the "External Files" section of the main menu, tap "Open"
    b. Select "Folder"
    c. Choose the Working Copy "location"
    d. Pick the desired repo

Once this has been done, the files from WC will now be present and editible in Pythonista. From here, a single development iteration looks like:

  1. Develop code on remote system (no testing possible since the Pythonista builtin modules are not present)
  2. Commit and push change to repo
  3. Open WC on your device
  4. Pull latest changes
  5. Open Pythonista
  6. Run app/script
  7. Close Pythonista entirely (or run into weird "conflicts" in WC when trying to perform step 4 next, even though nothing was changed in the app)

This has to happen every time one wishes to test a change in Pythonista.

I'm sure many of us would like to iterate on a program as fast as possible, and get real-time feedback about what we're building without needing to run the above process every time. I know I would.

There are three things I believe would help support this process, in order of least to most complicated:

  1. Solve the issue in step 7 above. Many times now, I have simply run the program I just synced from WC (without any editing), only for WC to tell me there is a change pending the next time I open the repo. It appears Pythonista assumes it maintains the source-of-truth for external files, and recently pulled updates in WC will be overwritten with the previous version if Pythonista is left running.
  2. Natively support git repositories for code source. There are various ways to accomplish this, but not needing to rely on interaction with an external app to make this work would be very nice.
  3. Allow simulation of Pythonista builtin modules on *nix systems. This one gets complicated very quickly since most of these modules interact with iOS-native controls and libraries, however, it does appear many could be simulated using *nix system calls or dependencies (e.g. canvas, cb, clipboard, sound). Alternatively, there might be a way to speak to the app directly via LLDB when running the remote simulator to allow for any iOS-specific calls to actually run on the device in question. I haven't tried using a remote debugger on a published iOS app before, so I'm not actually sure if this is possible.

For #3 above, at a minimum, being able to run a UI designer and preview app on a remote device like a laptop would be amazing. I very much like Pythonista for prototyping simple apps when I don't feel like busting out Xcode. It would be extremely helpful to be able to see real-time what my code-based UI would look like (even if it can't be interacted with), and it would also be pretty nice to be able to use something similar to the Pythonista UI builder to generate pyui files.

If there is interest in this, I'd love to discuss things in more detail (or hell, even help implement them!).

Thanks for an awesome app!


It's definitely possible I've missed something that would really help with the above issues. If anyone reads this and knows of a better way of doing this, please leave a comment!

@logicbomb421 logicbomb421 changed the title Remote development workflow needs some _serious_ TLC Remote development workflow needs some serious TLC Mar 10, 2023
@cclauss
Copy link
Contributor

cclauss commented Mar 10, 2023

Way out of date but... https://github.com/cclauss/Pythonista-and-Working-Copy

@logicbomb421
Copy link
Author

@cclauss Thanks! I actually have that open in another tab right now!

This seems to be the only way to use external repos as shortcuts since the deep link expects to be in the local/iCloud root, so definitely helpful.

@cclauss
Copy link
Contributor

cclauss commented Mar 11, 2023

@palmin Do you have any comments/suggestions on this issue? Do you have access to the current Pythonista beta version? Thanks massively for Working Copy which continues to make us productive!

@palmin
Copy link

palmin commented Mar 11, 2023

I have access to the Pythonista TestFlight but am not using Pythonista in my daily work. When trying I don’t need to close Pythonista before pulling down changes in Working Copy to avoid getting conflicts.

Close Pythonista entirely (or run into weird "conflicts" in WC when trying to perform step 4 next, even though nothing was changed in the app)

You are very welcome to e-mail me at anders@workingcopy.app with specifics about this problem.

Note that Working Copy is able to manage repositories in iCloud Drive which should make it possible to keep your python stuff in the regular documents folder for Pythonista while still having Git support:
https://workingcopy.app/manual/external-repos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants