On 11/16/2011 12:53 AM, Toshio Kuratomi wrote:
> Yep. It's not too hard to package parallel installable versions. Getting
> software to use it is the hard part. You can use setuptools to set python to
> find the correct versions (which is the recommendations in the guidelines I
> believe). The drawback is that setuptools is stupid about things sometimes
> so you might get errors that you have problems figuring out unless you have
> experience with it (I can help with that if you need it). You can also
> manually set python's path (Either PYTHONPATH as an environment variable or
> sys.path inside of python itself) to find the correct module directory. The
> setuptools way looks something like this:
>
>
> # The next section is not needed in most cases but in some cases, like using
> # mod_wsgi to load a wsgi script this may be necessary try: from __main__
> import __requires__ except ImportError: __main__.__requires__ == []
> __requires__ = __main__.__requires__ else: if isinstance(basestring,
> __requires__): __requires__ = [__requires__]
>
> # This is where you add the parallel installable version
> __requires__.append('SQLAlchemy >= 0.6')
>
> # This is where you import pkg_resources. pkg_resources sets up the proper #
> python paths when you import it for the first time. Unless you look at #
> funny. Or talk bad about its mother import pkg_resources # This next one
> probably isn't necessary since we used __requires__ above # Note that the
> pkg_resources docs only talk about the call talked about # next but it's
> entirely inadequate for the job. pkg_resources.require('SQLAlchemy >= 0.6')
>
> import sqlalchemy
>
> # Should print 0.6.? print sqlalchemy.__version__
>
>
> This is the way it looks modifying sys.path yourself. Note that you have to
> change it when the python-sqlalchemy package is updated if you do it this way
> and you use the easy_install recipe from the guidelines to install the compat
> sqlalchemy package::
>
> import sys sys.path.insert(0,
> '/usr/lib64/python2.7/site-packages/SQLAlchemy-0.7.1-py2.7.egg') import
> sqlalchemy print sqlalchemy.__version__
Thanks for the tips Toshio!!
> I've also attempted to create sqlalchemy0.6 and sqlalchemy0.7 packages in the
> past. Both fail to build on RHEL6 right now. You'll have to look at the
> unittests. With sqlalchemy 0.7, at least some of the unittests looked like
> genuine failures (rather than simply needing updates to the unittests).
Yes it's awkward. Here are my rebuild notes for 0.6.8 on RHEL 6.2
python-nose is not new enough to build. The correct version wasn't
specified in the spec though and the resultant error crashed RHEL once:
https://bugzilla.redhat.com/show_bug.cgi?id=753505
I hacked together an updated python-nose to allow running sqlalchemy %checks
which passed, but then disabled the %checks so as not to need a newer
python-nose (and the newer packages it in turn needs to be built with).
In case it's of use, you can find the RHEL python-sqlalchemy-0.6.8 packages
I was testing with, here http://www.pixelbeat.org/openstack/
cheers,
Pádraig.
_______________________________________________
cloud mailing list
[email protected]
https://admin.fedoraproject.org/mailman/listinfo/cloud