Skip to contentSkip to conversation

python-kmod 0.9

announce Lucas De Marchi 4 participants 11 messages Nov 11, 2013 – Mar 26, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 13 lines · Andy Grover

Hi all,

I'd like to announce python-kmod 0.9. It is available here:

https://github.com/agrover/python-kmod
git://github.com/agrover/python-kmod.git
https://github.com/downloads/agrover/python-kmod/python-kmod-0.9.tar.gz

A gentleman named W. Trevor King basically rewrote it from the ground up using Cython, a language that bridges the gap between C and Python. These changes make python-kmod Python 3 compatible, as well as enabling the Python API to fully express libkmod's featureset.

Quoted 7 lines

Anyways, this was a big change, so I wanted to announce it. :)

Regards -- Andy

p.s. btw I've worked on some other libs where core devs wanted to pull in Python bindings to their tree. Not asking for this, but not opposed, if desired. :) -a

Hey. I think I replied once that this could be better left off in its own repository. However I'm reconsidering this now... if you are still interested in merging into kmod, I think it would be good.

Regards,

Lucas De Marchi

#2 lore raw
Quoted 5 lines · Lucas De Marchi
Quoted 3 lines · Andy Grover

Hi all,

I'd like to announce python-kmod 0.9. It is available here:

Quoted 7 lines
Quoted 3 lines

p.s. btw I've worked on some other libs where core devs wanted to pull in Python bindings to their tree. Not asking for this, but not opposed, if desired. :) -a

Hey. I think I replied once that this could be better left off in its own repository. However I'm reconsidering this now... if you are still interested in merging into kmod, I think it would be good.

You bet. I'll start work on a patch.

Regards -- Andy

#3 lore raw

Hi Andy,

Quoted 15 lines · Andy Grover
Quoted 13 lines · Lucas De Marchi
Quoted 9 lines · Andy Grover

Hi all,

I'd like to announce python-kmod 0.9. It is available here:

p.s. btw I've worked on some other libs where core devs wanted to pull in Python bindings to their tree. Not asking for this, but not opposed, if desired. :) -a

Quoted 6 lines
Quoted 3 lines

Hey. I think I replied once that this could be better left off in its own repository. However I'm reconsidering this now... if you are still interested in merging into kmod, I think it would be good.

You bet. I'll start work on a patch.

Ping.

Lucas De Marchi

#4 lore raw
Quoted 8 lines · Lucas De Marchi
Quoted 6 lines
Quoted 3 lines

Hey. I think I replied once that this could be better left off in its own repository. However I'm reconsidering this now... if you are still interested in merging into kmod, I think it would be good.

You bet. I'll start work on a patch.

Ping.

Hi Lucas,

Sorry for the delay. Here's what I have so far:

https://github.com/agrover/kmod.git

Copied source in, modified configure.ac. But I'm pretty weak on automake. Basically the Python bindings need "python setup.py build" and "python setup.py install" for the relevant make targets, but that still needs to be hooked up :-/

Would you or some other kind soul that knows automake be willing to advise, or even fix this up the rest of the way?

Thanks -- Regards -- Andy

#5 lore raw

Hi Andy,

Quoted 20 lines · Andy Grover
Quoted 11 lines · Lucas De Marchi
Quoted 8 lines
Quoted 4 lines

Hey. I think I replied once that this could be better left off in its own repository. However I'm reconsidering this now... if you are still interested in merging into kmod, I think it would be good.

You bet. I'll start work on a patch.

Ping.

Hi Lucas,

Sorry for the delay. Here's what I have so far:

https://github.com/agrover/kmod.git

Quoted 7 lines

Copied source in, modified configure.ac. But I'm pretty weak on automake. Basically the Python bindings need "python setup.py build" and "python setup.py install" for the relevant make targets, but that still needs to be hooked up :-/

Would you or some other kind soul that knows automake be willing to advise, or even fix this up the rest of the way?

Sure I'll do the missing glue to the build system.

