Skip to content

Commit

Permalink
Merge a0f50fc into d79e462
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Jan 31, 2019
2 parents d79e462 + a0f50fc commit 43d2203
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 26 deletions.
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@ omit =
*/wsgi.py
setup.py
manage.py
*/config_utils/*
*/navbars.py
*/migrations/*
*/mommy_*
venv/*
runtests.py
.tox/*
.eggs/*
7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: python

python:
- 3.6
- 3.7

dist: xenial
Expand All @@ -13,16 +12,14 @@ services:

install:
- pip install --upgrade pip
- pip install -r requirements.txt
- pip install -e .
- pip install flake8 "tox>=1.8" coveralls tox-travis
- pip install flake8 coveralls tox-travis

before_script:
- flake8 django_crypto_fields
- mysql -e 'create database edc character set utf8;'

script:
- coverage run --source=django_crypto_fields setup.py test
- coverage run setup.py test

after_success:
- coveralls
14 changes: 14 additions & 0 deletions runtests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import django
import logging
import os
import sys

from django.conf import settings
Expand Down Expand Up @@ -86,6 +87,19 @@ def __getitem__(self, item):
DEFAULT_SETTINGS.update(KEY_PATH=join(
DEFAULT_SETTINGS.get('BASE_DIR'), 'crypto_fields'))

if os.environ.get("TRAVIS"):
DEFAULT_SETTINGS.update(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'edc',
'USER': 'travis',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '',
},
})


def main():
if not settings.configured:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
zip_safe=False,
keywords='django fields encryption security',
install_requires=[
'pycrypto',
'pycryptodome',
],
classifiers=[
'Environment :: Web Environment',
Expand Down
27 changes: 7 additions & 20 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
[tox]
envlist =
py36-django21
py36-djangotrunk
py37-django21
py37-django21,
py37-djangotrunk
flake8


[flake8]
ignore = E41,F401,W503,F601,W605,E203
max-complexity = 10
max-line-length = 95
exclude = django_crypto_fields/tests/*,django_crypto_fields/migrations/*,.venv/*


[testenv:docs]
changedir = docs
Expand All @@ -23,20 +12,18 @@ commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html

[testenv]
passenv = CI TRAVIS TRAVIS_*
setenv =
PYTHONWARNINGS=module::DeprecationWarning
commands =
flake8 django_crypto_fields
coverage run --source=django_crypto_fields setup.py test
coverage report
setenv = PYTHONWARNINGS=module::DeprecationWarning
deps =
# -rrequirements.txt
-rrequirements.txt
coverage
flake8
django21: Django>=2.1,<2.2
djangotrunk: https://github.com/django/django/tarball/master
commands =
flake8 django_crypto_fields
coverage run setup.py test
coverage report

[travis]
python =
3.6: py36
3.7: py37

0 comments on commit 43d2203

Please sign in to comment.