星期二, 6月 03, 2008

[tips] add bzr sftp support when you have no compiler on target platform (pure python )

bzr depends on paramiko to provide sftp support. While paramiko itself is pure python, its dependency pycrypto is not. PyCrypto have lots of C-extenstion and you'll need a compiler to install it. However since we only use part of pycrypto (to have sftp support for bzr), we could just add some stub files to prevent the [deploy] problem.

I have made a modified pure python version pycrypto and packaged it with paramiko 1.7.3, so after you installed bzr (use standard python setup.py or easy_install), you just extract paramiko-1.7.3-bzr-sftp-purepy.tgz
at your python site-package directory (make sure you don't have paramiko and pycrypto already exists, if you do, you don't need to install this package anyway) and happy bzr...!

This also makes bzr only depend on python so you could easily deploy it on a machine which doesn't have c compiler and still have sftp support.

Warning: this pacakage only add bzr sftp support and provides nothing besides this, and these COULD break other python packages which also used paramiko and pycrypto, so don't use it if you don't really need it. And the only tests I've done is on my own (embedded linux) machine, Basically it's just for my own use, I have warned you.

3 則留言:

Bai 提到...

Hi, it seems that you have changed Crypto for paramiko to pure python, but I could not download them from the link, Could you help tell me where could I download paramiko-1.73-bzr-sftp-purepy.tgz? Thanks

使徒提姆 !? 提到...

Hi Bai please download again, the ISP changed so the file is missing and I just fixed it.

使徒提姆 !? 提到...

I also put the file here:

http://bazaar.launchpad.net/~timchen119/+junk/pure-python-paramiko/files