Quoted 2 lines

Thanks -- Regards -- Andy

I decided to let this out of kmod 16 so we have more time to play with the python bindings...

regards,
Lucas De Marchi

#6 lore raw

Hi Andy,

Quoted 28 lines · Lucas De Marchi

Hi Andy,

Quoted 25 lines · Andy Grover
Quoted 11 lines · Lucas De Marchi
Quoted 8 lines
Quoted 4 lines

Hey. I think I replied once that this could be better left off in its own repository. However I'm reconsidering this now... if you are still interested in merging into kmod, I think it would be good.

You bet. I'll start work on a patch.

Ping.

Hi Lucas,

Sorry for the delay. Here's what I have so far:

https://github.com/agrover/kmod.git

Copied source in, modified configure.ac. But I'm pretty weak on automake. Basically the Python bindings need "python setup.py build" and "python setup.py install" for the relevant make targets, but that still needs to be hooked up :-/

Quoted 4 lines
Quoted 2 lines

Would you or some other kind soul that knows automake be willing to advise, or even fix this up the rest of the way?

Sure I'll do the missing glue to the build system.

I've just pushed a branch named "python" which contains the python bindings. I did it a bit different than you:

- All the code from your repository was imported maintaining the
history. I would like to keep it, so I did a merge of the final import (fast forward, but forced to contain a commit).
- Python bindings are built with autotools. This allows to easily
express the dependency with libkmod... but I'm not sure this is ideal as opposed to having a target to explicitely calling setuptools. Any opinion?

Then I noticed the example given in the README file doesn't work. Neither by installing they original python-kmod package :-/

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

import kmod
km = kmod.Kmod()

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: 'module' object has no attribute 'Kmod'
    >>> dir(kmod)
    ['__builtins__', '__doc__', '__file__', '__loader__', '__name__',

'__package__', '__path__', '__version__', 'list', 'version']

--
Lucas De Marchi

#7 lore raw
Quoted 14 lines · Lucas De Marchi

I've just pushed a branch named "python" which contains the python bindings. I did it a bit different than you:

- All the code from your repository was imported maintaining the
history. I would like to keep it, so I did a merge of the final import (fast forward, but forced to contain a commit).
- Python bindings are built with autotools. This allows to easily
express the dependency with libkmod... but I'm not sure this is ideal as opposed to having a target to explicitely calling setuptools. Any opinion?

Then I noticed the example given in the README file doesn't work. Neither by installing they original python-kmod package :-/

Quoted 9 lines
     >>> import kmod
     >>> km = kmod.Kmod()
     Traceback (most recent call last):
       File "<stdin>", line 1, in <module>
     AttributeError: 'module' object has no attribute 'Kmod'
     >>> dir(kmod)
     ['__builtins__', '__doc__', '__file__', '__loader__', '__name__',

'__package__', '__path__', '__version__', 'list', 'version']

The old 'python-kmod' pkg works for me:

[agrover@work ~/.../python/kmod ((fac4d09...))]$ ipython

In [1]: import kmod

In [2]: km = kmod.Kmod()

In [3]: sc = list(km.lookup("soundcore"))[0]

In [4]: sc.path
Out[4]: u'/lib/modules/3.13.6-200.fc20.x86_64/kernel/sound/soundcore.ko'

but when I try to use the new stuff:

[agrover@work ~/.../python/kmod ((fac4d09...))]$ PYTHONPATH="/home/agrover/git/kmod/libkmod/python/kmod/.libs" ipython

In [1]: import kmod
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-ff824b795612> in <module>()
----> 1 import kmod

ImportError: dynamic module does not define init function (initkmod)

Is this what you're seeing as well?

Regards -- Andy

#8 lore raw
Quoted 49 lines · Andy Grover
Quoted 14 lines · Lucas De Marchi

I've just pushed a branch named "python" which contains the python bindings. I did it a bit different than you:

