Edgewall Software

Changes between Version 38 and Version 39 of TracDev/DevelopmentEnvironmentSetup


Ignore:
Timestamp:
Jan 12, 2016, 12:44:09 PM (8 years ago)
Author:
figaro
Comment:

Cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/DevelopmentEnvironmentSetup

    v38 v39  
    1313/Users/myname/projects
    1414}}}
     15
    1516On Windows you would have:
    1617{{{
     
    2728
    2829On 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
    3031sudo apt-get install python2.6
    3132}}}
    3233
    3334You will also need some additional libraries:
    34 {{{
     35{{{#!sh
    3536sudo apt-get install python-subversion
    3637}}}
     
    4748
    4849Otherwise 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
    5051python ez_setup.py
    5152}}}
    5253
    5354To test if the installation was successful:
    54 {{{
     55{{{#!sh
    5556easy_install --help
    5657}}}
     
    5960
    6061From the command-line prompt type:
    61 {{{
     62{{{#!sh
    6263python -m easy_install virtualenv
    6364}}}
     65
    6466On Linux you may need to prepend `python` with `sudo`.
    6567
     
    6769
    6870From the command-line prompt type:
    69 {{{
     71{{{#!sh
    7072virtualenv trac
    7173cd trac
    7274source bin/activate
    7375}}}
     76
    7477or for Windows:
    7578{{{
     
    8184If you have Trac installed in `/usr/lib` or `/usr/local/lib`, run the above virtualenv command with `--no-site-packages`.
    8285
    83 You'll see your command-line prompt has changed.  That means our environment is ready for Trac.
     86You'll see your command-line prompt has changed. That means your environment is ready for Trac.
    8487
    8588=== Upgrade Setuptools
    8689
    8790Just 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
    8992easy_install --upgrade setuptools
    9093}}}
     
    9699== Installing and configuring Trac
    97100 
    98 === Downloading Trac
     101=== Download Trac
    99102
    100103You should get the Trac source code from one of the TracRepositories. For example, for Subversion from the command-line prompt:
    101 {{{
     104{{{#!sh
    102105svn co http://svn.edgewall.org/repos/trac/trunk/ trac-trunk
    103106svn co http://svn.edgewall.org/repos/genshi/trunk/ genshi-trunk
     
    109112}}}
    110113
    111 === Creating your test Trac environment
     114=== Create your test Trac environment
    112115
    113116From the command-line prompt:
    114 {{{
     117{{{#!sh
    115118trac-admin test initenv
    116119}}}
     120
    117121'''Note:''' Press return for every option.
    118122
    119 === Make anonymous users have full access
     123=== Grant full access to anonymous users
    120124
    121 {{{
     125{{{#!sh
    122126trac-admin test permission add anonymous TRAC_ADMIN
    123127}}}
     128
    124129'''Note:''' Don't do this in production!
    125130
    126 === Installing the [th:TracDeveloperPlugin] (optional)
     131=== Install the [th:TracDeveloperPlugin] (optional)
    127132
    128 From the command-line prompt:
    129 {{{
     133{{{#!sh
    130134svn co http://trac-hacks.org/svn/tracdeveloperplugin/trunk/ tracdeveloperplugin
    131135cd tracdeveloperplugin
     
    135139}}}
    136140
    137 === Starting trac in development mode
     141=== Start Trac in development mode
    138142
    139 From the command-line prompt:
    140 {{{
     143{{{#!sh
    141144tracd -r --port 8000 test
    142145}}}
    143146
    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.
    145148
    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 {{{
     149To run `tracd` or work in the virtual environment, you must switch to the virtual environment each time a new shell is opened:
     150{{{#!sh
    148151cd test
    149152source bin/activate
     
    153156
    154157To 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
    158162If 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.
    159163
    160 === Web stuff
     164=== Open Trac in your browser
    161165
    162166Switch to your browser and go to `http://127.0.0.1:8000/test`
     
    178182
    179183The (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].
    182186