Python package for pywsman Python bindings

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Python package for pywsman Python bindings

Ahmad Jagot

Hi,

I’ve been working on generating a native Python package for the openwsman Python bindings. This has a number of advantages. the main ones being potential availability on the Python Package Index (http://pypi.python.org), and compatibility with virtualenvs.

As we run mainly on Ubuntu Trusty, I’ve successfully got this working with openwsman v2.4.3 — the version of libopenwsman-dev used in that OS. You can see the changes here:
https://github.com/Openwsman/openwsman/compare/master...ocadotechnology:v2.4.3_pydist

I’d like to port these changes to master, and get them merged upstream. I am, however, struggling to get these changes working on master. The setup.py is clever enough to find headers in the source directory (as opposed to system-wide installed ones). However, I’m unable to get it to link against the built libraries in the source directory.

The library builds successfully, but on importing, I get this:

>>> import pywsman
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pywsman.py", line 28, in <module>
    _pywsman = swig_import_helper()
  File "pywsman.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywsman', fp, pathname, description)
ImportError: ./_pywsman.so: undefined symbol: wsmc_add_property_epr

ldd suggests the library is still being linked against system libraries:

$ ldd _pywsman.so | grep wsman
        libwsman.so.1 => /usr/lib/x86_64-linux-gnu/libwsman.so.1 (0x00007f0a5085d000)
        libwsman_client.so.2 => /usr/lib/x86_64-linux-gnu/libwsman_client.so.2 (0x00007f0a50652000)
        libwsman_curl_client_transport.so.1 => /usr/lib/x86_64-linux-gnu/libwsman_curl_client_transport.so.1 (0x00007f0a5044b000)

Is it possible to find out the actual swig command and options that re used to generate the Python bindings?

My current work on this can be found here: https://github.com/ocadotechnology/openwsman/tree/pydist. Building the modules can be done by running python setup.py build from within the bindings/python/pywsman directory.

Secondly, are you happy for me to upload my existing source distribution (of 2.4.3) to the Python package archive, at http://pypi.python.org?

Thanks,
Ahmad


Notice:  This email is confidential and may contain copyright material of members of the Ocado Group. Opinions and views expressed in this message may not necessarily reflect the opinions and views of the members of the Ocado Group. 

 

If you are not the intended recipient, please notify us immediately and delete all copies of this message. Please note that it is your responsibility to scan this message for viruses. 

 

Fetch and Sizzle are trading names of Speciality Stores Limited, a member of the Ocado Group.

 

References to the “Ocado Group” are to Ocado Group plc (registered in England and Wales with number 7098618) and its subsidiary undertakings (as that expression is defined in the Companies Act 2006) from time to time.  The registered office of Ocado Group plc is Titan Court, 3 Bishops Square, Hatfield Business Park, Hatfield, Herts. AL10 9NE.


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Python package for pywsman Python bindings

Klaus Kaempf
* Ahmad Jagot <[hidden email]> [May 06. 2015 19:06]:
> Hi,
>
> I’ve been working on generating a native Python package for the openwsman
> Python bindings. This has a number of advantages. the main ones being
> potential availability on the Python Package Index (http://pypi.python.org),
> and compatibility with virtualenvs.

Great ! I'm looking forward to your pull request on GitHub ;-)

[...]
>
> >>> import pywsman
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "pywsman.py", line 28, in <module>
>     _pywsman = swig_import_helper()
>   File "pywsman.py", line 24, in swig_import_helper
>     _mod = imp.load_module('_pywsman', fp, pathname, description)
> ImportError: ./_pywsman.so: undefined symbol: wsmc_add_property_epr

Looks like a version mixup. wsmc_add_property_epr() was added after
2.4.9 and is not available in 2.4.3

You're probably building with 2.4.14 SWIG files but have 2.4.3
libraries installed.

[...]
>
> Is it possible to find out the actual swig command and options that re used
> to generate the Python bindings?

Look here
https://github.com/Openwsman/openwsman/blob/master/bindings/python/CMakeLists.txt#L26

SWIG_INPUT is defined at
https://github.com/Openwsman/openwsman/blob/master/bindings/CMakeLists.txt#L7
and SWIG_OUTPUT at
https://github.com/Openwsman/openwsman/blob/master/bindings/python/CMakeLists.txt#L21

>
> My current work on this can be found here:
> https://github.com/ocadotechnology/openwsman/tree/pydist. Building the
> modules can be done by running python setup.py build from within the
> bindings/python/pywsman directory.

This works fine on my system (which has 2.4.14 installed)

>
> Secondly, are you happy for me to upload my existing source distribution
> (of 2.4.3) to the Python package archive, at http://pypi.python.org?

Please update to the latest released version (2.4.14) first ;-)


Klaus
--
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Openwsman-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openwsman-devel
Loading...