@@ -473,34 +473,63 @@ (define-public python-pytest-django
(define-public python-django-haystack
(package
(name "python-django-haystack")
- (version "3.1.1")
+ (version "3.2.1")
(source
(origin
(method url-fetch)
(uri (pypi-uri "django-haystack" version))
(sha256
- (base32
- "10kaa5641cakpra2x3jqgys085gdkjcyns26plfyrmfpjmmpa1bd"))))
- (build-system python-build-system)
+ (base32 "194kf9ps1h8bq8q32x6nniy85grl4l5605vgbd0gw9f2xxx1kqwp"))))
+ (build-system pyproject-build-system)
(arguments
'(#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'loosen-verion-restrictions
- (lambda _
- (substitute* "setup.py"
- (("geopy.*") "geopy\",\n"))))
- (add-before 'check 'set-gdal-lib-path
+ (add-before 'check 'set-lib-path
(lambda* (#:key inputs #:allow-other-keys)
- (setenv "GDAL_LIBRARY_PATH"
- (string-append (assoc-ref inputs "gdal")
- "/lib"))))
+ (setenv "LD_LIBRARY_PATH"
+ (string-append
+ (assoc-ref inputs "gdal") "/lib"
+ ":" (assoc-ref inputs "geos") "/lib"))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (begin
+ ;; Delete absent elasticsearch tests.
+ (delete-file-recursively "test_haystack/elasticsearch_tests")
+ (delete-file-recursively "test_haystack/elasticsearch2_tests")
+ (delete-file-recursively "test_haystack/elasticsearch5_tests")
+ (delete-file-recursively "test_haystack/elasticsearch7_tests")
+ ;; Solr tests require a running solr server.
+ ;; Deactivating solr.
+ (delete-file-recursively "test_haystack/solr_tests")
+ (delete-file "haystack/backends/solr_backend.py")
+ (delete-file
+ "haystack/management/commands/build_solr_schema.py")
+ (delete-file
+ "test_haystack/test_altered_internal_names.py")
+ (delete-file "test_haystack/multipleindex/tests.py")
+ (delete-file "test_haystack/spatial/test_spatial.py")
+ (substitute* "test_haystack/test_loading.py"
+ (("class ConnectionHandlerTestCase" all)
+ (string-append
+ "\nfrom nose.plugins.attrib import attr"
+ "\n@attr('skip')"
+ "\n" all)))
+ (substitute* "test_haystack/settings.py"
+ (("\"solr\":")
+ (string-append
+ "\"solr\": {\"ENGINE\": \"test_haystack.mocks.MockEngine\"}}"
+ "\n_={\"solr\":")))
+ ;; Run tests.
+ (invoke "django-admin"
+ "test" "--settings=test_haystack.settings"
+ "--pythonpath=.")))))
;; Importing this module requires setting up a Django project.
- (delete 'sanity-check))
- #:tests? #f)) ; OSError: libgdal.so.27: cannot open shared object file
+ (delete 'sanity-check))))
(propagated-inputs
(list python-django))
(native-inputs
- (list gdal
+ (list gdal geos
python-coverage
python-dateutil
python-geopy
@@ -508,7 +537,6 @@ (define-public python-django-haystack
python-nose
python-requests
python-setuptools-scm
- python-pysolr
python-whoosh))
(home-page "https://haystacksearch.org/")
(synopsis "Pluggable search for Django")