I am developing a python package called RivGraph. I've recently run into an issue related to geopandas' decision to overhaul CRS representation, as described here and here. The short of it is that in geopandas versions <0.7, crs's were stored as dictionaries of proj4 strings, e.g. {'init':'epsg:4326'}
. In geopandas 0.7 and moving forward, crs's are stored as pyproj objects, which are richer and more robust. Ok, great.
I share RivGraph as a conda-installable, and direct people to install it using conda to ensure all the dependencies are worked out. What I've discovered is that, depending on the user's platform, sometimes geopandas <0.7 is installed, and sometimes geopandas 0.7 is installed. So that leads me to ask this question:
What is the best way to make my package compatible with both of these versions of geopandas? I guess I realize that I can check the geopandas version in my package, and write if
statements that use one syntax vs. the other, but this seems tedious and ugly. I can't quite figure out if there is a single syntax that is compatible across both versions of geopandas when it comes to crs management.
conda create
a new environment with an up to date geopandas if users get conflicts trying to install your package in an existing environment.