-
Notifications
You must be signed in to change notification settings - Fork 124
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
Include spatialindex headers #292
Include spatialindex headers #292
Conversation
All the CI checks appear to be passing now! Please let me know if you have any requested changes or would like me to tidy the git history, etc |
I'll admit I'm anxious about this change. Is it usual procedure for wheel builders to install header files and advertise their libraries for linkage? Are there other examples of this? It would seem to me to be a rather fraught policy. |
I'm not saying it 100% justifies the practise, but |
Thanks for the PR! As for the analog with NumPyh, I see headers in As for this PR, I see two behaviors:
Is this expected? (I think so, but just checking). |
I think this is the correct behaviour, my intention being that if the libspatialindex being used is not installed by Rtree, then it is either
If, however, the libspatialindex being used is the one included in a binary distribution of Rtree, currently the headers aren't included. In this PR those headers are not in a particularly discoverable place, hence the The PR itself is largely motivated by our desire to perform automatic code generation using libspatialindex, the same way we do with |
Not wanting to be impatient, just want to check the status of this PR 🙂 I think we are in very different time zones, so I appreciate communication might take more time! |
I've been thinking more about headers for sdist and bdist. The shared library is only bundled with the bdist, so perhaps headers should only be included with these builds? Whereas the sdist doesn't imply any specific version of libspatialindex, thus shouldn't need to include headers. |
Thanks for the feedback, I will address this as soon as I get a chance. In the sdist case I imagine that the best thing for the |
8886485
to
002c3a4
Compare
I realise that fixing this requires minimal changes. Because the diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index e43b341..274d8e8 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -138,6 +138,10 @@ jobs:
python3 -m pip install setuptools numpy pytest wheel
export PATH=$PATH:/home/runner/.local/bin
python3 setup.py sdist
+ - uses: actions/upload-artifact@v3
+ with:
+ name: sdist
+ path: dist/*.tar.gz
- uses: actions/download-artifact@v3
with: Regardless, I have fixed the |
Sorry if I didn't make this obvious, but I think I'm done here! Polite bump 🙂 |
I'm not enthusiastic about this but I'm not going to stand in the way. Because Mike has been so active with Rtree lately, I'd feel a lot more comfortable if he presses the button. |
Hi yes, I'm happy to go forward with some version of this PR, but will still need some time to do a more thorough review, so appreciate the time. I hope to find a bit more time over the week. |
Note that I've not forgotten this PR, and have a few local edits that I've made that I'll push here when I'm ready. |
Awesome! Thanks for the update 🙂 |
Ok, back on this for more questions. What is the purpose of import rtree
rtree.core.rt._name # /path/to/lib/libspatialindex_c.so.6 As for |
Back to @JDBetteridge for review. A summary of relevant changes:
Some other notes is that a binary wheel with lib and include is created via The built wheel artefacts can be found here, which can be downloaded unzipped and installed via pip. Any feedback welcome! |
Thanks @mwtoews! To answer your first question, I added
I'm very happy for this PR to be merged in its current state. I have run our CI on this branch today and everything is working as expected. |
The environ Thanks for testing and feedback! |
It would be great if the spatialindex headers could be included with the packaged binary wheel of Rtree. We have two projects that currently depend on spatialindex:
libspatialindex
when performing code generation and we hope to in the future transition to using the Python interface that Rtree provides.libspatialindex
, but is minimally maintained for users who depend on the functionality that this library provides.We would like to move away from building our own copy of spatialindex (twice!) to linking against the shared library packaged with Rtree. To be able to build the projects all we require are the spatialindex headers and the introspection functions that this PR provides.
For reference you can see how we would accomplish this in these PRs:
Please let me know your thoughts and suggestions 🙂