Page 1 of 1

Source control and development "ecosystem"

Posted: Tue Mar 27, 2018 7:56 am
by nadavr
Hi!

I am developing python code for headless service, that runs on raspbian OS.
I find it much easier to develop on a strong machine (and IDE I am used to) and sync the code with my raspi, however it is not a seamless process.
If any of you has experience with developing raspi code from another machine i'd like to hear how it works for you.
In addition, i need to keep my code managed in git (github), what would be the best approach to manage the code in raspi ,when working from IDE running on another device.

Thanks!

Re: Source control and development "ecosystem"

Posted: Tue Mar 27, 2018 8:59 am
by ghans
Buy PyCharm ?

ghans

Re: Source control and development "ecosystem"

Posted: Tue Mar 27, 2018 9:12 am
by B.Goode
If you are already using github and a competent IDE on the development machine, one model would be to simply push your code to your github repository and then (after initially cloneing it) just pull the code into your target RPi.

(But for the scale of hobby project that I undertake this would be overkill: far simpler to work with small manageable modules directly on the RPi itself... )

Re: Source control and development "ecosystem"

Posted: Tue Mar 27, 2018 9:17 am
by jahboater
B.Goode wrote:
Tue Mar 27, 2018 9:12 am
(But for the scale of hobby project that I undertake this would be overkill: far simpler to work with small manageable modules directly on the RPi itself... )
+1
Some might consider the longer compilation times on a Pi compared to a high end x86 PC to be an issue and a reason for cross development, but of course that doesn't apply to Python.

You will almost certainly spend far more time setting all this up than simply working on the Pi itself.

There is the Thonny IDE by the way.
nadavr wrote:
Tue Mar 27, 2018 7:56 am
I find it much easier to develop on a strong machine (and IDE I am used to) a
Even an underclocked Pi Zero can easily edit Python source code!
.. and I (personally) would regard the new Pi3B+ model as a "strong" machine.

Re: Source control and development "ecosystem"

Posted: Tue Mar 27, 2018 10:09 am
by B.Goode
An alternative might be to investigate what Resin.IO can do for you.

After some initial setup you can maintain the source code in git wherever and however you wish. When you are ready to deploy (or test) it you just push it to a nominated git repository 'in the cloud' and a few seconds the revised code is executing on your target RPi.

So 'seamless' it feels like magic...

It won't necessarily suit your use-case, but it might be worth a look?

https://resin.io

Re: Source control and development "ecosystem"

Posted: Tue Mar 27, 2018 10:15 am
by nadavr
Thanks for the replies!

I am working with a few IDEs at the same time so switching to raspi for development isn't that convenient. in addition I am working on a pi zero so it lacks the horsepower needed to work smoothly. PyCharm sound like a solid choice, although it is quite expensive.. wish I could use the community edition..

Re: Source control and development "ecosystem"

Posted: Tue Mar 27, 2018 10:18 am
by nadavr
B.Goode wrote:
Tue Mar 27, 2018 10:09 am
An alternative might be to investigate what Resin.IO can do for you.

After some initial setup you can maintain the source code in git wherever and however you wish. When you are ready to deploy (or test) it you just push it to a nominated git repository 'in the cloud' and a few seconds the revised code is executing on your target RPi.

So 'seamless' it feels like magic...

It won't necessarily suit your use-case, but it might be worth a look?

https://resin.io
B.Goode, Resin.IO could be a solution if I didn't need to debug the code, however i'd like to have a fully capable IDE with debugging and (hopefully) GIT support

Re: Source control and development "ecosystem"

Posted: Tue Mar 27, 2018 10:41 am
by jamesh
Use Samba or NFS (depending on your host machine) to share drives with the Pi? That way you can build on the host machine, and have the files immediately on the Pi and vica versa.

Re: Source control and development "ecosystem"

Posted: Tue Mar 27, 2018 10:45 am
by B.Goode
I am increasingly unclear what you are looking for.

I thought the point of the ResinIO model was that it did not mandate a development platform or IDE.

If you are free to make those choices then there are many IDEs for Windows, MacOS or Linux that have strong support for Python, unit testing and integrated source code management. Atom, Brackets, PyCharm and Visual Studio Code all fit that description.

Does your RPi application involve 'Physical Computing' requiring programmatic access to the gpio pins? If so, maybe the Remote GPIO Access feature enabled by the pigpio library (and easily accessible from the gpiozero python library module) is what you need - you could run the main script on any hardware/os that runs python while accessing your target RPi via a network connection.


But I still think it is easier to work natively on the RPi itself running Raspbian. The Thonny IDE already mentioned has excellent tracing facilities for debugging - have you actually tried it? And the older IDLE IDE also has established tools for single-step debugging.

Re: Source control and development "ecosystem"

Posted: Tue Mar 27, 2018 11:48 am
by nadavr
@B.Goode, sorry for not being clear about my limitations, I am working with raspi's BLE hardware and need my code to run on the machine itself, I cannot run it locally on my machine and deploy to raspi.

Re: Source control and development "ecosystem"

Posted: Tue Mar 27, 2018 12:59 pm
by B.Goode
I have nothing further to contribute.

Re: Source control and development "ecosystem"

Posted: Tue Mar 27, 2018 11:13 pm
by DougieLawson
I use gitolite with gitweb, that gives me a collection of private git repos that work a bit like github.

Re: Source control and development "ecosystem"

Posted: Wed Mar 28, 2018 8:02 am
by Heater
I often develop code on a PC and eventually run it on a Pi or other platform.

Git helps with this very nicely. I push the code to a git repository, mostly I use github and bitbucket, then it can be fetched into the Pi with "git clone" initially and "git pull" as the code develops.

The fact that ones code needs Pi specific hardware to work is not a big deal. For development and some testing on a PC it should be easy to create mocks or stubs of the missing interface functions.

I find using git is very helpful for even small projects.

Re: Source control and development "ecosystem"

Posted: Mon Apr 02, 2018 6:52 pm
by PingoBags
I personally use Renci ssh.net. I made a simple windows app to upload and run my scripts.