[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Python 2.6 bindings

From: Alina Frey <afrey_at_modusoperandi.com>
Date: Tue, 1 Feb 2011 18:19:15 -0500

Mark, Daniel,

Thanks for all your inputs.
I think I am getting closer to the seeing the light at the end of the tunnel
:). I will describe below all the steps that I took in order to download,
install and setup. Please let me know if everything seems alright or I need
to change anything. I read that when I create a Trac project, it should ask
me about the repository type and repository path, which is not happening. I
was wondering if it is because of the newer version of Python (2.7).

Another dilemma that I have is related to the repositories.
From the Trac project webpage, when logged in with admin privileges, I can
create a repository by going to Adim -> Repositories -> Add repository. Here
I can create a new repository. Let's say that I'm creating Repository1. From
here it says that I should set up a post-commit hook on the repository to
call trac-admin $ENV changeset added "Repository1" $REV for each committed
changeset. I don't understand what that is and how should I do this.

Also, what do I need to install in order to be able to check in files?

Thank you so much,

- Alina.

Here are the steps that I took in order to download, install and setup.

Trac-Subversion Installation in Windows

The following software packages must be installed:
1. Python
2. setuptools
3. Genshi
4. SQLite Database
5. Subversion
6. Apache

Perform the following steps:

1. Python: Download Python 2.7.1 Windows Installer (python-2.7.1.msi)
from http://www.python.org/download/. Install it by double clicking on
python-2.7.1.msi.

2. setuptools: Downloaded setuptools
0.6c11(setuptools-0.6c11.win32-py2.7.exe (md5) ) from
http://pypi.python.org/pypi/setuptools. Install it by double clicking on
setuptools-0.6c11.win32-py2.7.exe.

3. Add the following to the Path Environment Variables:
C:\Python27\Scripts; C:\Python27\.
        
4. Genshi (it comes with Python 2.7). From the command line:
> easy_install Genshi

5. SQLite Database (it comes with Python 2.7). Does not need to perform
any steps to install it.

6. Subversion, 1.5.x or 1.6.x and the corresponding Python bindings:
        a. Download and install Subversion 1.6.15 first: Win32Svn
(32-bit client) from https://sourceforge.net/projects/win32svn/
        b. Download the Python bindings: svn-win32-1.6.15_py_2.7.zip
