Skip to content

Commit

Permalink
Merge pull request #16 from LegoStormtroopr/master
Browse files Browse the repository at this point in the history
1.6 update
  • Loading branch information
LegoStormtroopr authored Nov 2, 2017
2 parents 30b83da + 26c0419 commit 7c8fd68
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 60 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ nosetests.xml
# My stuff
# no vim temporary files.
*~
*.pyc
.*.sw[mnop]
*.db3
*.db
*.sqlite3
whoosh_index/

Expand Down
28 changes: 20 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
# Lets run on the new infrastructure
sudo: false

language: python
python:
- "2.7"
- "3.5"

services:
- postgresql

env:
- DJANGO=1.8
- DJANGO=1.10
- DJANGO_VERSION=1.8 DB=postgres ARISTOTLE_VERSION=1.6
- DJANGO_VERSION=1.10 DB=postgres ARISTOTLE_VERSION=1.6
- DJANGO_VERSION=1.10 DB=postgres ARISTOTLE_VERSION=develop

before_script:
# We only test elasticsearch, and a small setup time is recommended
- sleep 10;
- psql -c 'create database aristotle_test_db;' -U postgres

install:
- "pip install -r requirements.txt"
- "pip install -r requirements.test.txt"
- "pip install ."
- pip install -q Django==$DJANGO
- pip install tox

# command to run tests
script:
- coverage run --branch --source=aristotle_glossary manage.py test
- tox -e dj$DJANGO_VERSION-test-db-$DB-search-whoosh-aristotle$ARISTOTLE_VERSION --skip-missing-interpreters --workdir /tmp/tox
after_success:
- coveralls

matrix:
allow_failures:
- env: DJ=1.10 DB=postgres ARISTOTLE_VERSION=develop
51 changes: 4 additions & 47 deletions aristotle_glossary/tests/settings.py
Original file line number Diff line number Diff line change
@@ -1,56 +1,13 @@
import os, sys
from aristotle_mdr.required_settings import *
from aristotle_glossary.settings import *
BASE = os.path.dirname(os.path.dirname(__file__))

sys.path.insert(1,BASE)
sys.path.insert(1,os.path.join(BASE, "tests"))

SECRET_KEY = 'inara+vtkprm7@0(fsc$+grbz9-s+tmo9d)e#k(9uf8m281&$7xhdkjr'
SOUTH_TESTS_MIGRATE = True

MEDIA_ROOT = os.path.join(BASE, "media")

MEDIA_URL = '/media/'
CKEDITOR_UPLOAD_PATH = 'uploads/'

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}

class DisableMigrations(object):

def __contains__(self, item):
return True

def __getitem__(self, item):
return "notmigrations"

MIGRATION_MODULES = DisableMigrations()
from aristotle_mdr.tests.settings.settings import *
from aristotle_mdr.required_settings import INSTALLED_APPS

INSTALLED_APPS = (
#The good stuff
# The good stuff
'aristotle_glossary',
) + INSTALLED_APPS

HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
'PATH': os.path.join(BASE, 'aristotle_mdr/tests/whoosh_index'),
'INCLUDE_SPELLING':True,
},
}

# https://docs.djangoproject.com/en/1.6/topics/testing/overview/#speeding-up-the-tests
# We do a lot of user log in testing, this should speed stuff up.
PASSWORD_HASHERS = (
'django.contrib.auth.hashers.MD5PasswordHasher',
)

ARISTOTLE_SETTINGS['SEPARATORS']['DataElementConcept'] = '--'
ARISTOTLE_SETTINGS['CONTENT_EXTENSIONS'] = ARISTOTLE_SETTINGS['CONTENT_EXTENSIONS'] +['aristotle_glossary']

ROOT_URLCONF = 'aristotle_glossary.tests.urls'
ROOT_URLCONF = 'aristotle_glossary.tests.urls'
3 changes: 3 additions & 0 deletions aristotle_glossary/tests/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@

urlpatterns = [
url(r'^', include('aristotle_mdr.urls')),
url(r'^', include('aristotle_mdr.contrib.slots.urls', app_name="aristotle_slots", namespace="aristotle_slots")),
url(r'^browse/', include('aristotle_mdr.contrib.browse.urls')),
url(r'^help/', include('aristotle_mdr.contrib.help.urls', app_name="aristotle_help", namespace="aristotle_help")),
url(r'^glossary/', include('aristotle_glossary.urls',app_name="aristotle_glossary",namespace="glossary")),
]
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from setuptools import setup
from setuptools import setup, find_packages

with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
Expand All @@ -10,7 +10,7 @@
setup(
name='django-aristotle-glossary',
version='0.1-v1.2.0',
packages=['aristotle_glossary'],
packages=find_packages(),
include_package_data=True,
license='BSD Licence',
description='',
Expand All @@ -29,7 +29,7 @@
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
install_requires = [
'aristotle-metadata-registry>=1.5.0'
'aristotle-metadata-registry>=1.6.2'
]

)
70 changes: 70 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[tox]
skipsdist = True
envlist =
dj{1.8,1.10,1.11}-{test,manage}-db-{postgres,sqlite}-search-{elastic,whoosh}-aristotle{1.6,develop}
dj18-ally
docs
pep8
; isort

[testenv]
passenv =
test: DB
test: SEARCH
test: VARIANT
test: DJANGO_VERSION
test: TRAVIS

setenv =
PYTHONPATH = {toxinidir}:{toxinidir}
TOXDIR = {envdir}
manage: aristotlemdr__BASE_DIR = {envdir}
test: aristotlemdr__BASE_DIR = {envdir}

skipmigrate: ARISTOTLE_DEV_SKIP_MIGRATIONS=1

ally: ARISTOTLE_DEV_SKIP_MIGRATIONS = 1
search-elastic: SEARCH=elastic
search-whoosh: SEARCH=whoosh
db-sqlite: DB=sqlite
db-postgres: DB=postgres

deps =
; six
pip>8.1.1
setuptools>34.0

aristotle-1.6: aristotle-metadata-registry>=1.6.2,<1.7
aristotle-develop: git+git://github.com/aristotle-mdr/aristotle-metadata-registry@develop#egg=aristotle-metadata-registry

-r{toxinidir}/requirements.txt
django_tools
coverage
dj-database-url

dj1.8: Django>=1.8,<1.9
dj1.10: Django>=1.10,<1.11

db-postgres: psycopg2
db-mariadb: mysqlclient

search-elastic: elasticsearch>=2.0.0,<3.0.0
search-elastic: django-haystack-elasticsearch
search-whoosh: Whoosh

ally: Whoosh
ally: Django>=1.10,<1.11
ally: wcag_zoo

commands =
pip list ; Tell us exactly what is being run
test: coverage run --branch --source=aristotle_glossary manage.py test aristotle_glossary.tests --settings=aristotle_glossary.tests.settings
manage: ./manage.py {posargs}

ally: coverage run --branch --source=aristotle_glossary ./manage.py test aristotle_glossary.tests.accessibility --settings=aristotle_glossary.tests.settings

[testenv:pep8]
deps =
flake8
commands=
flake8 --exclude=migrations,tests --ignore=E501,E225,E123 {toxinidir}/aristotle_glossary

0 comments on commit 7c8fd68

Please sign in to comment.