Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package: mahotas #997

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

IsakTheHacker
Copy link
Contributor

@IsakTheHacker IsakTheHacker commented Oct 13, 2023

@mhsmith
Copy link
Member

mhsmith commented Oct 17, 2023

Thanks for the PR. To add a new package, we need a test script to verify that it works. Please do the following:

  • Follow the instructions in "Testing a package" in the README.
  • Push your test script to this PR.
  • Post a comment saying which Python versions and ABIs you have tested.

@mhsmith
Copy link
Member

mhsmith commented Nov 8, 2023

What's the status of this PR? Are the tests passing now?

@IsakTheHacker
Copy link
Contributor Author

It fails with this error:

2023-11-11 14:40:45.751 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  test_hitmiss (chaquopy.test.mahotas.TestMahotas) ... 
2023-11-11 14:40:45.754 22409-22409 Thread-4                com.chaquo.python.pkgtest3           W  type=1400 audit(0.0:2413): avc:  granted  { execute } for  path="/data/data/com.chaquo.python.pkgtest3/files/chaquopy/AssetFinder/requirements/chaquopy/lib/libc++_shared.so" dev="dm-40" ino=353721 scontext=u:r:untrusted_app_32:s0:c190,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c190,c256,c512,c768 tclass=file app=com.chaquo.python.pkgtest3
2023-11-11 14:40:45.754 22409-22409 Thread-4                com.chaquo.python.pkgtest3           W  type=1400 audit(0.0:2414): avc:  granted  { execute } for  path="/data/data/com.chaquo.python.pkgtest3/files/chaquopy/AssetFinder/requirements/mahotas/_bbox.so" dev="dm-40" ino=353718 scontext=u:r:untrusted_app_32:s0:c190,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c190,c256,c512,c768 tclass=file app=com.chaquo.python.pkgtest3
2023-11-11 14:40:45.910 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xd . Check the section C-API incompatibility at the Troubleshooting ImportError section at https://numpy.org/devdocs/user/troubleshooting-importerror.html#c-api-incompatibility for indications on how to solve this problem .
2023-11-11 14:40:45.911 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  Could not import submodules (exact error was: numpy.core.multiarray failed to import).
2023-11-11 14:40:45.911 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  
2023-11-11 14:40:45.911 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  There are many reasons for this error the most common one is that you have
2023-11-11 14:40:45.911 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  either not built the packages or have built (using `python setup.py build`) or
2023-11-11 14:40:45.912 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  installed them (using `python setup.py install`) and then proceeded to test
2023-11-11 14:40:45.912 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  mahotas **without changing the current directory**.
2023-11-11 14:40:45.912 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  
2023-11-11 14:40:45.912 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  Try installing and then changing to another directory before importing mahotas.
2023-11-11 14:40:45.912 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  ERROR
2023-11-11 14:40:45.913 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  
2023-11-11 14:40:45.913 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  ======================================================================
2023-11-11 14:40:45.913 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  ERROR: test_hitmiss (chaquopy.test.mahotas.TestMahotas)
2023-11-11 14:40:45.914 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  ----------------------------------------------------------------------
2023-11-11 14:40:45.914 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  Traceback (most recent call last):
2023-11-11 14:40:45.914 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W    File "/data/data/com.chaquo.python.pkgtest3/files/chaquopy/AssetFinder/app/chaquopy/test/mahotas.py", line 14, in test_hitmiss
2023-11-11 14:40:45.914 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W      mahotas.morph.hitmiss(A,Bc)
2023-11-11 14:40:45.914 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  AttributeError: module 'mahotas' has no attribute 'morph'
2023-11-11 14:40:45.914 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  
2023-11-11 14:40:45.914 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  ----------------------------------------------------------------------
2023-11-11 14:40:45.915 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  Ran 1 test in 0.163s
2023-11-11 14:40:45.915 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  
2023-11-11 14:40:45.916 22409-22565 python.stderr           com.chaquo.python.pkgtest3           W  FAILED (errors=1)

I don't know how to proceed further with this information, could you take a look at it?

@mhsmith
Copy link
Member

mhsmith commented Nov 17, 2023

You should probably replace the build requirement with a host requirement for Chaquopy's own version of NumPy. For example, see packages/pandas/meta.yaml.

You'll probably also need a patch similar to the one in the pandas recipe, so it can find the NumPy include directory during the build.

@IsakTheHacker
Copy link
Contributor Author

IsakTheHacker commented Nov 18, 2023

I have implemented your suggestions, but I can't currently build the package on my machine due to an issue with my local Python installation (and I don't have time to fix it at the moment). Could you build the wheel and run the tests to see if they are passing now?

@mhsmith
Copy link
Member

mhsmith commented Nov 18, 2023

There's no hurry, just let me know when you've had a chance to test it yourself.

@mhsmith
Copy link
Member

mhsmith commented Dec 9, 2023

Changing to draft until tests are ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mahotas not available
2 participants