- All the code from your repository was imported maintaining the
history. I would like to keep it, so I did a merge of the final import (fast forward, but forced to contain a commit).
- Python bindings are built with autotools. This allows to easily
express the dependency with libkmod... but I'm not sure this is ideal as opposed to having a target to explicitely calling setuptools. Any opinion?

Then I noticed the example given in the README file doesn't work. Neither by installing they original python-kmod package :-/

Quoted 9 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

import kmod
km = kmod.Kmod()

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: 'module' object has no attribute 'Kmod'
    >>> dir(kmod)
    ['__builtins__', '__doc__', '__file__', '__loader__', '__name__',

'__package__', '__path__', '__version__', 'list', 'version']

The old 'python-kmod' pkg works for me:

[agrover@work ~/.../python/kmod ((fac4d09...))]$ ipython

In [1]: import kmod

In [2]: km = kmod.Kmod()

In [3]: sc = list(km.lookup("soundcore"))[0]

In [4]: sc.path
Out[4]: u'/lib/modules/3.13.6-200.fc20.x86_64/kernel/sound/soundcore.ko'

but when I try to use the new stuff:

[agrover@work ~/.../python/kmod ((fac4d09...))]$ PYTHONPATH="/home/agrover/git/kmod/libkmod/python/kmod/.libs" ipython

In [1]: import kmod
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-ff824b795612> in <module>()
----> 1 import kmod

Quoted 3 lines

ImportError: dynamic module does not define init function (initkmod)

Is this what you're seeing as well?

humn... indeed. The error was obfuscated for me because in the __init__.py you catch the exception and make it pass silently.

In the build system I was inheriting the CFLAGS from the library and unfortunately PyMODINIT_FUNC doesn't include the visibility attribute. Since we use -fvisibility=hidden by default, this was breaking the module.

It's working now, though I don't like to let it as -fvisibility=default.

I just pushed the python branch again. Could you ack on it?

thanks

Signature · 1 line
Lucas De Marchi
#9 lore raw
Quoted 58 lines · Lucas De Marchi
Quoted 49 lines · Andy Grover
Quoted 14 lines · Lucas De Marchi

I've just pushed a branch named "python" which contains the python bindings. I did it a bit different than you:

- All the code from your repository was imported maintaining the
history. I would like to keep it, so I did a merge of the final import (fast forward, but forced to contain a commit).
- Python bindings are built with autotools. This allows to easily
express the dependency with libkmod... but I'm not sure this is ideal as opposed to having a target to explicitely calling setuptools. Any opinion?

Then I noticed the example given in the README file doesn't work. Neither by installing they original python-kmod package :-/

Quoted 9 lines
     >>> import kmod
     >>> km = kmod.Kmod()
     Traceback (most recent call last):
       File "<stdin>", line 1, in <module>
     AttributeError: 'module' object has no attribute 'Kmod'
     >>> dir(kmod)
     ['__builtins__', '__doc__', '__file__', '__loader__', '__name__',

'__package__', '__path__', '__version__', 'list', 'version']

The old 'python-kmod' pkg works for me:

[agrover@work ~/.../python/kmod ((fac4d09...))]$ ipython

In [1]: import kmod

In [2]: km = kmod.Kmod()

In [3]: sc = list(km.lookup("soundcore"))[0]

In [4]: sc.path
Out[4]: u'/lib/modules/3.13.6-200.fc20.x86_64/kernel/sound/soundcore.ko'

but when I try to use the new stuff:

[agrover@work ~/.../python/kmod ((fac4d09...))]$ PYTHONPATH="/home/agrover/git/kmod/libkmod/python/kmod/.libs" ipython

In [1]: import kmod
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-ff824b795612> in <module>()
----> 1 import kmod

Quoted 3 lines

ImportError: dynamic module does not define init function (initkmod)

Is this what you're seeing as well?

humn... indeed. The error was obfuscated for me because in the __init__.py you catch the exception and make it pass silently.

Quoted 8 lines

