#25011: Running unit tests on Mac takes me down a GDAL installation rabbit hole --------------------------------------+-------------------- Reporter: nedbat | Owner: nobody Type: Cleanup/optimization | Status: new Component: Testing framework | Version: 1.8 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Easy pickings: 0 | UI/UX: 0 --------------------------------------+-------------------- I wanted to run the unit tests on my Mac. I followed the instructions:
{{{ [:/src/django/nedbat/tests] master ± mkvirtualenv django New python executable in django/bin/python Installing setuptools, pip...done. [:/src/django/nedbat/tests] [django] master ± pip install -r requirements/py2.txt ... many lines elided ... Successfully installed bcrypt docutils jinja2 numpy Pillow PyYAML pytz selenium sqlparse python-memcached mock cffi six markupsafe pycparser Cleaning up... [:/src/django/nedbat/tests] [django] master ± PYTHONPATH=..:$PYTHONPATH ./runtests.py Testing against Django installed in '/src/django/nedbat/django' Traceback (most recent call last): File "./runtests.py", line 435, in <module> options.debug_sql) File "./runtests.py", line 239, in django_tests state = setup(verbosity, test_labels) File "./runtests.py", line 218, in setup apps.set_installed_apps(settings.INSTALLED_APPS) File "/src/django/nedbat/django/apps/registry.py", line 318, in set_installed_apps self.populate(installed) File "/src/django/nedbat/django/apps/registry.py", line 108, in populate app_config.import_models(all_models) File "/src/django/nedbat/django/apps/config.py", line 198, in import_models self.models_module = import_module(models_module_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/src/django/nedbat/tests/gis_tests/models.py", line 10, in <module> from django.contrib.gis.db import models File "/src/django/nedbat/django/contrib/gis/db/models/__init__.py", line 5, in <module> from django.contrib.gis.db.models.aggregates import * # NOQA File "/src/django/nedbat/django/contrib/gis/db/models/aggregates.py", line 1, in <module> from django.contrib.gis.db.models.fields import ExtentField File "/src/django/nedbat/django/contrib/gis/db/models/fields.py", line 4, in <module> from django.contrib.gis.gdal.raster.source import GDALRaster File "/src/django/nedbat/django/contrib/gis/gdal/raster/source.py", line 6, in <module> from django.contrib.gis.gdal.driver import Driver File "/src/django/nedbat/django/contrib/gis/gdal/driver.py", line 5, in <module> from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi File "/src/django/nedbat/django/contrib/gis/gdal/prototypes/ds.py", line 9, in <module> from django.contrib.gis.gdal.libgdal import lgdal File "/src/django/nedbat/django/contrib/gis/gdal/libgdal.py", line 45, in <module> '", "'.join(lib_names)) django.contrib.gis.gdal.error.GDALException: Could not find the GDAL library (tried "gdal", "GDAL", "gdal1.11.0", "gdal1.10.0", "gdal1.9.0", "gdal1.8.0", "gdal1.7.0"). Try setting GDAL_LIBRARY_PATH in your settings. }}} A quick look at how to install gdal lead to scary pages, and a requirement to install GEOS, etc. Looking at tests/gis_tests/models.py, it looks like it's trying to neuter itself if the GIS requirements aren't installed, but I guess it isn't doing it well enough? I'd be glad to hack on making this better if someone could guide me on the philosophy to follow. -- Ticket URL: <https://code.djangoproject.com/ticket/25011> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/049.ecad207403963db67aca2009d72c5168%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.