FEAST icon indicating copy to clipboard operation
FEAST copied to clipboard

Update the python setup.

Open barbacbd opened this issue 3 years ago • 2 comments

** New versions of Python (3.10) were having issues witht the LICENSE reference. Changed to use the setup.cfg file instead which appears to have more flexibility.

** Removed the make commands from setup.py. It wasn't referencing the correct files.

barbacbd avatar Aug 29 '22 13:08 barbacbd

@Craigacp PTAL

barbacbd avatar Sep 21 '22 12:09 barbacbd

As Python doesn't have namespacing in PyPI then using feast is going to collide with https://pypi.org/project/feast/ if they are installed together. So the package should probably be renamed to fstoolbox or something similar.

Craigacp avatar Sep 21 '22 14:09 Craigacp

@Craigacp I was able to package the data in a whl. This can be uploaded to pypi. This is an individual package so when someone wants to use the python stuff they don't need to install the C libraries manually.

We can set this up with a github action to automatically push to pypi when you release.

Please let me know if you need help with that (but based on your current settings I may not be allowed to add actions).

barbacbd avatar Nov 18 '22 18:11 barbacbd

Ok, that's good. I've not published anything on PyPI before, and I suspect that'll take a few attempts to get going.

The Makefiles for MIToolbox and FEAST currently dump the libraries in relatively unhelpful places, and I'm not sure if it would work on Windows & macOS, though presumably it's working on Linux where you are testing it. In my experience when distributing binaries people invariably want it in a platform which it isn't currently built for, this has happened for basically everything I've shipped binaries for at work and for open source things too. As a result I'll see how it behaves on Windows x86 & macOS (x86 and ARM64) before turning any of that on.

Craigacp avatar Nov 21 '22 01:11 Craigacp

Sounds good. I am seeing some issues with trying to upload a linux wheel to pypi. This build will work locally on linux though. It appears some of the linked libraries are causing issues. I will try to figure that out in the meantime

barbacbd avatar Nov 21 '22 13:11 barbacbd

@Craigacp I was able to successfully push this to pypi. You can find the page here: https://pypi.org/project/fstoolbox/. I haven't been able to get the CI to work with python3.6, 3.7 or 3.8 yet. The Image that CI is using must have too new of libraries. I think we can open another PR for something like that. Right now, CI will only work on my branch (for this PR). This is a super simple fix that we can make in the future. Let me know what you think about this! Also sorry for the mass commits. I tried to interactive rebase and its really messing up due to a change I pulled in from the master branch. We can squash some later if needed.

-- Edit -- Well it was working, but now the shared objects aren't properly installed (so it's not done yet).

barbacbd avatar Dec 09 '22 20:12 barbacbd

@Craigacp Looks like I was able to get it to work. The pypi version 0.0.2 should work on a linux system. We can play with windows later.

barbacbd avatar Dec 10 '22 16:12 barbacbd

How does this end up packaging the whl? It looks like there are a few extra so files created (in the Python 3.11 version which I pulled down from PyPI), in addition to libMIToolbox.so and libFSToolbox.so. There might also be a duplicate copy of libMIToolbox.so in fstoolbox.libs/libMIToolbox-423b447f.so.

Craigacp avatar Dec 12 '22 02:12 Craigacp

I ran pip install fstoolbox in Python 3.10 in a Ubuntu 20.04 VM and it's unpacked the wheel over venv/lib/python3.10/site-packages in a way that means it can't find libFSToolbox.so.

>>> from fstoolbox import CMIM
failed to find libFSToolbox.so

Craigacp avatar Dec 12 '22 04:12 Craigacp

I am still working on that. It looks like pypi isn't able to see the multiple whls even though I can see that they were pushed. I may have to try a manylinux1 whl which didnt work the first couple of times. I was able to see 3.10 work I will have to play with that one. I had to rewrite it a bit to find the so files since pypi wont allow me to install to /usr/lib. There are a couple of things we can try. Its close but not there apparently.

barbacbd avatar Dec 12 '22 16:12 barbacbd

Given it's a fairly simple C project it might be easier to run the build of both C libraries with distutils which should understand how to package things. It may be doing that already given there are so files packaged in there, but the CDLL mechanism isn't finding them properly.

Craigacp avatar Dec 12 '22 16:12 Craigacp