(from http://trac.edgewall.org/wiki/TracSubversion ). Unzip and copy the two
folders under the extracted package (libsvn and svn) under
C:\Python27\Lib\site-packages.
        c. Create a subversion folder:
> mkdir C:\Projects\SVN
        d. Crete SVN repository
> svnadmin create C:\Projects\SVN\TestRepository

7. Apache: Download and install win32 Binary including OpenSSL 0.9.8o
(MSI Installer): httpd-2.2.17-win32-x86-openssl-0.9.8o.msi from
http://httpd.apache.org/download.cgi

8. Create a password file for Trac by using htpasswd.exe from Apache
folder:
> Cd C:\Program Files (x86)\Apache Software
Foundation\Apache2.2\bin
> htpasswd.exe -b -c password.txt afrey dds4mo
> The file password.txt will be copied under Trac after it
will be installed.

9. Install Trac from the command line:
> easy_install Babel==0.9.5 Genshi==0.6
> easy_install Trac
> I have a step that does the install by double clicking on
Trac_0.12.1.win32.exe. I don't understand what that does, if it does the
same thing as the easy_install or not.

10. Create a project environment:
> trac-admin C:\Projects\Trac-Test initenv
> Prompted to enter the following:
> Project name: Test
> Database connection: just press <Enter> to take the default
[sqlite:db/trac.db]
> Noticed that it did not ask anything about subversion.

11. Copy password.txt to C:\Projects\Trac-Test\auth\ password.txt. If
the folder auth is not created yet, create it now. The file should reside
somewhere else so it does not depend on only one project (in this case
Trac-Test).

12. Start Trac from the command line:
> tracd -p 8000
--basic-auth="Trac-Test,C:\Projects\Trac-Test\auth\password.txt,"
C:\Projects\Trac-Test

13. Add user with admin priviledges:
> trac-admin C:\Projects\Trac-Test permission add afrey
TRAC_ADMIN
> trac-admin C:\Projects\Trac-Test permission add mgilger
TRAC_ADMIN
> To see all the users and permissions: trac-admin
C:\Projects\Trac-Test permission list

14. The environment could be configured by editing the file:
C:\Trac-Test\conf\trac.ini

15. To add an image to the Trac project home page:
> Copy picture TestLogo.png (that was previously created and
saved somewhere on the computer) under
C:\Projects\Trac-Test\htdocs\TestLogo.png.
> Modify C:\Projects\Trac-Test\conf\trac.ini. Look for the
section [header_logo] and add or replace the following lines:
> alt = Test
> height = 70
> link = http://...
> src = site/TestLogo.png
> width = 170

16. Start the Trac project webpage:
> http://localhost:8000/Trac-Test

17. Create repository (need to be signed in with admin rights):
> Click Admin button (top of the page)
> Click Repositories button (left bottom)
> Add Repository:
> Name:Repository1
> Type: svn
> Directory: C:\Projects\SVN\TestRepository

18. Synchronize Trac with the repository
> trac-admin C:\Projects\Trac-Test\ repository resync
"Repository1"
> What I get is:
> Resyncing repository history for Repository1...
> 0 revisions cached.
> Done.

19. ???Set up a post-commit hook on the repository to call trac-admin
$ENV changeset added "Repository1" $REV for each committed changeset.

-----Original Message-----
From: Cooke, Mark [mailto:mark.cooke_at_siemens.com]
Sent: Monday, January 31, 2011 4:45 AM
To: users_at_subversion.apache.org
Cc: Alina Frey
Subject: RE: Python 2.6 bindings

Hello,

Note: I have rearranged into chronologoical top-to-bottom order for ease
of reading, see below...

> > -----Original Message-----
> > From: Alina Frey [mailto:afrey_at_modusoperandi.com]
> > Sent: 27 January 2011 20:14
> > To: users_at_subversion.apache.org
> > Subject: Python 2.6 bindings
> >
> > I am new to Subversion. Need to use Subversion with Trac.
> > Trac requires Python, therefore I need the Python bindings,
> > so I downloaded svn-win32-1.6.13_py.zip
> > <http://alagazam.net/svn-1.6.13/svn-win32-1.6.13_py.zip> .
> > Would you please let me know what do I need to do after I
> > extract all the files from svn-win32-1.6.13_py.zip
> > <http://alagazam.net/svn-1.6.13/svn-win32-1.6.13_py.zip> ?
> >
> > Thank you,
> >
> > Alina.
> >
> -----Original Message-----
> From: Cooke, Mark [mailto:mark.cooke_at_siemens.com]
> Sent: Friday, January 28, 2011 3:05 AM
> To: Alina Frey
> Cc: users_at_subversion.apache.org
> Subject: RE: Python 2.6 bindings
>
> Hello,
>
> As you mention alagazam, I will assume you are on windows... However,
> why are you installing 1.6.13 when 1.6.15 is available?
>
> I asked almost this question a while back (on the Trac Users mailing
> list) and did not really get an answer. However, some searching of
> both svn and Trac documentation lead me to write the following notes
> for myself which is what I now follow. Let me know if this works for
> you too (obviously you can ignore the first two steps)...
>
> Upgrading the Python Bindings for Subversion:
> =============================================
>
> Just to complete this thread with the hope of being useful to someone
> else, this is what I did to install the latest svn from Algazam
> onto windoze:
>
> ~ stopped the apache service
>
> ~ uninstalled all previous subversion instances (tidying up really)
>
> ~ ran the Algazam windows .msi installer
>
> ~ copied the latest mod_*.so files from the install location to the
> apache modules directory (overwriting the old ones)
>
> ~ deleted the old svn and libsvn directories from
> C:\Python26\Lib\site-packages
>
> ~ opened the python bindings .zip and copied the two directories
> to site-packages
>
> ~ copied all libsvn\_*.dll files to libsvn\_*.pyd [1]
>
> ~ restarted the server and crossed fingers...
>
> [1] I found this recommended in the t.e.o wiki at TracSubversion...
> http://trac.edgewall.org/wiki/TracSubversion#forPython2.6
>
> In other words, it was fine to just delete the old files from
> site_packages and copy the new ones in there, with just a bit
> of fiddling about!
>
> ~ mark c
>
> -----Original Message-----
> From: Alina Frey [mailto:afrey_at_modusoperandi.com]
> Sent: 28 January 2011 19:05
> To: Cooke, Mark
> Cc: users_at_subversion.apache.org
> Subject: RE: Python 2.6 bindings
>
> Yes, I am on Windows.
> I installed Apache Subversion (Setup-Subversion-1.6.15.msi).
> No previous versions installed.
> You mentioned that I need to stop apache server.
> How do I know if it's running?

On windows installs, there is usually a little system tray applet called
something like 'apache monitor' which will tell you. If it is not
running you can run it from the start menu apache folder. This also
makes it easy to start/stop apache.

In case you are not sure, apache is the common name for the well known
web server software provided by the apache foundation, although I
believe that strictly speaking apache 'httpd' is the web software,
apache do quite a lot of software, now including subversion of course.

You can run both trac and subversion with or without apache, both
approaches have advantages. This is an example why it helps to give
more background info about your setup when posting a question, then help
can be tailored to your needs...

> You mentioned that we need to copy mod_*.so files to the
> apache modules folder. Was I supposed to have an apache
> folder anywhere (where?). Was I supposed to install apache
> separately? Or it's included in Python somewhere?

You do not need apache but have a read of both the subversion red-book
docs [1] and the trac guides [2] to help you decide. If you do decide
on apache, it is a separate download and install and no, it's not
included in python.

[1]
http://svnbook.red-bean.com/nightly/en/svn.serverconfig.choosing.html
[2] http://trac.edgewall.org/wiki/TracInstall

The *.so files are apache loadable modules that you need to get
subversion running behind apache and need to be added to your apache
config. You do not need them if you are running trac and subversion
stand-alone.

> I copied svn and libsvn folders to C:\Python26\Lib\site-packages.
> What did you mean by "copied all libsvn\_*.dll files to
> _*.pyd"? Move all the dll files from under libsvn to one folder
> up and modify the extension to pyd?

No, sorry, I can see why you might think that. No, you just need to
copy all the .pyd files (which is just a DLL with a python-specific
extension) to *.dll but keep them in the same directory. I'm not
totally sure why this is necessary but it does not work properly if you
don't! Did you read the link I included?

> I appreciate any input. Thank you,

No problems, I hope you get it working.

~ mark c

  • application/x-pkcs7-signature attachment: smime.p7s
Received on 2011-02-02 00:19:58 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.