-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Building wheels for Windows #48
Comments
Yay! It works flawlessly on my machine in a fresh conda env with |
How long does it take? The GHA docs say that
It should not take longer that that. I think that we need to manually set higher timeout in the workflow but I guess we'll fit in 6 hours. |
Yeah, 6 hours should be enough :) (on my machine, it took more than an hour) |
One thing I realized is that the current wheel is missing is the "gdal data" and "proj data" (the Fiona wheel contains this in the |
Is it possible that we don't actually need gdal data and proj data? We are only getting or setting CRS info, but not reprojecting anything. I don't know if the gdal / proj data are used to encode / decode CRS from the underyling driver to CRS WKT. |
I was assuming that it would need that, at least for eg |
Doing a first attempt to put this in a github actions workflow -> #49 (and it only took less than an hour to build gdal core! and it gets cached after the first time). |
If people want to test the latest version of the wheels, you can download the archive with wheels from https://github.com/geopandas/pyogrio/suites/5620607087/artifacts/183019252. |
This has been completed for 0.4.0 |
@jorisvandenbossche The link to the archive with wheels is not working. Could you tell me the right link? I'm looking for the gdal 3.5.3 wheel for windows. Thank you.
|
@RitaAguiarAdsk We haven't yet released wheels with 3.5.x to pypi; sorry about that. I just triggered a fresh build of the release workflow, which regenerated Windows wheels here: https://github.com/geopandas/pyogrio/actions/runs/3576011156 |
I have been looking a bit into the option to use vcpkg to get the GDAL binaries necessary for wheel building, and then combined with cibuildwheel for the wheel building automation.
Vcpkg is a "cross-platform C/C++ package manager" (using installation from source not providing binaries), and provides a recipe or "port" for GDAL: https://vcpkg.info/port/gdal (which allows you to install GDAL from source on windows with a basic
vcpkg install gdal
).In Apache Arrow, we are also using it for building the wheels (and pyarrow also has a notoriously complex wheel, similar to requiring GDAL), and so in principle we could also use it for the other platforms (linux, mac) as well, and not just for windows (I just started with windows, since for the other platforms we could in principle start with mimicking fiona's wheel building infrastructure).
I suppose there are also other options for building wheels on Windows, by getting the binaries from elsewhere (eg https://www.gisinternals.com/, https://github.com/gisinternals/buildsystem/tree/refactor). But I also don't have any idea how easy that would be compared to vcpkg (which has the potential to give us a somewhat consistent build setup for all platforms).
Yesterday, I finally had some first success while trying out this workflow on a local windows machine. See my branch at https://github.com/jorisvandenbossche/pyogrio/tree/cibuildwheel-windows.
I managed to create a wheel, that seems to work, with the following steps:
vcpkg install gdal[core]:x64-windows
to install the minimal gdal buildpip install cibuildwheel
cibuildwheel --platform windows
With this, I created a single wheel for Python 3.9:
pyogrio-0.3.0+18.gefdca6d.dirty-cp39-cp39-win_amd64.zip
I needed to rename it to allow it to upload to this issue, so for testing it, you can download it, rename it and install it with pip:
From a quick test (installing it in a clean env), this seems to work, I was able to read a zipped shapefile! (a cautious 🎉)
For someone with a Windows machine, please test this wheel
Next steps
What I did locally, as described above, should in principle all be doable in CI using github actions as well. So the next step is trying to do that:
vcpkg install gdal[core]
takes quite a long time (even with the [core]), with the risk of timing out. So we will also certainly need to cache the built results, but for that of course need an initial successful build.vcpkg install
. I didn't directly find a way to only get the release build (which should speed things up), xref How do I tell vcpkg to only build the release version on the command line microsoft/vcpkg#10683.setuptools
toscikit-build
(which uses cmake) to build the C extensions of pyogrio itself.Help here would be very much appreciated!
The text was updated successfully, but these errors were encountered: