h3-py icon indicating copy to clipboard operation
h3-py copied to clipboard

install location not inside site-packages

Open wingkitlee0 opened this issue 1 year ago • 4 comments

I noticed that h3-py was not installed correctly into the site-packages/, which causes a bunch of h3-related source files in a "root" python folder. This happened when I tried to remove packages (pip uninstall h3):

Found existing installation: h3 3.7.7
Uninstalling h3-3.7.7:
  Would remove:
    /home/wklee/.pyenv/versions/3.12.2/envs/py312/CHANGELOG.md
    /home/wklee/.pyenv/versions/3.12.2/envs/py312/CMakeLists.txt
    /home/wklee/.pyenv/versions/3.12.2/envs/py312/LICENSE
    /home/wklee/.pyenv/versions/3.12.2/envs/py312/include/h3/h3api.h
    /home/wklee/.pyenv/versions/3.12.2/envs/py312/lib/cmake/h3/h3Config.cmake
...

However, other packages (e.g., pip uninstall numpy) give

Found existing installation: numpy 1.26.4
Uninstalling numpy-1.26.4:
  Would remove:
    /home/wklee/.pyenv/versions/3.12.2/envs/py312/bin/f2py
    /home/wklee/.pyenv/versions/3.12.2/envs/py312/lib/python3.12/site-packages/numpy-1.26.4.dist-info/*
    /home/wklee/.pyenv/versions/3.12.2/envs/py312/lib/python3.12/site-packages/numpy.libs/libgfortran-040039e1.so.5.0.0
    /home/wklee/.pyenv/versions/3.12.2/envs/py312/lib/python3.12/site-packages/numpy.libs/libopenblas64_p-r0-0cf96a72.3.23.dev.so
    /home/wklee/.pyenv/versions/3.12.2/envs/py312/lib/python3.12/site-packages/numpy.libs/libquadmath-96973f99.so.0.0.0
    /home/wklee/.pyenv/versions/3.12.2/envs/py312/lib/python3.12/site-packages/numpy/*

I tried this on different environments, including my windows env and still see it..

wingkitlee0 avatar May 27 '24 22:05 wingkitlee0

Hmmm, good catch @wingkitlee0. That's weird. Off the top of my head, I'm not sure why that's happening, but it does seem wrong.

I can try to take a look when I have time, but I'd be more than happy if anyone else looks into this in the meantime. :)

ajfriend avatar May 27 '24 23:05 ajfriend

This is an old bug in skbuild related to MANIFEST.in. https://github.com/scikit-build/scikit-build/issues/680 which seems to be not fixed fully (PR was reverted)

In other packages, they simply use package_data directly: https://github.com/Qiskit/qiskit-aer/pull/1677

P.S. I noticed this when I was trying to grab the h3api.h ..

wingkitlee0 avatar May 27 '24 23:05 wingkitlee0

Nice. Would you be willing to put up a PR to fix?

In the long term, I think we could also try to modernize the build, as in https://github.com/uber/h3-py/issues/340

ajfriend avatar May 28 '24 17:05 ajfriend

Sure, I can try.

wingkitlee0 avatar May 28 '24 22:05 wingkitlee0

I believe this is resolved.

wingkitlee0 avatar Nov 09 '24 16:11 wingkitlee0