This is mainly note for myself if I ever forgot how to use it.
For most of the time my projects lived each in it's own directory and I resolved importing issues with sys.path manipulation. That works for low number of simple programs/libraries. Using distribute (setuptools) seems to be a natural step forward.
I'd like to stay with this approach (no setuptools) for a little bit longer because I'm easily distracted and I need to get used to setuptools boilerplate ;)
Steps to make life less painful (use setuptools) and to preserve old ways:
Step 1. install virtualenv
Step 2. virtualenv $SOME_PATH_TO_NEW_ENVIRONMENT
Step 3. source $SOME_PATH_TO_NEW_ENVIRONMENT/bin/activate
Then we've got cloned python installation that will work with python setup.py install or whatever. But we're only halfway done and need to setup our package.
Step 1. mkdir $PACKAGE_INSTALLER
Step 2. cd $PACKAGE_INSTALLER
Step 3. ln -s $REAL_PACKAGE_DIR .
Step 4. write setup.py as advertised in documentation
Thats all. I can hide package installers so I don't get distracted but still I get all power of setuptools.
edit:
Main benefit is that when using setup.py develop I can edit my package as always in $REAL_PACKAGE_DIR.
18 October 2010
Subscribe to:
Post Comments (Atom)
2 comments:
Hello there,
This is a question for the webmaster/admin here at tinkerer-warehouse.blogspot.com.
Can I use some of the information from this blog post above if I give a backlink back to this website?
Thanks,
Mark
Yes.
Post a Comment