Feature #5168
closed![Author: Al S](https://www.gravatar.com/avatar/bfad9c247f8c8df99833733142440c59?rating=PG&size=50&default=https%3A%2F%2Fassets.plan.io%2Fimages%2Fdefault_avatar.png)
Creation of PyPI Packages
100%
Description
I have had wanted to build Python tooling with the Saxon/C module and SWIG bindings and many colleagues find the library installation process tedious because it does not involve a simple pip install saxon
command. In the past, assembling binary dependencies was harder, but now much simpler with the use of Python wheel deployments and improved tooling.
Would Saxon developers be willing to work towards installation in PyPI, like SaxonJS is in NPMJS? If not, given the MPL licensing, is it acceptable for community member like myself to do so (with your permission) without significant effort to modify branding if required?
Related issues
Updated by O'Neil Delpratt almost 3 years ago
- Is duplicate of Feature #4375: Create a PIP installable Python package added
Updated by O'Neil Delpratt almost 3 years ago
Thanks for raising this issue. We'd prefer this to be done by Saxonica rather than a third party, but would appreciate any help you can offer.
Updated by Al S almost 3 years ago
O'Neil Delpratt wrote:
Thanks for raising this issue. We'd prefer this to be done by Saxonica rather than a third party, but would appreciate any help you can offer.
Ok how can we proceed with that? Do you have some kind of CI/CD infrastructure such that, one a release is ready, and it will build the code and run additional steps to prepare the compressed archive on the website? I can work with you on examples with shell script, Makefile build steps, but how we approach this for the community largely depends on the tooling you use and what you are comfortable with.
Updated by O'Neil Delpratt almost 3 years ago
Hi, Lets discuss this next week. Probably best to continue discussion via email (oneil@saxonica.com) and on a Zoom/MS Team meeting.
Updated by Al S almost 3 years ago
O'Neil Delpratt wrote:
Hi, Lets discuss this next week. Probably best to continue discussion via email (oneil@saxonica.com) and on a Zoom/MS Team meeting.
Sounds good.
Updated by O'Neil Delpratt almost 3 years ago
- Status changed from New to AwaitingInfo
Hi, trying to reach out to you, but cannot see your email.
Updated by Al S over 2 years ago
O'Neil Delpratt wrote:
Hi, trying to reach out to you, but cannot see your email.
I am sorry about that, I dropped the ball here. Sending you an email.
Updated by O'Neil Delpratt almost 2 years ago
- Status changed from AwaitingInfo to In Progress
I thought I would update this bug issue on pypi since it has been a while. I have had some success in building a pypi package for SaxonC 12.1 (not yet released) for a local server. I have used the github project for saxonpy as a starting place.
For SaxonC 12.1 the library has been built using graalvm's native-image
, which builds a shared library required for the C++ API and therefore the python extension linking at execution time.
Updated by O'Neil Delpratt almost 2 years ago
For the python extension to work the shared library created by native-image
has to be copied in the /usr/lib directory instead of the pip default location. This is not ideal. I am still investigating how to change the setup.py to have the library in the correct location.
Updated by O'Neil Delpratt almost 2 years ago
See error:
ImportError: /home/ond1/.local/lib/python3.8/site-packages/saxonc.cpython-38-x86_64-linux-gnu.so: undefined symbol: j_callTemplateReturningValue
I found this forum post similar to my problem: https://stackoverflow.com/questions/72052512/importerror-so-cannot-open-shared-object-file-after-pip-installing-extensi
Updated by O'Neil Delpratt almost 2 years ago
I have managed to solve my issue on loading the graalvm shared library. See solution below:
extra_link_args = []
if system() == 'Darwin':
saxon_home = 'libs/darwin'
else:
saxon_home = 'libs/nix'
extra_link_args.append('-Wl,-rpath,' + saxon_home)
ext_modules = [Extension(
"saxonc",
sources=[ ..., extra_link_args = extra_link_args,
libraries=['saxon-eec-12.1'], ... ), ... ]
Updated by Martin Honnen almost 2 years ago
Will there also be a wheel for Windows? Just wondering and asking, admittedly I don't understand details of those scripts but
if system() == 'Darwin':
saxon_home = 'libs/darwin'
else:
saxon_home = 'libs/nix'
sounds as if Windows is not on the list.
Updated by O'Neil Delpratt almost 2 years ago
Yes we plan to provide a wheel for windows too. Something like the following: https://github.com/tennom/saxonpy-win
Updated by O'Neil Delpratt over 1 year ago
- Category set to Python Build
- % Done changed from 0 to 100
- Fixed in version set to 12.0
Happy to report that we have released SaxonC pypi package. See: https://pypi.org/user/saxonica/
This is available on a number of platforms and distributions including windows, Linux and MacOS. Therefore I am marking this bug issue as closed.
Updated by O'Neil Delpratt over 1 year ago
- Status changed from In Progress to Closed
Please register to edit this issue