Re: Using file system links to unbundle python packages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2014-06-09 12:36 GMT+02:00 Michael Schwendt <mschwendt@xxxxxxxxx>:
On Mon, 9 Jun 2014 11:57:07 +0200, Sergio Pascual wrote:

> I have a pair of python packages that bundle a series of python packages
> under a subpackage extern. In particular, python-astropy bundles six,
> configobj, pytest and ply.
>
> What I do is patching the source, so that instead of
>
> from astropy.extern.six import ...
>
> I have
>
> from six import ...
>
>
> This works for astropy itself, but other third-party packages require
> astropy.extern to exist and work, i.e, its part of the API of astropy.
>
> I have read this
>
> http://fedoraproject.org/wiki/User:Toshio/Unbundling_Python_Modules
>
> but before trying to implement changes, my question is: is a valid approach
> to remove the bundled library and make a files ystem link to the system
> library?

IMO, it would be cleaner to adjust the "import" statements and make
them try importing the system modules before falling back to the
bundled modules. Such a change could be merged upstream, and then you
would only need to delete the bundled modules.


So, do you mean changing things like:

from ...extern.six.moves.http_client import HTTPSConnection

to

try:
    from six.moves.http_client import HTTPSConnection
except ImportError:
    from ...extern.six.moves.http_client import HTTPSConnection

everywhere in the code? Surely upstream is not going to to accept it.

What they could accept is a mechanism in  extern.six to load the system package when is available and the bundled package when it is not. The same for the other packages (ply, pytest, etc). But that's what I'm trying to avoid by linking.

 
Of course, a primary question is why are these modules bundled?
Is it only out of convenience (for the users/developers)?
Are there strict dependencies on specific versions of these modules?

It's a matter of convenience. The only hard requirement of astropy is numpy.

The bundled versions are kept up to date, sometimes versions are new than Fedora's.

I must say that upstream is very helpful and they make very easy to unbundle the C libraries shipped in the code. It's just the python packages where I'm not completely happy how I'm unbundle them.

 
--
packaging mailing list
packaging@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/packaging

--
packaging mailing list
packaging@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/packaging

[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux