Edgewall Software

Changes between Initial Version and Version 1 of TracDev/DevelopmentWithEclipseAndPyDev


Ignore:
Timestamp:
Jul 8, 2008, 5:36:08 AM (16 years ago)
Author:
jtiai
Comment:

initial version.

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/DevelopmentWithEclipseAndPyDev

    v1 v1  
     1= How to develop Trac with Eclipse PyDev =
     2
     3== Installation ==
     4
     5Install Eclipse (3.3 or newer will do) and pydev. Also either subclipse or subversive is good to have.
     6
     71. Install prerequisities, at least Genshi
     8{{{
     9$ easy_install genshi
     10}}}
     11
     122. You can check out the trac sources inside eclipse using either the subclipse or the subversive plugin.
     13
     143. Then build the setuptools info file from the command line
     15{{{
     16$ set PYTHONPATH=c:\path\to\your\trac\sources
     17$ python setup.py egg_info
     18}}}
     19
     204. Create a trac environment, e.g.
     21{{{
     22$ trac-admin /path/to/myproject initenv
     23}}}
     24
     25This is of course a bit tricky if you don't have trac installed in system so workflow is a bit different:
     26{{{
     27$ set PYTHONPATH=c:\path\to\your\trac\sources
     28$ python
     29>>> import trac.admin.console
     30>>> trac.admin.console.run(['/path/to/myproject', 'initenv'])
     31}}}
     32
     335. In Eclipse, make sure that the PYTHONPATH in the project properties dialog includes the sources for trac.
     34
     356. Create an initial run configuration by clicking right on ''trac/web/standalone.py file'', and choosing ''Run As->Python Run''.
     36trac will complain that no environment has been set.
     37
     387. Select ''Run->Open Run Dialog...'' and set the correct command line arguments in the ''arguments'' tab, eg.
     39''--port 8000 /path/to/myproject''
     40(Note 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. Does someone has a clue?)
     41
     428. 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''
     43
     449. To debug a plugin, deploy it into your test environment via {{{ $ python setup.py develop -md /path/to/projenv/plugins }}} and then start the run configuration from above.
     45
     46If you are experiencing troubles in debugging Trac code, make sure that PYTHONPATH in project properties doesn't contain pointers to other Trac sources. Otherwise those sources will be picked instead checked out.
     47
     48== Thanks ==
     49
     50Originally these instructions were posted on trac-dev list by Stanley Williams.