Changes between Version 6 and Version 7 of TracDev/DevelopmentWithEclipseAndPyDev
- Timestamp:
- Aug 2, 2008, 8:11:47 PM (16 years ago)
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 = 2 2 3 == Installation ==3 == Python Installation == 4 4 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. 5 1. Download and install latest [http://www.python.org/download/ Python] 6 6 7 1. Install prerequisities, at least Genshi 7 2. Get easy_install 8 Go 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 {{{ 10 python ez_setup.py 11 }}} 12 13 3. Install Genshi 8 14 {{{ 9 15 $ easy_install genshi 10 16 }}} 11 17 12 2. You can check out the trac sources inside eclipse using either the subclipse or the subversive plugin. 18 == Installing and configuring Trac == 13 19 14 3. Then build the setuptools info file from the command line 20 === Downloading trac === 21 From the command-line prompt: 22 {{{ 23 svn co http://svn.edgewall.org/repos/trac/trunk/ trac-trunk 24 svn co http://svn.edgewall.org/repos/genshi/trunk/ genshi-trunk 25 cd trac-trunk 26 python setup.py develop 27 cd ../genshi-trunk 28 python setup.py develop 29 cd .. 30 }}} 31 32 === Setuptools === 33 34 Then build the setuptools info file from the command line 15 35 {{{ 16 36 $ set PYTHONPATH=c:\path\to\your\trac\sources 17 37 $ python setup.py egg_info 18 }}}19 20 4. Create a trac environment, e.g.21 {{{22 $ trac-admin /path/to/myproject initenv23 38 }}} 24 39 … … 31 46 }}} 32 47 33 5. In Eclipse, make sure that the PYTHONPATH in the project properties dialog includes the sources for trac.34 48 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 === 50 From the command-line prompt: 51 {{{ 52 trac-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''. 36 65 trac will complain that no environment has been set. 37 66 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. 39 68 ''--port 8000 /path/to/myproject''[[BR]] 40 69 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. 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) 41 70 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'' 43 72 44 9. To debug a plugin, deploy it into your test environment via73 8. To debug a plugin, deploy it into your test environment via 45 74 {{{ 46 75 $ python setup.py develop -md /path/to/projenv/plugins … … 56 85 If you want to setup automatic translation compilation it can be done very easily. 57 86 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''. 59 88 60 2. Name builder, like 'Locale fi_FI builder'89 2. Name builder, like 'Locale fi_FI builder' 61 90 62 3. ''Main'' tab:91 3. ''Main'' tab: 63 92 ''Location'': click ''Browse File System...''. Select Python executable.[[BR]] 64 93 ''Working Directory'': set it to ''${project_loc}''[[BR]] 65 94 ''Arguments'': ''setup.py compile_catalog -f -l fi_FI'' (change to your locale)[[BR]] 66 95 67 4. ''Refresh'' tab:96 4. ''Refresh'' tab: 68 97 Check ''Refresh resources upon completion''.[[BR]] 69 98 Select ''Spesific resources'' and select ''trac/locale/fi_FI'' (select your locale)[[BR]] 70 99 71 5. ''Build Options'' tab:100 5. ''Build Options'' tab: 72 101 Check ''During auto builds''.[[BR]] 73 102 Check ''Specify working set of relevan resources''.[[BR]] … … 75 104 Name it like ''fi_FI locale''.[[BR]] 76 105 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: 78 107 {{{ 79 108 running compile_catalog