nadavr
Posts: 4
Joined: Tue Mar 27, 2018 7:42 am

Source control and development "ecosystem"

Tue Mar 27, 2018 7:56 am

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!

ghans
Posts: 7788
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Source control and development "ecosystem"

Tue Mar 27, 2018 8:59 am

Buy PyCharm ?

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

B.Goode
Posts: 6363
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Source control and development "ecosystem"

Tue Mar 27, 2018 9:12 am

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... )

jahboater
Posts: 2858
Joined: Wed Feb 04, 2015 6:38 pm

Re: Source control and development "ecosystem"

Tue Mar 27, 2018 9:17 am

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.

B.Goode
Posts: 6363
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Source control and development "ecosystem"

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

nadavr
Posts: 4
Joined: Tue Mar 27, 2018 7:42 am

Re: Source control and development "ecosystem"

Tue Mar 27, 2018 10:15 am

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..

nadavr
Posts: 4
Joined: Tue Mar 27, 2018 7:42 am

Re: Source control and development "ecosystem"

Tue Mar 27, 2018 10:18 am

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

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20285
Joined: Sat Jul 30, 2011 7:41 pm

Re: Source control and development "ecosystem"

Tue Mar 27, 2018 10:41 am

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.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

B.Goode
Posts: 6363
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Source control and development "ecosystem"

Tue Mar 27, 2018 10:45 am

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.

nadavr
Posts: 4
Joined: Tue Mar 27, 2018 7:42 am

Re: Source control and development "ecosystem"

Tue Mar 27, 2018 11:48 am

@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.

B.Goode
Posts: 6363
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Source control and development "ecosystem"

Tue Mar 27, 2018 12:59 pm

I have nothing further to contribute.

User avatar
DougieLawson
Posts: 33631
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Source control and development "ecosystem"

Tue Mar 27, 2018 11:13 pm

I use gitolite with gitweb, that gives me a collection of private git repos that work a bit like github.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

Heater
Posts: 9722
Joined: Tue Jul 17, 2012 3:02 pm

Re: Source control and development "ecosystem"

Wed Mar 28, 2018 8:02 am

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.

PingoBags
Posts: 47
Joined: Mon Nov 06, 2017 10:53 pm
Location: NS, Canada

Re: Source control and development "ecosystem"

Mon Apr 02, 2018 6:52 pm

I personally use Renci ssh.net. I made a simple windows app to upload and run my scripts.

Return to “General programming discussion”

Who is online

Users browsing this forum: No registered users and 4 guests