Edgewall Software

Changes between Version 6 and Version 7 of TracDev/DevelopmentWithEclipseAndPyDev


Ignore:
Timestamp:
Aug 2, 2008, 8:11:47 PM (16 years ago)
Author:
Piotr Kuczynski <piotr.kuczynski@…>
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/DevelopmentWithEclipseAndPyDev

    v6 v7  
    1 = How to develop Trac with Eclipse PyDev =
     1= How to develop Trac with Eclipse !PyDev =
    22
    3 == Installation ==
     3== Python Installation ==
    44
    5 Install [http://www.eclipse.org Eclipse] (3.3 or newer will do) and [http://pydev.sourceforge.net PyDev]. Also either [http://subclipse.tigris.org Subclipse] or [http://www.eclipse.org/subversive/ Subversive] is good to have for integrated support to SVN.
     51. Download and install latest [http://www.python.org/download/ Python]
    66
    7 1. Install prerequisities, at least Genshi
     72. Get easy_install
     8Go to [http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install installing-easy-install] and follow the instructions there.  However, most of the time you just take the text at [http://peak.telecommunity.com/dist/ez_setup.py ez_setup.py], save it as ez_setup.py on your hard drive, then from the command-line prompt type:
     9{{{
     10python ez_setup.py
     11}}}
     12
     133. Install Genshi
    814{{{
    915$ easy_install genshi
    1016}}}
    1117
    12 2. You can check out the trac sources inside eclipse using either the subclipse or the subversive plugin.
     18== Installing and configuring Trac ==
    1319
    14 3. Then build the setuptools info file from the command line
     20=== Downloading trac ===
     21From the command-line prompt:
     22{{{
     23svn co http://svn.edgewall.org/repos/trac/trunk/ trac-trunk
     24svn co http://svn.edgewall.org/repos/genshi/trunk/ genshi-trunk
     25cd trac-trunk
     26python setup.py develop
     27cd ../genshi-trunk
     28python setup.py develop
     29cd ..
     30}}}
     31
     32=== Setuptools ===
     33
     34Then build the setuptools info file from the command line
    1535{{{
    1636$ set PYTHONPATH=c:\path\to\your\trac\sources
    1737$ python setup.py egg_info
    18 }}}
    19 
    20 4. Create a trac environment, e.g.
    21 {{{
    22 $ trac-admin /path/to/myproject initenv
    2338}}}
    2439
     
    3146}}}
    3247
    33 5. In Eclipse, make sure that the PYTHONPATH in the project properties dialog includes the sources for trac.
    3448
    35 6. Create an initial run configuration by clicking right on ''trac/web/standalone.py file'', and choosing ''Run As->Python Run''.
     49=== Creating your test trac environment ===
     50From the command-line prompt:
     51{{{
     52trac-admin /path/to/myproject initenv
     53}}}
     54'''note:''' Press return for every option.
     55
     56== Installing and configuring Eclipse ==
     57
     58 1. Install [http://www.eclipse.org Eclipse] (3.3 or newer will do)
     59 2. Install [http://pydev.sourceforge.net PyDev]
     60 3. Also either [http://subclipse.tigris.org Subclipse] or [http://www.eclipse.org/subversive/ Subversive] is good to have for integrated support to SVN.
     61
     62 4. In Eclipse, make sure that the PYTHONPATH in the project properties dialog includes the sources for trac.
     63
     64 5. Create an initial run configuration by clicking right on ''trac/web/standalone.py file'', and choosing ''Run As->Python Run''.
    3665trac will complain that no environment has been set.
    3766
    38 7. Select ''Run->Open Run Dialog...'' and set the correct command line arguments in the ''arguments'' tab, eg.
     67 6. Select ''Run->Open Run Dialog...'' and set the correct command line arguments in the ''arguments'' tab, eg.
    3968''--port 8000 /path/to/myproject''[[BR]]
    4069Note that the option --auto-reload will cause tracd to restart every time source code has been changed, but it seems to prevent debugging with pydev. This seems to have something to do way Trac reloads new instance as a child thread using "thread" library which doesn't seem to be compatible with pydev debugging. Googling revelead some hints that instead using "thread"-module you should use "threading"-module (higherlevel)
    4170
    42 8. You should now be able to run tracd, as well as to debug it using the same run configuration. To run the test cases, just click on a test folder and select ''Run->Python unit tests''
     71 7. You should now be able to run tracd, as well as to debug it using the same run configuration. To run the test cases, just click on a test folder and select ''Run->Python unit tests''
    4372
    44 9. To debug a plugin, deploy it into your test environment via
     73 8. To debug a plugin, deploy it into your test environment via
    4574{{{
    4675$ python setup.py develop -md /path/to/projenv/plugins
     
    5685If you want to setup automatic translation compilation it can be done very easily.
    5786
    58 1. Right click on trac project and select ''Properties''. Select ''Builders''. Click ''New''. Select ''Program''.
     87 1. Right click on trac project and select ''Properties''. Select ''Builders''. Click ''New''. Select ''Program''.
    5988
    60 2. Name builder, like 'Locale fi_FI builder'
     89 2. Name builder, like 'Locale fi_FI builder'
    6190
    62 3. ''Main'' tab:
     91 3. ''Main'' tab:
    6392 ''Location'': click ''Browse File System...''. Select Python executable.[[BR]]
    6493 ''Working Directory'': set it to ''${project_loc}''[[BR]]
    6594 ''Arguments'': ''setup.py compile_catalog -f -l fi_FI'' (change to your locale)[[BR]]
    6695
    67 4. ''Refresh'' tab:
     96 4. ''Refresh'' tab:
    6897 Check ''Refresh resources upon completion''.[[BR]]
    6998 Select ''Spesific resources'' and select ''trac/locale/fi_FI'' (select your locale)[[BR]]
    7099
    71 5. ''Build Options'' tab:
     100 5. ''Build Options'' tab:
    72101 Check ''During auto builds''.[[BR]]
    73102 Check ''Specify working set of relevan resources''.[[BR]]
     
    75104 Name it like ''fi_FI locale''.[[BR]]
    76105
    77 6. After modifying your message.po file you should get following output:
     106 6. After modifying your message.po file you should get following output:
    78107 {{{
    79108  running compile_catalog