{% set title = "How to Develop" %} {% set description = "How to develop for Tryton" %} {% set keywords = ["development", "mercurial", "codereview", "patch" ] %} {% set toc = [ ("Report an Issue", 'report-issue', None), ("Submit a Change", 'submit-change', [ ("Script", 'submit-change-script', None), ("Mercurial Extension", 'submit-change-hg-extension', None), ]), ("Coding Guidelines", 'coding-guidelines', [ ("Code Style", 'code-style', None), ("Best Practices", 'best-practices', None), ]), ("Requirements", 'requirements', None), ("Rules", 'rules', None), ("Publish a Change", 'publish-change', None), ("Backporting", 'backporting', None), ] %} {% extends "layout-toc.html" %} {% block content %}

{{ title }}

{{ super() }} {% endblock content %} {% block main %}

TL;DR
Clone the repository:

$ hg clone https://hg.tryton.org/tryton-env
$ cd trytond
    

Make your modification. Submit your change:

$ curl -L -o ~/.local/bin/upload.py https://codereview.tryton.org/static/upload.py
$ python ~/.local/bin/upload.py
    

Report an Issue

warning If it is a security issue, be careful to correctly set the type to security. This way, the issue will only be visible to the security team until its release.

Submit a Change

warning If it is a security issue, be careful to mark the review as protected.

Coding Guidelines

The Tryton Project strongly recommends the following guidelines.

Code Style

Python

Code style, in general, follows PEP 8:

XML

Best Practices

Naming of modules, classes, variables

Requirements

Your contribution must meet the following requirements:

Must

Nice to have, but not required

Rules

If the contributor has a significant amount of code, he can add himself to the COPYRIGHT file.

Core developers are people which have push access to the repositories. They are allowed to push small fixes without review. Bigger fixes need approval from other core developers.

In the case of disagreement, a consensus should be reached. As a last resort, the project leader (Cédric Krier) will make the decision.

Publish a Change

This part is only for core developers

warning Always keep the environment repository up to date with all the subrepos:

$ hg commit -S --cwd tryton-env

Push to the remote server:

$ hg push ssh://hg@hg.tryton.org/tryton-env
Sometimes the push is rejected because it creates a new head. This happens because your local repository is not up to date.
We prefer rebase over merge because it creates a linear history:
$ hg pull --rebase

Backporting

A fix will be back ported to older series by the maintainer on his own discretion after 1 week in the development branch. The decision is based on the importance of the bug, the availability of workaround and the feasibilities.

Those rules don't apply for security bugs which are applied at once to all affected series and followed by a release.

{% endblock main %}