Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems running the test suite locally #86

Open
dyve opened this issue Mar 12, 2017 · 7 comments
Open

Problems running the test suite locally #86

dyve opened this issue Mar 12, 2017 · 7 comments

Comments

@dyve
Copy link

dyve commented Mar 12, 2017

I'm trying to make a PR for more flexible GeoJSON views, but the there is no description on how to run local tests.

Apparently tox needs all sorts of additional installs. If you could document or automate the process, that would be much appreciated.

@Gagaro
Copy link
Member

Gagaro commented Mar 13, 2017

Hi @dyve ,

You can run the test locally (and install the dependencies) with the following commands (run them in a virtualenv):

$ pip install -e '.[field]'
$ pip install Django==1.10.6
$ python quicktest.py djgeojson

You will also need spatialite to run the tests. There are more information about it in the Django documentation.

@dyve
Copy link
Author

dyve commented Mar 14, 2017

I know it's not a django-geojson issue, but perhaps someone here know. Installing spatialite through brew works just fine (spatialite command work), but running the tests gives
'The pysqlite library does not support C extension loading. ' django.core.exceptions.ImproperlyConfigured: The pysqlite library does not support C extension loading. Both SQLite and pysqlite must be configured to allow the loading of extensions to use SpatiaLite.

Any clues?

@Gagaro
Copy link
Member

Gagaro commented Mar 14, 2017

Are you using python2 or 3?

For 2 you need to install pysqlite with the extension support: git+git://github.com/tinio/pysqlite.git@extension-enabled#egg=pysqlite

I don't think I had anything to do with python3. It depends on how it was compiled I guess.

@dyve
Copy link
Author

dyve commented Mar 14, 2017

Tried both 2 and 3. Seems to be some issue with sqlite on Mac and homebrew. Will try another method.

@dyve
Copy link
Author

dyve commented Mar 14, 2017

Stuck on this. Asked on StackOverflow, I'm probably missing something. http://stackoverflow.com/questions/42780960/stuck-on-pyenv-with-django-sqlite-and-pysqlite-with-spatialite

@AchilleAsh
Copy link
Contributor

Hi @dyve ,

Had the same issue on Opensuse Leap (bug : https://bugzilla.opensuse.org/show_bug.cgi?id=999296 ) with Python 3. The problem (at least in my case) is a specific Python compilation flag which can be missing on some distros (Opensuse Leap is missing it, however Opensuse Tumbleweed, Debian and Centos have it)
You should check your Python compilation flags which seem to be missing the "--enable-loadable-sqlite-extensions", this can be done in the Python shell with a command . I had to recompile Python myself with the flag enabled to make it works on Leap.
The other solution is to use a VM with Centos or Debian, as they both have Python compiled with this flag.

@dyve
Copy link
Author

dyve commented Mar 27, 2017

My issue is specifically on Mac. I don't mind hacking some stuff together with brew etc, but I'm completely and utterly stooped at how hard it is to get spatialite running.

BTW, what I intend to contribute to this project is to make the GeoJsonView work more like a regular view, so take querysets and other lists instead of just a model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants