Opened 17 years ago

Closed 10 years ago

#5437 closed Bug (wontfix)

Make GDAL optional for GIS test runner

Reported by: Robert Coup Owned by: Vishal Lal
Component: GIS Version: dev
Severity: Normal Keywords: testing
Cc: Vishal Lal Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In a similar vein to #5433, its pretty easy to make GDAL optional for the GIS test runner.

Attached patch prints a message to stderr if GDAL can't be imported, and continues with the other tests.

Attachments (1)

tests_remove_gdal_dep.patch (1.1 KB ) - added by Robert Coup 17 years ago.

Download all attachments as: .zip

Change History (11)

by Robert Coup, 17 years ago

Attachment: tests_remove_gdal_dep.patch added

comment:1 by Adrian Holovaty, 17 years ago

Version: SVNgis

comment:2 by jbronn, 17 years ago

Resolution: fixed
Status: newclosed

(In [6240]) gis: Fixed #5437 with patch from rcoup.

comment:3 by Shai Berger, 11 years ago

Easy pickings: unset
Keywords: testing added; sprint removed
Resolution: fixed
Severity: Normal
Status: closednew
Type: Bug
UI/UX: unset
Version: gismaster

This has apparently made a comeback; when running the tests without GDAL on master now, I get:

Importing application geoadmin
Traceback (most recent call last):
  File "runtests.py", line 379, in <module>
    options.failfast, args)
  File "runtests.py", line 198, in django_tests
    state = setup(verbosity, test_labels)
  File "runtests.py", line 172, in setup
    app_config.import_models(apps.all_models[app_config.label])
  File ".../django/apps/base.py", line 160, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File ".../django/contrib/gis/tests/geoadmin/models.py", line 19, in <module>
    admin.site.register(City, admin.OSMGeoAdmin)
AttributeError: 'module' object has no attribute 'OSMGeoAdmin'

OSMGeoAdmin requires GDAL, and it is used unconditionally in a test.

As far as I could see, this goes back to the introduction of the geoadmin/models.py file, back in September 2011, so although it is a regression, it has probably been this way since 1.4. On one hand, this means it is not a release blocker; on the other hand, this probably justifies backporting the fix to all the live versions.

comment:4 by Alex Gaynor, 11 years ago

Triage Stage: UnreviewedAccepted

comment:5 by Vishal Lal, 11 years ago

Issued Pull Request #5437. Verified tests either pass or skip when necessary.

comment:6 by Vishal Lal, 11 years ago

Owner: changed from nobody to Vishal Lal
Status: newassigned

comment:7 by Claude Paroz, 11 years ago

Thanks for the patch. But frankly, when I see that, I'm really tempted to make GDAL a required part of our GIS infrastructure. I think that in the past, GDAL was not so easily installable, but that limitation may be moot now. It might be worth debating this on django-dev mailing list.

comment:8 by Vishal Lal, 11 years ago

Cc: Vishal Lal added

comment:9 by Vishal Lal, 11 years ago

Posted on django-dev mailing list here

comment:10 by Tim Graham, 10 years ago

Resolution: wontfix
Status: assignedclosed

Given the lack of interest, I'm going to close this as "won't fix."

Note: See TracTickets for help on using tickets.
Back to Top