Skip to content

Developer guide

Almar Klein edited this page Sep 14, 2016 · 4 revisions

Developer guide

Focus

  • We target Python 3 (and provide 2.7 support via a translation step)
  • We also support Pypy (and maybe Jython?)
  • Subpackages don't get imported unless needed
  • Subpackages should be as independent as possible
  • Subpackages can rely on zoof.util, via from ..util.x import y

Issues and pull requests

Each issue must have a type label and optionally some tag labels if they apply. Any issue other than type: discussion and type: question must have a milestone.

For PR's there are special PR status labels (ready, paused, WIP) to allow the owner of the PR to clearly signal its status. A PR must be "ready" before being merged. If a PR is directly associated with an issue, it does not need any labels (other than perhaps the PR labels). If a PR is standalone, the same rules as for the issues apply.

Each issue and each PR should have a milestone (for PR's its more of a "this code change is part of release x").

Topical

  • Properties where they make sense.
  • Methods should have a verb as the first word
  • Avoid meta classes and other overly-fancy features where possible
  • Docstrings in google format

Style

  • Use a modern Python 3 syntax (e.g. super().__init__())
  • We use flake8 with a few exceptions, most notably, we don't care too much about whitespace errors.
  • ClassName.property_name

Exceptions

  • Exceptions should be useful. If possible include a hint on how to fix the problem.
  • Exceptions related to Model or Widget classes should mention the model id self.id.