tennom / saxonpy

This's a Python package for the Saxon/C 1.2.1, an XML processor from Saxonica. Currently, it packs the open-source version or the home edition.
16 stars 1 forks source link

SaxonC 12.1 pypi packaging help #4

Open ond1 opened 2 years ago

ond1 commented 2 years ago

Hi @tennom

I have used your ideas from this project to try and build a pypi wheel package for SaxonC 12.1, which uses a graalvm shared library. I am struggling a bit with how to link the shared library into the wheel. Also I would like to get some pointers as to how you use manylinux to build the wheels for different python version. Is it possible we can discuss this please?

tennom commented 2 years ago

Hi @ond1, Glad to hear from you. Me too, I packaged your new release a while ago and it has worked fine. Maybe some slight updates are needed in the test code. Anyways, here is how I included and linked the libs in the wheel.

  1. Copy all the libs in the saxon_home dir.
  2. Make the build include the dir by setting up the include=True in setup.py and MANIFEST.in.
  3. then set the saxon_home dir in Python environment in /src/init.py. Please check the more updated version in the Windows version.

As for Manylinux, I use the docker image and wheels in the container I think. I also used the Github Workflows to automate the process so please check those files as well. We can't expect the running system has any preinstalled libs so we need to move libjvm into the same dir we created earlier. Programs like AuditWheel and Desolate will do some parts but we need to do manually the rest. Remember to change the lib paths for Mac and Linux, otherwise, it will still complain of missing libs.

ond1 commented 2 years ago

Do you change the lib paths for Mac and Linux within the PyPI package which get set in there install process? Or is something you do manually after running 'pip install'

tennom commented 2 years ago

No manual setup after installing the package. It should work out of the box as any pip package. They have to be changed before you build. If you check the GitHub workflows file, you will see Mac's 'install_name_tool' which does that precisely. For Linux, there was a generic way to make the dir as lib path, I think.


From: ond1 @.> Sent: Friday, October 14, 2022 1:40:17 PM To: tennom/saxonpy @.> Cc: Tennom @.>; Mention @.> Subject: Re: [tennom/saxonpy] SaxonC 12.1 pypi packaging help (Issue #4)

Do you change the lib paths for Mac and Linux within the PyPI package which get set in there install process? Or is something you do manually after running 'pip install'

— Reply to this email directly, view it on GitHubhttps://github.com/tennom/saxonpy/issues/4#issuecomment-1278510014, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACCVVBBZJWP2YMXGBHHQSODWDDW4DANCNFSM6AAAAAAREEOBRI. You are receiving this because you were mentioned.Message ID: @.***>

ond1 commented 2 years ago

Great thanks.