Hi, Before starting to use Pyste I wanted to install it in a common location instead of running it off Boost's CVS tree. I find it easier to manage packages when I can install them somewhere. To this end I wrote a trivial setup_pyste.py using distutils that works. Its not great but works. Here is what I did: Use the following setup_pyste.py # -------------------- import os from distutils.core import setup boost_base_dir = "/path/to/your/boost/dir" pyste_src_dir = os.path.join(boost_base_dir, "libs/python/pyste/src") setup (name = "Pyste", version = "1.0", description = "Pyste - Python Semi-Automatic Exporter", maintainer = "Bruno da Silva de Oliveira", maintainer_email = "nicodemus@globalite.com.br", licence = "Boost License", long_description = "Pyste is a Boost.Python code generator", url = "http://www.boost.org/libs/python/pyste/index.html", platforms = ['Any'], packages = ['Pyste'], scripts = ['pyste.py'], package_dir = {'Pyste': pyste_src_dir} ) # -------------------- This installs Pyste inside <prefix>/site-packages/Pyste. I wrote a simple wrapper pyste.py script to use this like so: # -------------------- #!/usr/bin/env python import time import sys from Pyste import pyste if __name__ == '__main__': start = time.clock() pyste.UsePsyco() status = pyste.Main() print '%0.2f seconds' % (time.clock()-start) sys.exit(status) # -------------------- Make this executable and finally do: python setup_pyste.py install to install Pyste. Finally add a __init__.py into <prefix>/site-packages/Pyste. It would be nice if something like this were included the repository. Thanks for Boost.Python and Pyste! cheers, prabhu
Prabhu Ramachandran wrote:
Hi,
Before starting to use Pyste I wanted to install it in a common location instead of running it off Boost's CVS tree. I find it easier to manage packages when I can install them somewhere. To this end I wrote a trivial setup_pyste.py using distutils that works. Its not great but works. Here is what I did:
<snip script>
That looks great, Prabhu! If you could write some documentation on how to use it, I will gladly add it to the distribution. Just a small text file explaining how to install it would be great. Thanks a lot! Nicodemus.
"N" == nicodemus <nicodemus@globalite.com.br> writes:
[Pyste setup script] N> That looks great, Prabhu! If you could write some documentation N> on how to use it, I will gladly add it to the N> distribution. Just a small text file explaining how to install N> it would be great. To set this up in the distribution here are the things one needs to do: 1. Add an empty __init__.py file to libs/python/pyste/src/. 2. Add the attached setup.py to libs/python/pyste/. 3. Add the attached pyste.py to libs/python/pyste/scripts/ or to an appropriate location of your choice. However in that case you'd need to modify the setup.py script to change the location of this script. 4. Now folks who want to install Pyste via distutils do the usual python setup.py install, dance. The nice thing about the above is that it will not interfere with the current setup where folks use Pyste it out of the source tree. It will be possible to elminiate the two pyste.py scripts but that will require moving the files around and might disturb the existing setup. Hope this helps. cheers, prabhu
Prabhu Ramachandran wrote:
[Pyste setup script]
To set this up in the distribution here are the things one needs to do:
1. Add an empty __init__.py file to libs/python/pyste/src/.
2. Add the attached setup.py to libs/python/pyste/.
3. Add the attached pyste.py to libs/python/pyste/scripts/ or to an appropriate location of your choice. However in that case you'd need to modify the setup.py script to change the location of this script.
4. Now folks who want to install Pyste via distutils do the usual python setup.py install, dance.
The nice thing about the above is that it will not interfere with the current setup where folks use Pyste it out of the source tree. It will be possible to elminiate the two pyste.py scripts but that will require moving the files around and might disturb the existing setup.
I added it to the distribution, it is in "libs/python/pyste/install". I moved the pyste/src dir to pyste/src/Pyste, and made a few changes to your setup.py. Thanks a lot Prabhu! Regards, Nicodemus.
"N" == nicodemus <nicodemus@globalite.com.br> writes:
>> [Pyste setup script] N> I added it to the distribution, it is in N> "libs/python/pyste/install". I moved the pyste/src dir to N> pyste/src/Pyste, and made a few changes to your setup.py. N> Thanks a lot Prabhu! Great! In that case you could also move the pyste/src/Pyste/pyste.py script into pyste/src and modify it to import modules from the Pyste package. If this is done you will no longer need the separate pyste.py script. Unfortunately I can't see/get your latest changes to the code in CVS or submit a patch since pserver access to CVS for me is via the backup server and is delayed by about 24hrs. :( cheers, prabhu
Prabhu Ramachandran wrote:
"N" == nicodemus <nicodemus@globalite.com.br> writes:
[Pyste setup script]
N> I added it to the distribution, it is in N> "libs/python/pyste/install". I moved the pyste/src dir to N> pyste/src/Pyste, and made a few changes to your setup.py. N> Thanks a lot Prabhu!
Great! In that case you could also move the pyste/src/Pyste/pyste.py script into pyste/src and modify it to import modules from the Pyste package. If this is done you will no longer need the separate pyste.py script. Unfortunately I can't see/get your latest changes to the code in CVS or submit a patch since pserver access to CVS for me is via the backup server and is delayed by about 24hrs. :(
Don't worry, I made the necessary changes. I reduced pyste.py to: from Pyste import pyste pyste.Main() To avoid code duplication, and changed the setup.py to work from pyste/install. 8) Thanks again for the contribution! Regards, Nicodemus.
"N" == nicodemus <nicodemus@globalite.com.br> writes:
>> Great! In that case you could also move the >> pyste/src/Pyste/pyste.py script into pyste/src and modify it to >> import modules from the Pyste package. If this is done you >> will no longer need the separate pyste.py script. >> Unfortunately I can't see/get your latest changes to the code >> in CVS or submit a patch since pserver access to CVS for me is >> via the backup server and is delayed by about 24hrs. :( N> Don't worry, I made the necessary changes. I reduced pyste.py N> to: Great! Thanks! I also was able to update my CVS checkout a few hours after I sent that message. N> from Pyste import pyste N> pyste.main() Ah, did not notice that. Thats fine. N> To avoid code duplication, and changed the setup.py to work N> from pyste/install. 8) Thanks again for the contribution! My pleasure. cheers, prabhu
participants (2)
-
Nicodemus -
Prabhu Ramachandran