-
Notifications
You must be signed in to change notification settings - Fork 535
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
Use compile_time_env in place of shims #2016
Conversation
53f353b
to
37d25ad
Compare
37d25ad
to
58db89a
Compare
Can the GDAL 1.x stuff be removed? |
@snowman2 unfortunately I didn't warn about dropping support for GDAL 1.x when we released 1.1.0. I think we had better keep it around for one more minor version. |
@snowman2 I like simplicity! But we do have some complex needs. We currently include 4 shim .c modules in our source distributions. Will these directives cover our need to be able to build against 4 different categories of GDAL versions from one source distribution? |
That is a good point to bring up. This would probably make cython required to build rasterio from sdist. This shouldn't be an issue with the Relevant files:
With all of that in place, it should support various versions of GDAL from a single sdist. But, definitely should do some testing to ensure everything works as expected. That also means this PR likely needs some tweaks. |
@snowman2 let's do this after 1.2.0. It's close and I don't want to add anything else and risk pushing it out further. |
75d5bd5
to
bfff4e6
Compare
With #2064, the GDAL 1.x stuff can be removed. Correct? |
24dc498
to
8e16e0a
Compare
With #2064 I was able to remove the shim files entirely and move things into their respective modules. Seems the only compatibility stuff left is GDAL 3 related. |
8e16e0a
to
4056df1
Compare
b8d1b64
to
05de781
Compare
@sgillies any blockers remaining? |
@snowman2 I'll look at this soon. I need to switch my open source attention to fiona and shapely for a bit, but will get back to rasterio soon. |
I've branched |
@snowman2 have you seen https://mail.python.org/archives/list/[email protected]/message/2K3IKBD4K7INMVV3LK6SJY6EXDDNC2M2/? It's an author of Cython arguing for not making Cython a build dependency. I do appreciate not having to deal with unknown versions of Cython on user systems. |
@sgillies, that is definitely an interesting discussion he has there. He has some valid concerns. But, he does also lay out some reasons why you would want to have cython as a build dependency. For the downsides he has mentioned, I have yet to run into them with For the upside of using
Side note: The current build from source method for rasterio always uses |
Yeah, the author doesn't mention build isolation or the fact that we can pin the cython version in pyproject.toml (like https://github.com/pyproj4/pyproj/blob/master/pyproject.toml#L3). I'm more in favor but still want to reflect on this a bit. |
@@ -36,3 +36,6 @@ cdef class DatasetBase: | |||
cdef const char *get_driver_name(GDALDriverH driver) | |||
cdef OGRSpatialReferenceH _osr_from_crs(object crs) except NULL | |||
cdef _safe_osr_release(OGRSpatialReferenceH srs) | |||
cdef void osr_set_traditional_axis_mapping_strategy(OGRSpatialReferenceH hSrs) | |||
cdef const char* osr_get_name(OGRSpatialReferenceH hSrs) | |||
cdef GDALDatasetH open_dataset(object filename, int mode, object allowed_drivers, object open_options, object siblings) except NULL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
IF CTE_GDAL_MAJOR_VERSION >= 3: | ||
OSRSetAxisMappingStrategy(hSrs, OAMS_TRADITIONAL_GIS_ORDER) | ||
ELSE: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
paths = CSLAddString(paths, path_c) | ||
OSRSetPROJSearchPaths(paths) | ||
ELSE: | ||
os.environ["PROJ_LIB"] = path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
'-o', 'rasterio/_shim30.c']) | ||
|
||
print(_) | ||
sdist.run(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@snowman2 alright, let's do this! Thank you very much.
Reference:
Is this something you would be interested in? I was thinking it might simplify things.