Opened 9 years ago

Closed 2 years ago

#5437 closed Bug (wontfix)

Make GDAL optional for GIS test runner

Reported by: Robert Coup Owned by: Vishal Lal
Component: GIS Version: master
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 9 years ago.

Download all attachments as: .zip

Change History (11)

Changed 9 years ago by Robert Coup

Attachment: tests_remove_gdal_dep.patch added

comment:1 Changed 9 years ago by Adrian Holovaty

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Version: SVNgis

comment:2 Changed 9 years ago by jbronn

Resolution: fixed
Status: newclosed

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

comment:3 Changed 3 years ago by Shai Berger

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 Changed 3 years ago by Alex Gaynor

Triage Stage: UnreviewedAccepted

comment:5 Changed 2 years ago by Vishal Lal

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

comment:6 Changed 2 years ago by Vishal Lal

Owner: changed from nobody to Vishal Lal
Status: newassigned

comment:7 Changed 2 years ago by Claude Paroz

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 Changed 2 years ago by Vishal Lal

Cc: Vishal Lal added

comment:9 Changed 2 years ago by Vishal Lal

Posted on django-dev mailing list here

comment:10 Changed 2 years ago by Tim Graham

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