Skip to content

Commit bb6428c

Browse files
authored
Merge pull request #201 from rambo/test-190
PyUp updates rebased and fixed
2 parents fe75b81 + 1aaa789 commit bb6428c

File tree

13 files changed

+65
-59
lines changed

13 files changed

+65
-59
lines changed

Dockerfile

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
FROM ubuntu:14.04
1+
FROM ubuntu:16.04
22
ENV PYTHONUNBUFFERED 1
33
EXPOSE 8000
44

55
# Install basics
6-
RUN apt-get update && apt-get upgrade -y
7-
RUN apt-get install -y build-essential postgresql git python-dev
8-
RUN apt-get install -y python-virtualenv python3-pip graphviz-dev libpq-dev # faster builds
6+
RUN apt-get update && apt-get upgrade -y && apt-get install -y curl sudo
7+
RUN curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash
8+
RUN apt-get install -y build-essential postgresql \
9+
git python-dev python3-dev python-virtualenv \
10+
python3-pip python-pip graphviz-dev libpq-dev nodejs
911

1012
# Install maildump
1113
EXPOSE 1080
1214
RUN pip install maildump
1315

14-
# Install nodejs
15-
RUN apt-get update && apt-get install -y curl
16-
RUN curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash
17-
RUN apt-get update && apt-get install -y nodejs
18-
1916
# Create database
2017
USER postgres
2118
RUN service postgresql start && \
@@ -46,9 +43,14 @@ ENV LANG en_US.UTF-8
4643
ENV LANGUAGE en_US:en
4744

4845
# Install python requirements
49-
RUN virtualenv -p `which python3.4` ../asylum-venv
46+
RUN virtualenv -p `which python3` ../asylum-venv
5047
COPY project/requirements /opt/asylum/requirements/
51-
RUN . ../asylum-venv/bin/activate && pip install packaging appdirs && pip install -r requirements/local.txt && chown -R asylum:asylum ../asylum-venv
48+
RUN . ../asylum-venv/bin/activate && \
49+
pip install pip --upgrade && \
50+
pip install packaging appdirs urllib3[secure] && \
51+
pip install -r requirements/local.txt && \
52+
chown -R asylum:asylum ../asylum-venv && \
53+
true
5254

5355
# Configure application
5456
USER root

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ sudo apt-get install -y nodejs</code></pre>
6767

6868
- `xargs -a <(awk '/^\s*[^#]/' "requirements.apt") -r -- sudo apt-get install` Installs all packages listed in requirements.apt
6969
- `sudo pip install maildump` currently not python3 compatible due to broken package, only needed if you're going to run in development mode
70-
- `` virtualenv -p `which python3.4` venv && source venv/bin/activate ``
70+
- `` virtualenv -p `which python3` venv && source venv/bin/activate ``
7171
- Note: this might not work. If it doesn't, try `virtualenv-3.4`.
7272
If you don't have `virtualenv-3.4`, you might need to install it (`sudo pip3.4 install virtualenv`).
73-
If the installation command fails, you'll have to bootstrap pip for your Python3.4 installation (`wget https://bootstrap.pypa.io/get-pip.py && sudo python3.4 get-pip.py`).
73+
If the installation command fails, you'll have to bootstrap pip for your python3 installation (`wget https://bootstrap.pypa.io/get-pip.py && sudo python3 get-pip.py`).
7474
Good luck.
7575
- `pip install -r requirements/local.txt` (or `pip install -r requirements/production.txt` if installing on production)
7676
- Create the postgres database

docker/dev.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash -e
2-
SCRIPTDIR=$(python -c 'import os,sys;print os.path.dirname(os.path.realpath(sys.argv[1]))' "$0")
2+
SCRIPTDIR=$(python2.7 -c 'import os,sys;print os.path.dirname(os.path.realpath(sys.argv[1]))' "$0")
33

44
# Make sure we're in the correct place relative to Dockerfile no matter where we were called from
55
cd `dirname "$SCRIPTDIR"`

docker/run_unit_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash -e
2-
SCRIPTDIR=$(python -c 'import os,sys;print os.path.dirname(os.path.realpath(sys.argv[1]))' "$0")
2+
SCRIPTDIR=$(python2.7 -c 'import os,sys;print os.path.dirname(os.path.realpath(sys.argv[1]))' "$0")
33

44
# Make sure we're in the correct place relative to Dockerfile no matter where we were called from
55
cd `dirname "$SCRIPTDIR"`

docker/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash -e
2-
SCRIPTDIR=$(python -c 'import os,sys;print os.path.dirname(os.path.realpath(sys.argv[1]))' "$0")
2+
SCRIPTDIR=$(python2.7 -c 'import os,sys;print os.path.dirname(os.path.realpath(sys.argv[1]))' "$0")
33

44
# Make sure we're in the correct place relative to Dockerfile no matter where we were called from
55
cd `dirname "$SCRIPTDIR"`

docker/test_pull_request.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
SCRIPTDIR=$(python -c 'import os,sys;print os.path.dirname(os.path.realpath(sys.argv[1]))' "$0")
2+
SCRIPTDIR=$(python2.7 -c 'import os,sys;print os.path.dirname(os.path.realpath(sys.argv[1]))' "$0")
33
# Make sure the id is here
44
if [ "$1" == "" ]
55
then

