Changes between Version 38 and Version 39 of TracDev/DevelopmentEnvironmentSetup
- Timestamp:
- Jan 12, 2016, 12:44:09 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracDev/DevelopmentEnvironmentSetup
v38 v39 13 13 /Users/myname/projects 14 14 }}} 15 15 16 On Windows you would have: 16 17 {{{ … … 27 28 28 29 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): 29 {{{ 30 {{{#!sh 30 31 sudo apt-get install python2.6 31 32 }}} 32 33 33 34 You will also need some additional libraries: 34 {{{ 35 {{{#!sh 35 36 sudo apt-get install python-subversion 36 37 }}} … … 47 48 48 49 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: 49 {{{ 50 {{{#!sh 50 51 python ez_setup.py 51 52 }}} 52 53 53 54 To test if the installation was successful: 54 {{{ 55 {{{#!sh 55 56 easy_install --help 56 57 }}} … … 59 60 60 61 From the command-line prompt type: 61 {{{ 62 {{{#!sh 62 63 python -m easy_install virtualenv 63 64 }}} 65 64 66 On Linux you may need to prepend `python` with `sudo`. 65 67 … … 67 69 68 70 From the command-line prompt type: 69 {{{ 71 {{{#!sh 70 72 virtualenv trac 71 73 cd trac 72 74 source bin/activate 73 75 }}} 76 74 77 or for Windows: 75 78 {{{ … … 81 84 If you have Trac installed in `/usr/lib` or `/usr/local/lib`, run the above virtualenv command with `--no-site-packages`. 82 85 83 You'll see your command-line prompt has changed. That meansour environment is ready for Trac.86 You'll see your command-line prompt has changed. That means your environment is ready for Trac. 84 87 85 88 === Upgrade Setuptools 86 89 87 90 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]: 88 {{{ 91 {{{#!sh 89 92 easy_install --upgrade setuptools 90 93 }}} … … 96 99 == Installing and configuring Trac 97 100 98 === Download ingTrac101 === Download Trac 99 102 100 103 You should get the Trac source code from one of the TracRepositories. For example, for Subversion from the command-line prompt: 101 {{{ 104 {{{#!sh 102 105 svn co http://svn.edgewall.org/repos/trac/trunk/ trac-trunk 103 106 svn co http://svn.edgewall.org/repos/genshi/trunk/ genshi-trunk … … 109 112 }}} 110 113 111 === Creat ingyour test Trac environment114 === Create your test Trac environment 112 115 113 116 From the command-line prompt: 114 {{{ 117 {{{#!sh 115 118 trac-admin test initenv 116 119 }}} 120 117 121 '''Note:''' Press return for every option. 118 122 119 === Make anonymous users have full access123 === Grant full access to anonymous users 120 124 121 {{{ 125 {{{#!sh 122 126 trac-admin test permission add anonymous TRAC_ADMIN 123 127 }}} 128 124 129 '''Note:''' Don't do this in production! 125 130 126 === Install ingthe [th:TracDeveloperPlugin] (optional)131 === Install the [th:TracDeveloperPlugin] (optional) 127 132 128 From the command-line prompt: 129 {{{ 133 {{{#!sh 130 134 svn co http://trac-hacks.org/svn/tracdeveloperplugin/trunk/ tracdeveloperplugin 131 135 cd tracdeveloperplugin … … 135 139 }}} 136 140 137 === Start ing trac in development mode141 === Start Trac in development mode 138 142 139 From the command-line prompt: 140 {{{ 143 {{{#!sh 141 144 tracd -r --port 8000 test 142 145 }}} 143 146 144 '''Note''': The `-r` command puts Trac into refresh mode so your code changes will show up quickly. See also the [TracIni#trac-section auto_reload] trac.ini flag which should be used for the changes in Genshi templates to be picked-up as well.147 '''Note''': The `-r` command puts Trac into refresh mode so your code changes will show up quickly. See also the [TracIni#trac-section auto_reload] trac.ini flag, which should be used for the changes in Genshi templates to be picked-up as well. 145 148 146 To run `tracd` or work in the virtual environment, you must switch to the virtual environment each time a new shell is opened .147 {{{ 149 To run `tracd` or work in the virtual environment, you must switch to the virtual environment each time a new shell is opened: 150 {{{#!sh 148 151 cd test 149 152 source bin/activate … … 153 156 154 157 To debug a plugin, install it into your test environment using the command: 155 {{{ 156 $ python setup.py develop -md /path/to/projenv/plugins 157 }}} 158 {{{#!sh 159 $ python setup.py develop -md /path/to/projenv/plugins 160 }}} 161 158 162 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. 159 163 160 === Web stuff164 === Open Trac in your browser 161 165 162 166 Switch to your browser and go to `http://127.0.0.1:8000/test` … … 178 182 179 183 The (automated) tests will require additional packages that may or may not be installed with your OS/Python distribution. 180 * For unit test, please review [../UnitTests] 181 * For the functional test, please review [../FunctionalTests] 184 * For unit test, please review [../UnitTests]. 185 * For the functional test, please review [../FunctionalTests]. 182 186