In the build system I was inheriting the CFLAGS from the library and unfortunately PyMODINIT_FUNC doesn't include the visibility attribute. Since we use -fvisibility=hidden by default, this was breaking the module.

It's working now, though I don't like to let it as -fvisibility=default.

I just pushed the python branch again. Could you ack on it?

I'm still getting this error.

[agrover@work ~/git/kmod (python)]$ PYTHONPATH="/home/agrover/git/kmod/libkmod/python/kmod/.libs" python Python 2.7.5 (default, Feb 19 2014, 13:47:28)
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

Quoted 1 line
Quoted 1 line
Quoted 1 line

import kmod

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "list.pxd", line 21, in init kmod.kmod
(libkmod/python/kmod/kmod.c:3831)
ImportError: No module named list

I'm sorry I'm not being more help.. maybe we could get W. Trevor King or another Cython contributor to help us out here? I played around with it a bit and changing "kmod.list" to "list" on the line reporting an error in kmod.c seemed to help, and then repeating for additional errors, but kmod.c is a generated file so that's not the actual solution.

Regards -- Andy

#10 lore raw
Quoted 90 lines · Andy Grover
Quoted 64 lines · Lucas De Marchi
Quoted 53 lines · Andy Grover
Quoted 15 lines · Lucas De Marchi

I've just pushed a branch named "python" which contains the python bindings. I did it a bit different than you:

- All the code from your repository was imported maintaining the
history. I would like to keep it, so I did a merge of the final import (fast forward, but forced to contain a commit).
- Python bindings are built with autotools. This allows to easily
express the dependency with libkmod... but I'm not sure this is ideal as opposed to having a target to explicitely calling setuptools. Any opinion?

Then I noticed the example given in the README file doesn't work. Neither by installing they original python-kmod package :-/

Quoted 9 lines
     >>> import kmod
     >>> km = kmod.Kmod()
     Traceback (most recent call last):
       File "<stdin>", line 1, in <module>
     AttributeError: 'module' object has no attribute 'Kmod'
     >>> dir(kmod)
     ['__builtins__', '__doc__', '__file__', '__loader__', '__name__',

'__package__', '__path__', '__version__', 'list', 'version']

The old 'python-kmod' pkg works for me:

[agrover@work ~/.../python/kmod ((fac4d09...))]$ ipython

In [1]: import kmod

In [2]: km = kmod.Kmod()

In [3]: sc = list(km.lookup("soundcore"))[0]

In [4]: sc.path
Out[4]: u'/lib/modules/3.13.6-200.fc20.x86_64/kernel/sound/soundcore.ko'

but when I try to use the new stuff:

[agrover@work ~/.../python/kmod ((fac4d09...))]$ PYTHONPATH="/home/agrover/git/kmod/libkmod/python/kmod/.libs" ipython

In [1]: import kmod

---------------------------------------------------------------------------
ImportError Traceback (most recent call
last)
<ipython-input-1-ff824b795612> in <module>()
----> 1 import kmod

Quoted 3 lines

ImportError: dynamic module does not define init function (initkmod)

Is this what you're seeing as well?

humn... indeed. The error was obfuscated for me because in the __init__.py you catch the exception and make it pass silently.

Quoted 8 lines

In the build system I was inheriting the CFLAGS from the library and unfortunately PyMODINIT_FUNC doesn't include the visibility attribute. Since we use -fvisibility=hidden by default, this was breaking the module.

It's working now, though I don't like to let it as -fvisibility=default.

I just pushed the python branch again. Could you ack on it?

I'm still getting this error.

[agrover@work ~/git/kmod (python)]$ PYTHONPATH="/home/agrover/git/kmod/libkmod/python/kmod/.libs" python Python 2.7.5 (default, Feb 19 2014, 13:47:28)
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

Quoted 1 line
Quoted 1 line
Quoted 1 line

import kmod

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "list.pxd", line 21, in init kmod.kmod
(libkmod/python/kmod/kmod.c:3831)
ImportError: No module named list

Quoted 5 lines

