Skip to content

Commit

Permalink
update travis, migrate for edc_device, update requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Jun 24, 2017
1 parent ce93722 commit 3942ad1
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 23 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[run]
omit =
*/wsgi.py
setup.py
manage.py
*/migrations/*
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
dist: trusty
sudo: required
language: python

python:
- 3.5.1
- 3.6

services:
- mysql
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3

branches:
only:
- develop

install:
- pip install --upgrade pip
- pip install -r requirements.txt
- pip install flake8
- pip install coveralls

before_script:
- flake8 django-crypto-fields
- flake8 django_crypto_fields
- mysql -e 'create database edc character set utf8;'
- python manage.py makemigrations
- python manage.py migrate

script:
- coverage run --source=django-crypto-fields manage.py test
- coverage run --source=django_crypto_fields manage.py test

after_success:
- coveralls

notifications:
slack:
secure: TTsJHovp0lXmrks/D8+X7LHRO8K+TOEQX6+POTsMz8F1i0fuDhY18fN2/R4bQLDigo7+blHNr7fP4t4pLj36fPqPTfv8wRktG4CCOJOucI03Q6buMmcR5/1BsRJEZFytnsyme/T+wWTowlv/r4u3XbHV9Q3JAceFNY6hJnQa9ahpkfk/Vy2PfV8XRSYybvFTZLj0D+4pBcTYaAeye6azXKKadM4m70vGDOKTlyBEGyZmeefAovnaGLcollo1N5E8vGaD3AIaXZLYmWQky2y9cBkVirqLUXE3XneWGN7yne+LtSRGMiGCKrw+thZ8NHrcMBSYNiFPmRise6nh9zprQIVjzUOoSw3w3EWPV/tKduNEvXs26tQGAw9JSkEONA6Wg36fTssCOnl6jDj911WP5nMnCwTEQjMIBvZTt7b+YKpaNqvI1oKB/OL+uSQ8m10UpdEvZRcex3PXNc21ic//KoEG0Zew29wBISaxb9cD/oCpSGL/BU4cbvWuUYPuvd5iwfUmGP2T7fGvA8mXyUMXm62Zjh2U939IbY/FHsjxpvmYbkIP184pxx7Ldem+spQomZGsQcSE6Z5ETq0Z7YCXgqp+HWkGcY4pwEGzwTZssP6ZP/JWFbaRUTGxkQFpCPjfDGZI037anA8LAMJMbG5+kIwOzA9fUhBx7zMYr3VMAkg=
26 changes: 26 additions & 0 deletions django_crypto_fields/migrations/0007_auto_20170518_1233.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-18 12:33
from __future__ import unicode_literals

from django.db import migrations
import edc_base.model_fields.userfield


class Migration(migrations.Migration):

dependencies = [
('django_crypto_fields', '0006_auto_20170328_0728'),
]

operations = [
migrations.AlterField(
model_name='crypt',
name='user_created',
field=edc_base.model_fields.userfield.UserField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user created'),
),
migrations.AlterField(
model_name='crypt',
name='user_modified',
field=edc_base.model_fields.userfield.UserField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user modified'),
),
]
29 changes: 29 additions & 0 deletions django_crypto_fields/migrations/0008_auto_20170624_1905.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-24 19:05
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('django_crypto_fields', '0007_auto_20170518_1233'),
]

operations = [
migrations.AddField(
model_name='crypt',
name='device_created',
field=models.CharField(blank=True, max_length=10),
),
migrations.AddField(
model_name='crypt',
name='device_modified',
field=models.CharField(blank=True, max_length=10),
),
migrations.AddIndex(
model_name='crypt',
index=models.Index(fields=['hash', 'algorithm', 'mode'], name='django_cryp_hash_76d13d_idx'),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ def get_by_natural_key(self, value_as_hash, algorithm, mode):

class CryptModelMixin(models.Model):

""" A secrets lookup model searchable by hash """
""" A secrets lookup model searchable by hash.
"""

hash = models.CharField(
verbose_name="Hash",
Expand Down Expand Up @@ -44,5 +45,5 @@ def natural_key(self):

class Meta:
abstract = True
verbose_name = 'Crypt'
unique_together = (('hash', 'algorithm', 'mode'),)
indexes = [models.Index(fields=['hash', 'algorithm', 'mode'])]
4 changes: 1 addition & 3 deletions django_crypto_fields/models.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
from django_crypto_fields.crypt_model_mixin import CryptModelMixin
from .model_mixins import CryptModelMixin

from edc_base.model_mixins import BaseUuidModel


class Crypt(CryptModelMixin, BaseUuidModel):

class Meta(CryptModelMixin.Meta):
app_label = 'django_crypto_fields'
verbose_name = 'Crypt'
unique_together = (('hash', 'algorithm', 'mode'),)
10 changes: 5 additions & 5 deletions django_crypto_fields/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from pathlib import PurePath

# BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BASE_DIR = os.path.dirname(os.path.realpath(__file__))

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
APP_NAME = 'django_crypto_fields'
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/

Expand All @@ -40,6 +40,7 @@
'django.contrib.messages',
'django.contrib.staticfiles',
'django_revision.apps.AppConfig',
'edc_device.apps.AppConfig',
'example.apps.DjangoCryptoFieldsAppConfig',
'example.apps.AppConfig',
]
Expand Down Expand Up @@ -85,7 +86,6 @@
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# }
# }

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
Expand Down Expand Up @@ -117,6 +117,6 @@
# https://docs.djangoproject.com/en/1.8/howto/static-files/

STATIC_URL = '/static/'
GIT_DIR = str(PurePath(BASE_DIR).parent)
KEY_PATH = os.path.join(str(PurePath(BASE_DIR).parent), 'crypto_fields')
GIT_DIR = BASE_DIR
KEY_PATH = os.path.join(BASE_DIR, 'crypto_fields')
AUTO_CREATE_KEYS = DEBUG
2 changes: 1 addition & 1 deletion example/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from django_crypto_fields.fields import EncryptedTextField, FirstnameField, LastnameField, IdentityField
from django_crypto_fields.mixins import CryptoMixin
from django_crypto_fields.crypt_model_mixin import CryptModelMixin
from django_crypto_fields.model_mixins import CryptModelMixin


class Crypt (CryptModelMixin, BaseUuidModel):
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# see README if problems with pycrypto
Django
django_extensions
Unipath
pycrypto
mysqlclient
git+https://github.com/erikvw/edc-base@develop#egg=edc_base
git+https://github.com/erikvw/django-revision@develop#egg=django-revision
git+https://github.com/botswana-harvard/edc-device@develop#egg=edc-device

0 comments on commit 3942ad1

Please sign in to comment.