Skip to content
This repository has been archived by the owner on Aug 13, 2020. It is now read-only.

Pull Requests Guide

Harald Gustafsson edited this page Apr 13, 2016 · 2 revisions

Branches

Most of the development is done towards the develop branch and hence we prefer to get pull request to that branch. The master branch is updated at each new release from the develop branch. For most of the time the develop branch is as stable as the master branch, it might even contain bug fixes that you need. The master branch is mainly for testing a new calvin script with mostly existing actors.

Calvinsys or (south) plugin contributions

If they depends on new requirements, we would prefer to have them in a separate requirements-<feature>.txt file to not make the base calvin installation need to install all dependencies. Also make sure that the calvinsys or plugins module handles missing dependencies nicely. When runtime loads calvinsys modules that fails during initiation it automatically exclude them. Hence, it is good to fail during loading of calvinsys module and not later when it is used.

Make sure that no long running functions, e.g. requests.post, calls is made in the main loop of Calvin. Instead try to use a similar approach as is done for the calvinsys.network.httpclienthandler and corresponding runtime south plugin. If using external libraries that are blocking for longer periods, then they need to be called from a seperate thread context.

Actors

Try to not use imports (besides Actor etc) directly in actor, instead use (new) calvinsys-APIs and the requires attribute. This is since one end goal of Calvin is to allow minimal installs of python (think microcontrollers and micropython) with only a very small set of dependencies installed. We need to have an automatic way of finding if an actor can execute on a certain runtime.

Make sure that actors have no long running actions, e.g. never call sleep use a timer to trigger activity instead. Currently the runtime will warn if an action runs for longer than 200 ms, this is really an upper limit since all other activity will be delayed during this period.