Guide to get a basic development environment

Yep. But if we want to integrate this guide in another web page accesible from a link on “Make your modification” text in Tryton - How to Develop web page section we’ve to take account the previous step (tryton-env clone).

Other way we can do that as you say if delete “cd” command from the guide and https://codereview.tryton.org/249431003/

Oks

Oks

The goal of this guide is to be the simplest guide so with these steps you don’t need to create any trytond.conf file

I agree Sergi. It will be good to have it as an example in that section as an example of database to use with tests.

Then you can use TRYTOND_WEB__ROOT environment variable.
But I find that it is much more simpler to have a minimal configuration file that can be used for any clone (clone branch) and anywhere.

1 Like

Could it be an option to set the default value for the web root in the config to “sao” like you are using it? The current default value does not seem to be a good choice for me.

The default is the proper value when trytond is installed.
A random relative path could become a security issue.

(virtual_env) $ trytond/bin/trytond-admin -d test_db -u ir res -v

Atfer that, ¿which is the correct way to see from the Tryton Client the modules downloaded? I execute

(virtual_env) $ .hooks/link_modules

but I’m not sure if this is the right way: The README file says that you have to add a hook section in .hg/hgrc file but I don’t see how to deal with this… ¿It must be done after the hg clone? ¿And after that?

  1. hg clone
  2. edit .hg/hgrc as README indicates
  3. hg update create for you the necessary symlinks to tryton cloned modules

Next you can initialize the database and interact with modules from tryton client as usual.

Ok, so now you have made some changes and want to submit those changes to be reviewed and ultimately accepted. You download the upload.py script and execute it as stated on Tryton - How to Develop. But you get the error

Usage: upload.py [options] [-- diff_options] [path…]
See also: upload.py Usage · rietveld-codereview/rietveld Wiki · GitHub

upload.py: error: --oauth2_port option requires an argument

That wiki page isn’t very helpfull. So what needs to be done?

Check it this way:

$ python2 ~/.local/bin/upload.py --oauth2

As is indicate here although it has errata, you must use python2.

But that one will be fixed soon when this review has been approved (although I have to put a little more work from my side to improve it…)

--oauth2 option is no more required. So I removed from the documentation www.tryton.org: 6c2f29f08656

Ok. And… Is it still necessary to use python2 or is python3 compatible?

Not yet, see need a python3 upload.py · Issue #247 · rietveld-codereview/rietveld · GitHub

I’m on Fedora 30 which has default python2. I did now a

python ~/.local/bin/upload.py 

And had wait a bit, you don’t get instant reaction. Be aware of that because I already hit < CTRL> + C to stop the script.
But now I got the question:

New issue subject:

What do I have to fill in? I have already filed an enhancement-bug what should I answer? The issue number or the issue subject? Also which more questions are going to be asked and what should I answer with? Maybe the section “Submit a Change” on the website can be more detailed about that?

P.S. I’m sorry but I want to do it right and also hope with this exercise to lower the barrier on how to start development.

1 Like

You should use the following as subject:

repository: title

Where repository is the name of the repo your patch applies to (normally trytond, tryton or the name of the module) and title is the description of the change that you are submitting and that will be used as commit message.

Let’s take an example. I have filed Extend format_date function to allow a format other then the default (#8444) · Issues · Tryton / Tryton · GitLab. I made the changes locally on my Tryton development system and want to submit them to be accepted. I started upload.py and it asks for

New issue subject:

So the answer to that question will be

trytond: Extend format_date function to allow a format other then the default

Am I right?

I think so. Repository name: Title of the review.

So I added

trytond: Extend format_date function to allow a format other then the default

And my webbrowser opens up an new tab because I had to login into my google account. After I did that, the changes were successfully uploaded to the codereview.

So I think that you have to mention on the website that you have to have a google-account in order to upload patches.
Also when is an entry needed for the Changelog?

Really I guess you have to have some account oauth2 compatible (not only google)

Currently a google account is required as we are hosting our codereview instance on google app engine. There is Being less Google dependent (#2177) · Issues · Tryton / Tryton · GitLab in order to improve it but is still unresolved.

I’m working on a new patch for review and testing the improved guide before upload it I get requirements.txt and requirements-dev. txt files created :slightly_smiling_face: but not the trytond modules symlinks…

Any thoughts??