Changes between Version 36 and Version 37 of TracDev/DevelopmentEnvironmentSetup
- Timestamp:
- Jan 28, 2015, 12:09:07 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracDev/DevelopmentEnvironmentSetup
v36 v37 1 1 [[PageOutline(2-5,Contents,pullout)]] 2 = Developer setup for Trac =2 = Developer setup for Trac 3 3 4 == Where to go for more information == 5 It is also a good idea to review a couple of documents before attempting to install a development environment or even to install from the trunk. One such place 6 (currently) is to review the [/roadmap milestones] page(s) to see if there are any specific requirements for the version you are setting up. 4 == Where to go for more information 7 5 8 Specifically, for version 0.12 and later, you need to use Genshi 0.6 or later. See milestone:0.12 for more information. 6 Review a couple of documents before attempting to install a development environment or even to install from the trunk. One such place is the [/roadmap milestones] pages to see if there are any specific requirements for the version you are setting up. 7 8 Specifically, for Trac 0.12+, you need Genshi 0.6 or later. See milestone:0.12 for more information. 9 9 10 10 The (automated) tests will require additional packages that may or may not be installed with your OS/Python distribution. … … 12 12 * For the functional test, please review [../FunctionalTests] 13 13 14 == Installing the development tools == 15 Before we begin to develop in Trac, or even download Trac code, first create a standalone environment. 14 == Installing the development tools 16 15 17 === Create a working directory === 18 No matter my operating system, I like to create a projects or working directory for my development efforts. So for example on some systems, I might have: 16 Before we begin to develop in Trac, or even download Trac code, create a standalone environment. 17 18 === Create a working directory 19 20 Create a projects or working directory for your development efforts. So for example on some systems, you might have: 19 21 {{{ 20 22 /Users/myname/projects 21 23 }}} 22 On Windows Iwould have:24 On Windows you would have: 23 25 {{{ 24 c:\projects26 C:\projects 25 27 }}} 26 28 27 '''Note:''' I don't create a directory called 'trac' yet. That comes later! In the meantime, `cd` (change directory) into your projects directory.29 '''Note:''' Don't create a directory called 'trac' yet. That comes later. 28 30 29 === Get Subversion === 30 This tutorial assumes you have SVN installed. If you don't have SVN installed please go to the [http://subversion.apache.org/ Subversion] website and follow the directions of installation there. 31 === Get Subversion 31 32 32 === Get Python === 33 This tutorial assumes you have Subversion (SVN) installed. If not, go to the [http://subversion.apache.org/ Subversion] website and follow the directions of installation there. 33 34 34 On Linux, in most cases it is best to install Python using the package manager for your distribution. For example, on a distribution utilizing the Apt package manager (Debian, Ubuntu): 35 === Get Python 36 37 On Linux, it is in most cases best to install Python using the package manager for your distribution. For example, on a distribution utilizing the Apt package manager (Debian, Ubuntu): 35 38 {{{ 36 39 sudo apt-get install python2.6 … … 44 47 On Windows, some of the available options are: 45 48 * The official Python distribution from [http://www.python.org/download/ python.org]. 46 * ActiveState [http://www.activestate.com/activepython/ ActivePython]49 * The commercial [http://www.activestate.com/activepython/ ActivePython] from ActiveState. 47 50 48 51 Mac OS X 10.5 and later has Python >= 2.5 pre-installed. 49 52 50 === Get easy_install === 51 You may already have `easy_install` if you have "setuptools" installed. Just make sure its version is >= 0.6c10. Previous versions do not work correctly with SVN 1.6. 53 === Get easy_install 52 54 53 Otherwise 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] (for Python 2.4 and 2.5 read Section [https://pypi.python.org/pypi/setuptools#python-2-4-and-python-2-5-support Python 2.4 and Python 2.5 support]), save it as `ez_setup.py` on your hard drive, then from the command-line prompt type: 55 You will have `easy_install` if you have "setuptools" installed. Just make sure its version is >= 0.6c10. Previous versions do not work correctly with SVN 1.6. 56 57 Otherwise 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]. For Python 2.4 and 2.5 read Section [https://pypi.python.org/pypi/setuptools#python-2-4-and-python-2-5-support Python 2.4 and Python 2.5 support], save it as `ez_setup.py` on your hard drive, then from the command-line prompt type: 54 58 {{{ 55 59 python ez_setup.py 56 60 }}} 57 61 58 To test if the installation was successful , try typing from command-line prompt:62 To test if the installation was successful: 59 63 {{{ 60 64 easy_install --help 61 65 }}} 62 66 63 === Get virtualenv === 67 === Get virtualenv 68 64 69 From the command-line prompt type: 65 70 {{{ … … 68 73 On Linux you may need to prepend `python` with `sudo`. 69 74 70 === Set up a virtual environment === 75 === Set up a virtual environment 76 71 77 From the command-line prompt type: 72 78 {{{ … … 82 88 }}} 83 89 84 If you have Trac installed in `/usr/lib` or `/usr/local/lib`, make sure torun the above virtualenv command with `--no-site-packages`.90 If you have Trac installed in `/usr/lib` or `/usr/local/lib`, run the above virtualenv command with `--no-site-packages`. 85 91 86 92 You'll see your command-line prompt has changed. That means our environment is ready for Trac. 87 93 88 === Upgrade Setuptools === 89 Just to be sure you have a recent enough version of setuptools, and if not you should try to upgrade them (this was necessary on Ubuntu 10.04 Beta). For more options on upgrading packages with `easy_install` see [http://peak.telecommunity.com/DevCenter/EasyInstall#upgrading-a-package upgrading a package]. 94 === Upgrade Setuptools 95 96 Just to be sure you have a recent enough version of setuptools, and if not, you should upgrade them. For more options on upgrading packages with `easy_install` see [http://peak.telecommunity.com/DevCenter/EasyInstall#upgrading-a-package upgrading a package]: 90 97 {{{ 91 98 easy_install --upgrade setuptools 92 99 }}} 93 100 94 == Developing with Eclipse and !PyDev == 95 If you planning to develop using Eclipse you should also read the [TracDev/DevelopmentWithEclipseAndPyDev Development with Eclipse and PyDev] page, after installing and configuring Trac in the next section. 101 == Developing with Eclipse and !PyDev 96 102 97 == Installing and configuring Trac == 103 If you are planning to develop using Eclipse, you should also read the [TracDev/DevelopmentWithEclipseAndPyDev Development with Eclipse and PyDev] page, after installing and configuring Trac in the next section. 104 105 == Installing and configuring Trac 98 106 99 === Downloading Trac ===107 === Downloading Trac 100 108 101 You should get the Trac source code from one of the TracRepositories. 102 103 For example, for Subversion (from the command-line prompt): 109 You should get the Trac source code from one of the TracRepositories. For example, for Subversion from the command-line prompt: 104 110 {{{ 105 111 svn co http://svn.edgewall.org/repos/trac/trunk/ trac-trunk … … 112 118 }}} 113 119 114 === Creating your test Trac environment === 120 === Creating your test Trac environment 121 115 122 From the command-line prompt: 116 123 {{{ … … 119 126 '''Note:''' Press return for every option. 120 127 121 === Make anonymous users have full access === 128 === Make anonymous users have full access 129 122 130 {{{ 123 131 trac-admin test permission add anonymous TRAC_ADMIN … … 125 133 '''Note:''' Don't do this in production! 126 134 127 === Installing the [th:TracDeveloperPlugin] (optional) === 135 === Installing the [th:TracDeveloperPlugin] (optional) 136 128 137 From the command-line prompt: 129 138 {{{ … … 135 144 }}} 136 145 137 === Starting trac in development mode ===146 === Starting trac in development mode 138 147 139 148 From the command-line prompt: … … 150 159 }}} 151 160 152 === Debugging Plugins === 161 === Debugging Plugins 162 153 163 To debug a plugin, install it into your test environment using the command: 154 164 {{{ … … 157 167 If 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 of the checked out sources. 158 168 159 === Web stuff === 160 Switch to your browser and go to this URL: 169 === Web stuff 161 170 162 http://127.0.0.1:8000/test171 Switch to your browser and go to `http://127.0.0.1:8000/test` 163 172 164 Now lets follow a few more steps 165 173 Now do the following: 166 174 * Go to web admin 167 * Hit the admin link168 * Logging175 * Click on Admin 176 * Set logging: 169 177 - Set type to `console` 170 178 - Set level to `debug` 171 179 172 === Alternative frontends === 180 === Alternative frontends 181 173 182 To develop on Trac with Apache rather than the standalone `tracd`, see the [TracDev/AlternativeFrontends alternative frontends] page for information on using Apache with mod_python and mod_wsgi.