I'm sorry I'm not being more help.. maybe we could get W. Trevor King or another Cython contributor to help us out here? I played around with it a bit and changing "kmod.list" to "list" on the line reporting an error in kmod.c seemed to help, and then repeating for additional errors, but kmod.c is a generated file so that's not the actual solution.

Humn... yes. If I set PYTHONPATH as opposed to installing I get this error. I'm not sure what's happening.

Signature · 1 line
Lucas De Marchi
Acked-by
#11 lore raw
Quoted 91 lines · Lucas De Marchi
Quoted 90 lines · Andy Grover
Quoted 64 lines · Lucas De Marchi
Quoted 53 lines · Andy Grover
Quoted 15 lines · Lucas De Marchi

I've just pushed a branch named "python" which contains the python bindings. I did it a bit different than you:

- All the code from your repository was imported maintaining the
history. I would like to keep it, so I did a merge of the final import (fast forward, but forced to contain a commit).
- Python bindings are built with autotools. This allows to easily
express the dependency with libkmod... but I'm not sure this is ideal as opposed to having a target to explicitely calling setuptools. Any opinion?

Then I noticed the example given in the README file doesn't work. Neither by installing they original python-kmod package :-/

Quoted 9 lines
      >>> import kmod
      >>> km = kmod.Kmod()
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      AttributeError: 'module' object has no attribute 'Kmod'
      >>> dir(kmod)
      ['__builtins__', '__doc__', '__file__', '__loader__', '__name__',

'__package__', '__path__', '__version__', 'list', 'version']

The old 'python-kmod' pkg works for me:

[agrover@work ~/.../python/kmod ((fac4d09...))]$ ipython

In [1]: import kmod

In [2]: km = kmod.Kmod()

In [3]: sc = list(km.lookup("soundcore"))[0]

In [4]: sc.path
Out[4]: u'/lib/modules/3.13.6-200.fc20.x86_64/kernel/sound/soundcore.ko'

but when I try to use the new stuff:

[agrover@work ~/.../python/kmod ((fac4d09...))]$ PYTHONPATH="/home/agrover/git/kmod/libkmod/python/kmod/.libs" ipython

In [1]: import kmod

---------------------------------------------------------------------------
ImportError Traceback (most recent call
last)
<ipython-input-1-ff824b795612> in <module>()
----> 1 import kmod

Quoted 3 lines

ImportError: dynamic module does not define init function (initkmod)

Is this what you're seeing as well?

humn... indeed. The error was obfuscated for me because in the __init__.py you catch the exception and make it pass silently.

Quoted 8 lines

In the build system I was inheriting the CFLAGS from the library and unfortunately PyMODINIT_FUNC doesn't include the visibility attribute. Since we use -fvisibility=hidden by default, this was breaking the module.

It's working now, though I don't like to let it as -fvisibility=default.

I just pushed the python branch again. Could you ack on it?

I'm still getting this error.

[agrover@work ~/git/kmod (python)]$ PYTHONPATH="/home/agrover/git/kmod/libkmod/python/kmod/.libs" python Python 2.7.5 (default, Feb 19 2014, 13:47:28)
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

Quoted 1 line
Quoted 1 line
Quoted 1 line

import kmod

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "list.pxd", line 21, in init kmod.kmod
(libkmod/python/kmod/kmod.c:3831)
ImportError: No module named list

Quoted 9 lines
Quoted 5 lines

I'm sorry I'm not being more help.. maybe we could get W. Trevor King or another Cython contributor to help us out here? I played around with it a bit and changing "kmod.list" to "list" on the line reporting an error in kmod.c seemed to help, and then repeating for additional errors, but kmod.c is a generated file so that's not the actual solution.

Humn... yes. If I set PYTHONPATH as opposed to installing I get this error. I'm not sure what's happening.

Ah ok! PYTHONPATH needs to be to "...site-packages", not "...site-packages/kmod". so I'm all good :-)

Thanks! -- Andy