Skip to content

Commit

Permalink
Merge pull request #18 from wesokes/develop
Browse files Browse the repository at this point in the history
tox
  • Loading branch information
somewes authored Apr 27, 2018
2 parents 3285193 + 37fadb6 commit 53a3655
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 23 deletions.
49 changes: 37 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,45 @@
language: python

sudo: false

python:
- '3.5'
- '3.6'
- "2.7"
- "3.4"
- "3.5"
- "3.6"

env:
global:
- DB=postgres
matrix:
- DJANGO=">=1.11,<2.0"
- DJANGO=">=2.0,<2.1"
- DJANGO=1.11
- DJANGO=2.0
- DJANGO=master

addons:
postgresql: '9.5'

matrix:
include:
- { python: "3.6", env: TOXENV=flake8 }

exclude:
- { python: "2.7", env: DJANGO=master }
- { python: "2.7", env: DJANGO=2.0 }
- { python: "3.4", env: DJANGO=master }

allow_failures:
- env: DJANGO=master

install:
- pip install -q coverage flake8 Django$DJANGO django-nose>=1.4
- pip install -r requirements/docs.txt
- pip install tox-travis

before_script:
- psql -c 'CREATE DATABASE django_kmatch;' -U postgres

script:
- flake8 .
- coverage run setup.py test
- coverage report --fail-under=100
- python setup.py build_sphinx
- tox

after_success:
coveralls

notifications:
email: false
2 changes: 2 additions & 0 deletions django_kmatch/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

urlpatterns = [] # pragma: no cover
2 changes: 1 addition & 1 deletion django_kmatch/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.0.0'
__version__ = '1.1.0'
4 changes: 4 additions & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Release Notes
=============

v1.1.0
------
* Add tox to support more versions

v1.0.0
------
* Remove python 2.7 support
Expand Down
5 changes: 5 additions & 0 deletions requirements/requirements-testing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
coverage
django-nose
flake8
mock
psycopg2
13 changes: 4 additions & 9 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,17 @@ def configure_settings():
if test_db is None:
db_config = {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'ambition_dev',
'USER': 'ambition_dev',
'PASSWORD': 'ambition_dev',
'HOST': 'localhost'
'NAME': 'ambition',
'USER': 'ambition',
'PASSWORD': 'ambition',
'HOST': 'db'
}
elif test_db == 'postgres':
db_config = {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'postgres',
'NAME': 'django_kmatch',
}
elif test_db == 'sqlite':
db_config = {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'django_kmatch',
}
else:
raise RuntimeError('Unsupported test DB {0}'.format(test_db))

Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def get_version():
packages=find_packages(),
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Intended Audience :: Developers',
Expand All @@ -38,7 +40,7 @@ def get_version():
],
license='MIT',
install_requires=[
'jsonfield>=0.9.20',
'jsonfield==0.9.23',
'Django>=1.11',
'kmatch>=0.1.7'
],
Expand Down
28 changes: 28 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[tox]
envlist =
flake8
py{27,34,35,36}-django111
py{34,35,36}-django20
py{35,36}-djangomaster

[testenv]
setenv =
DB = postgres
deps =
django111: Django>=1.11,<2.0
django20: Django>=2.0,<2.1
djangomaster: https://github.com/django/django/archive/master.tar.gz
-rrequirements/requirements-testing.txt
commands =
coverage run setup.py test
coverage report --fail-under=100

[testenv:flake8]
deps = flake8
commands = flake8 django_kmatch

[travis:env]
DJANGO =
1.11: django111
2.0: django20
master: djangomaster

0 comments on commit 53a3655

Please sign in to comment.