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

Extracting python dependencies automatically

Started looking into possibilities of extracting python dependency information similarly to perl dependencies...

Initial POC implementation looks like this:

For provides, look into site-packages and turn the dir/filenames found into foo.bar type entries in python() namespace, for example:
[pmatilai localhost ~]$ rpm -ql yum-metadata-parser|./pythondeps.py -P

For requires, try to locate any python scripts and modules and for each found, run them through python's modulefinder which attempts to figure out which modules a script/module uses. Then, based on the filenames gotten from modulefinder results, turn them into python(<name>) entries, for example:
[pmatilai localhost ~]$ rpm -ql createrepo|./pythondeps.py -R
python(abi) = 2.5

Haven't tested it at all thoroughly, but visual inspection of what I've tried would appear to be reasonably sane. That said I'm often blind as a bat so there might be severe problems there and I just didn't notice :)

If any python-heads are interested in playing around / testing / improving, here's the initial attempt: http://laiskiainen.org/rpm/scripts/pythondeps.py

Thoughts / comments?

	- Panu -

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