mcab / hiber

API for Bat House SDP
GNU General Public License v3.0
0 stars 1 forks source link

Add House and HouseInformation model #15

Closed mcab closed 5 years ago

mcab commented 5 years ago

Addresses #5.

mcab commented 5 years ago

Wow, that sucked.

For the record, CircleCI's Postgres images do install gdal-dev and gdal, but Django specifically looks for library files that GDAL uses.

This leads to having to install libgdal-dev so that Django does not fail when trying to execute.

django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried "gdal", "GDAL", "gdal2.2.0", "gdal2.1.0", "gdal2.0.0", "gdal1.11.0", "gdal1.10.0", "gdal1.9.0"). Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings.
ERROR: InvocationError for command '/home/circleci/repo/.tox/py37/bin/pytest' (exited with code 1)

Would it be easier to use another image? Yes. But none suits the needs currently.

Right now, python-gdal seemed to be the best bet (same Python version we're testing against, newest GDAL), but does not have the tools CircleCI installs in their default images.

docker-geodjango installs a similar toolset to CircleCI's (as noted on StackOverflow), but uses Python 3.6. We could downgrade, but that's another can of worms to not open.

It's probably easiest to include a pull request to have Python 3.7 installed and not 3.6 to docker-geodjango, but it's even easier to just install the dependencies at run time, for now.


I tried:

  1. using a different PostGIS image (did not work)
  2. using wooyek/geodjango (too old of a Python version)
  3. bumping the version requirement for the CircleCI image (did not work, GDAL_LIBRARY_PATH not found)
  4. setting the environment variables for GDAL_LIBRARY_PATH (not the correct place to add to path)
  5. twice (still not the right dependency)
  6. Installing libgdal-dev directly (worked!)
mcab commented 5 years ago

With that change, this closes #20, once it's merged in.