= Eclipse Development Environment = The original content of this page is outdated but is kept for reference further down this page. OS:: Mac OS X Leopard Python:: 2.5.2 IDE:: Eclipse Version 3.4.1 with PyDev 1.3.22 MoinMoin:: 1.8.0rc1 We assume Python, Eclipse and Pydev are all installed. See the pydev docs for installation instructions. 1. Create a new project in Eclipse 2. Download MoinMoin and extract it into the project directory that you use in Eclipse. 3. Select wikiserver.py in the package explorer and press Cmd-F11 (Debug). 4. Insert breakpoints anywhere in the moinmoin code or in the macro you wish to debug That's it. Below is the original description that did not work for me. ---- OS:: Windows XP, Ubuntu 7.10 Python:: 2.4, 2.5 IDE:: Eclipse Version 3.2.2 with PyDev 1.2.5 MoinMoin:: 1.5.x, 1.6 == Preparing == 1. install Python 1. configure a development environment 1. install Eclipse http://www.eclipse.org/ 1. install PyDev http://pydev.sourceforge.net/ 1. define Python as interpreter >>Window >>Prefernces >>PyDev >>Interpreter - Python ||<:> '''Windows''' ||<:> '''GNU/Linux (Ubuntu 7.10)''' || || {{attachment:Preferences.png}} || {{attachment:PreferencesUbuntu.png}} || 1. create a new workspace 1. create a new project named {{{MoinMoin}}} 1. install MoinMoin, if it isn't 1. check if it run 1. import the installed MoinMoin from {{{\Python24\Lib\site-packages\MoinMoin}}} into the new project {{attachment:MoinMoinImport.png}} 1. create a new workspace named {{{Wiki}}} 1. import the installed Instanze {{{\Python24\share\moin}}} into the Wiki-project 1. coping: {{{/server/moin.py}}} to {{{moin}}} {{{/config/wikiconfig.py}}} to {{{moin}}} {{attachment:ServerConfigCopy.png}} 1. configurate {{{moin.py}}} change: {{{#!python sys.path.insert( 0, '/path/to/wikiconfig' ) }}} to: {{{#!python sys.path.insert( 0, 'DRIVE:\WORKSPACE\Wiki' ) }}} Path to {{{htdocs}}}: {{{#!python docs = '/usr/share/moin/htdocs' }}} change to: {{{#!python docs = 'DRIVE:\WORKSPACE\Wiki\htdocs' }}} Maybe change the port: {{{#!python port = 8000 }}} 1. configurate {{{wikiconfig.py}}} change {{{data_dir}}} and {{{data_underlay_dir}}} to: {{{#!python data_dir = 'DRIVE:\WORKSPACE\Wiki\data' }}} and {{{#!python data_underlay_dir = 'DRIVE:\WORKSPACE\Wiki\underlay' }}} 1. check if it run, {{{moin.py}}} right-klick, >>Run As >>Python Run 1. Now change the python-path: * right-click on the project * >>Properties * >>!PyDev - PYTHONPATH * External Source Folders * >>Add source folder * select the current workspace || (!) If you want to develop/debug the MoinMoin-Engine in your workspace, rename or delete the installed MoinMoin-Engine in {{{\Python24\Lib\site-packages\}}} || == Setup a Plugin-Project == Now, I explain, how you can develop plugins, seperated from your Instanz 1. create a new workdir named like {{{Plugin}}} 1. copy the plugin directory form your Wiki workdir in your new workdir {{attachment:PluginHirachie.bmp}} 1. add the following line to your {{{wikiconfig.py}}} {{{#!python plugin_dir = "DRIVE:/WORKSPACE/Plugin/plugin" }}} || (!) now, you can work and debug on some different plugins<
>for every new plugin, you can add the plugin_dir variable. || ''for example:'' {{{#!python #plugin_dir = "D:/Workspace/MyFirstPluginProject/plugin" plugin_dir = "D:/Workspace/MyCurrentPluginProject/plugin" #plugin_dir = "D:/Workspace/AnOldTestProject/plugin" }}} == Tools/Add-ons == === Debugging === '''!PyDev''' For debugging, you can use the build-in debugger of PyDev === Version management system === With eclipse, you can decide different add-ons for different version systems: '''Mercurial''' * Mercurial Eclipse http://www.vectrace.com/mercurialeclipse/ * There are also more info in the trac system then the static website here you can follow the development and report bugs: http://home.zingo.org/trac/mercurialeclipse '''Subversion''' /!\ Moin development does not use Subversion. * Subclipse http://subclipse.tigris.org/ * Subversive http://www.polarion.org/index.php?page=overview&project=subversive === Testing === ==== Unit-Test ==== '''pyunit''' http://pyunit.sourceforge.net/ ''' Test automation ''' {{attachment:green.jpg}} For Test-driven development you can use the Project Builder of Eclipse. Setup a new builder: * right-click on the project * >>Properties * >>Builders * click on `New...` * select `Program` * on the register `Main` you have to insert the following parameters: '''Location''' {{{ path/to/python/interpreter}}} '''Working Directory''' {{{ ${project_loc} }}} '''Arguments''' {{{ ${project_loc}/unittest/test_unittest.py }}} * on the register `Environment` you have to add a new variable: ||<:> Variable ||<:> Value || || `PYTHONPATH` || `${project_loc}` || * on the register `Build Options` you can configure how the builder have to run. ==== Browser-Test ==== Selenium http://www.openqa.org/selenium/ == Links == http://www-128.ibm.com/developerworks/opensource/library/os-ecant/ == Comments == * nice work, thanks! somebody ask me about it * maybe integrate checkout of the source with Mercurial into some workdir - currently (at work) I use SVN * see also [[http://www.vectrace.com/mercurialeclipse/|Mercurial Eclipse]] or [[http://home.zingo.org/trac/mercurialeclipse|Mercurial Eclipse Trac (more actual)]] * do not install moin to site-packages, but directly run it from the workdir for simple debugging I move/copy MoinMoin in the Eclipse-Workspace * for active development, rather use 1.6 currently I work with 1.5.x but 1.6 I think work too may be you should think on switching to 1.6 for development too. In some parts it is much easier e.g. the standalone server of DesktopEdition is integrated and you have only to run moin.py from the top level dir (it is already preconfigured). -- ReimarBauer <>