Skip to content

Commit

Permalink
Use tox for miltiversion testing, same as MongoEngine/mongoengine#960
Browse files Browse the repository at this point in the history
  • Loading branch information
noirbizarre committed May 13, 2015
1 parent 0bbe268 commit 9d7687b
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 27 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -11,4 +11,6 @@ env/
.DS_Store
.coverage
.project
.pydevproject
.pydevproject
.tox
.eggs
36 changes: 17 additions & 19 deletions .travis.yml
@@ -1,32 +1,30 @@
# http://travis-ci.org/#!/MongoEngine/flask_mongoengine
language: python
services: mongodb
python:
- "2.6"
- "2.7"
- "3.3"
- '3.4'
- pypy
- pypy3
env:
- PYMONGO=dev MONGOENGINE=dev
- PYMONGO=dev MONGOENGINE=0.7.10
- PYMONGO=dev MONGOENGINE=0.8.0
- PYMONGO=dev MONGOENGINE=0.8.7
- PYMONGO=2.5 MONGOENGINE=dev
- PYMONGO=2.5 MONGOENGINE=0.7.10
- PYMONGO=2.5 MONGOENGINE=0.8.0
- PYMONGO=2.5 MONGOENGINE=0.8.7
- PYMONGO=2.7 MONGOENGINE=dev
- PYMONGO=2.7 MONGOENGINE=0.7.10
- PYMONGO=2.7 MONGOENGINE=0.8.0
- PYMONGO=2.7 MONGOENGINE=0.8.7
- MONGOENGINE=0.7
- MONGOENGINE=0.8
- MONGOENGINE=0.9
- MONGOENGINE=dev
before_install:
- travis_retry sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
- echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' |
sudo tee /etc/apt/sources.list.d/mongodb.list
- travis_retry sudo apt-get update
- travis_retry sudo apt-get install mongodb-org-server

install:
- if [[ $PYMONGO == 'dev' ]]; then pip install https://github.com/mongodb/mongo-python-driver/tarball/master; true; fi
- if [[ $PYMONGO != 'dev' ]]; then pip install pymongo==$PYMONGO --use-mirrors; true; fi
- if [[ $MONGOENGINE == 'dev' ]]; then pip install https://github.com/mongoengine/mongoengine/tarball/master; true; fi
- if [[ $MONGOENGINE != 'dev' ]]; then pip install mongoengine==$MONGOENGINE --use-mirrors; true; fi
- python setup.py install
- travis_retry pip install tox>=1.9
- travis_retry tox -e $(echo py$TRAVIS_PYTHON_VERSION-me$MONGOENGINE | tr -d . | sed -e 's/pypypy/pypy/') -- -e test
script:
- python setup.py nosetests
- tox -e $(echo py$TRAVIS_PYTHON_VERSION-me$MONGOENGINE | tr -d . | sed -e 's/pypypy/pypy/') -- --with-coverage

notifications:
irc: "irc.freenode.org#mongoengine"
branches:
Expand Down
11 changes: 5 additions & 6 deletions setup.cfg
@@ -1,9 +1,8 @@
[nosetests]
rednose = 1
verbosity = 2
detailed-errors = 1
where = tests
#with-coverage = 1
#cover-html = 1
#cover-html-dir = ../htmlcov
#cover-package = flask_mongoengine
#cover-erase = 1
cover-erase = 1
cover-branches = 1
cover-package = flask_mongoengine
tests = tests
5 changes: 4 additions & 1 deletion setup.py
Expand Up @@ -20,6 +20,8 @@
except:
pass

test_requirements = ['nose', 'rednose', 'coverage']

setup(
name='flask-mongoengine',
version='0.7.1',
Expand All @@ -40,7 +42,8 @@
packages=['flask_mongoengine',
'flask_mongoengine.wtf'],
include_package_data=True,
tests_require=['nose', 'coverage'],
tests_require=test_requirements,
setup_requires=test_requirements, # Allow proper nose usage with setuptools and tox
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
Expand Down
12 changes: 12 additions & 0 deletions tox.ini
@@ -0,0 +1,12 @@
[tox]
envlist = {py26,py27,py33,py34,pypy,pypy3}-{me07,me08,me09,medev}

[testenv]
commands =
python setup.py nosetests {posargs}
deps =
me07: mongoengine<0.8
me08: mongoengine>=0.8,<0.9
me09: mongoengine>=0.9
medev: https://github.com/MongoEngine/mongoengine/tarball/master
me0{7,8,9}: PyMongo<3.0

0 comments on commit 9d7687b

Please sign in to comment.