project/creditor/tests/fixtures/recurring.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
from .tags import TransactionTagFactory
1111

12+
def get_tag():
13+
if TransactionTag.objects.count():
14+
return factory.fuzzy.FuzzyChoice(TransactionTag.objects.all())
15+
return factory.SubFactory(TransactionTagFactory, label='Membership fee', tmatch='1')
1216

1317
class RecurringTransactionFactory(factory.django.DjangoModelFactory):
1418

@@ -19,7 +23,7 @@ class Meta:
1923
end = None
2024
rtype = factory.fuzzy.FuzzyChoice(RecurringTransaction.RTYPE_READABLE.keys())
2125
owner = factory.SubFactory(MemberFactory) # ternary expression does not really help us since the import is done before the test-db is created, TODO: Make a special helper class that can will evaluate the count later
22-
tag = (factory.fuzzy.FuzzyChoice(TransactionTag.objects.all())) if TransactionTag.objects.count() else (factory.SubFactory(TransactionTagFactory, label='Membership fee', tmatch='1'))
26+
tag = get_tag
2327
amount = factory.fuzzy.FuzzyInteger(-40, -10, 5)
2428
start = factory.LazyAttribute(lambda t: factory.fuzzy.FuzzyDate(t.owner.accepted).fuzz())
2529

project/requirements.apt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
##basic build dependencies of various Django apps for Ubuntu 14.04
22
python-virtualenv
3-
#build-essential metapackage install: make, gcc, g++,
3+
#build-essential metapackage install: make, gcc, g++,
44
build-essential
55
#required to translate
66
gettext
@@ -13,11 +13,11 @@ zlib1g-dev
1313

1414

1515
##Pillow dependencies
16-
libtiff4-dev
1716
libjpeg8-dev
1817
libfreetype6-dev
19-
liblcms1-dev
2018
libwebp-dev
19+
libtiff5-dev
20+
liblcms2-dev
2121

2222
##django-extensions
2323
graphviz-dev

project/requirements/base.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
# Bleeding edge Django
22
django==1.8.5
3-
Jinja2==2.8
4-
django-jinja==1.4.1
3+
Jinja2==2.8.1
4+
django-jinja==2.2.2
55
markupsafe==0.23
66

77
# Configuration
8-
django-environ==0.4.0
8+
django-environ==0.4.1
99
django-secure==1.0.1
10-
whitenoise==2.0.4
10+
whitenoise==3.2.2
1111

1212
# Forms
13-
django-braces==1.8.1
14-
django-crispy-forms==1.5.2
15-
django-floppyforms==1.5.2
13+
django-braces==1.10.0
14+
django-crispy-forms==1.6.1
15+
django-floppyforms==1.7.0
1616

1717
# Models
18-
django-model-utils==2.3.1
18+
django-model-utils==2.6
1919

2020
# Images
21-
Pillow==3.0.0
21+
Pillow==3.4.2
2222

2323
# Python-PostgreSQL Database Adapter
24-
psycopg2==2.6.1
24+
psycopg2==2.6.2
2525

2626
# Unicode slugification
2727
git+git://github.com/mozilla/unicode-slugify#egg=unicode-slugify==0.1.3-HEAD
2828
django-autoslug==1.9.3
2929

3030
# Time zones support
31-
pytz==2015.6
31+
pytz==2016.10
3232

3333
# Your custom requirements go here
34-
django-bootstrap3==6.2.2
34+
django-bootstrap3==7.1.0
3535
django-reversion==1.9.3
36-
djangorestframework==3.3.1
37-
Markdown==2.6.5
38-
django-filter==0.11.0
39-
djangorestframework-filters==0.6.0
36+
djangorestframework==3.5.3
37+
Markdown==2.6.7
38+
django-filter==0.15.3
39+
djangorestframework-filters==0.9.1
4040
django-markdown==0.8.4
41-
django-settings-export==1.0.6
41+
django-settings-export==1.2.1
4242
holviapi==0.2.20170129
43-
python-dateutil==2.4.2
43+
python-dateutil==2.6.0

project/requirements/local.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Local development dependencies go here
22
-r base.txt
33

4-
django-extensions==1.5.7
4+
django-extensions==1.7.5
55
# django-debug-toolbar that works with Django 1.5+
6-
django-debug-toolbar==1.4
6+
django-debug-toolbar==1.6
77

88
# improved REPL
9-
ipdb==0.8.1
9+
ipdb==0.10.1
1010

1111
# the "python3 compatible" package is broken ATM
1212
# Required by maildump. Need to pin dependency to gevent beta to be Python 3-compatible.
@@ -15,14 +15,14 @@ ipdb==0.8.1
1515
#maildump==0.5.1
1616

1717
# Code quality
18-
flake8==2.4.1
19-
pep8==1.5.7
20-
pep8-naming==0.3.3
18+
flake8==3.2.1
19+
pep8==1.7.0
20+
pep8-naming==0.4.1
2121
autopep8==1.3.1
2222
isort==4.2.5
2323

24-
factory_boy==2.5.2
25-
pytest==2.8.2
26-
pytest-django==2.9.1
24+
factory-boy==2.8.1
25+
pytest==3.0.5
26+
pytest-django==3.1.2
2727

2828
loremipsum==1.0.5

0 commit comments

Comments
 (0)