Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

WIP Dockerise me #35

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[flake8]
exclude = */docs/*,*/.tox/*,*/.venv/*,*/.pycharm_helpers/*,*/migrations/*,docs/*,fabfile.py,*/__init__.py,secret.py
# PEP standard wrap line length
max-line-length = 79

# E12x continuation line indentation
# E251 no spaces around keyword / parameter equals
# E303 too many blank lines (3)
# F405 name may be undefined, or defined from star imports: module
ignore = E125,E126,E251,E303,F405
131 changes: 122 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,131 @@
__pycache__
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*.py[co]
.cache
*$py.class

# dev local configs
.project
.pydevproject
.vscode
*~
*.db
*.orig
*.DS_Store
# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.tox
db.sqlite3
*.egg-info/*
docs/_build/*
dist/*
build/*
venv
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# Pycharm
.idea

# Pg cluster for docker
deployment/pg/postgres_data/9.3
deployment/pg/postgres_staging_data/9.3
deployment/pg/postgres_dev_data/9.3
deployment/sql/td_biblio-old.sql
# Template for apt-cacher
# static and media dirs
deployment/static
deployment/media
deployment/docker/71-apt-cacher-ng
core/settings/secret.py
.idea/
REQUIREMENTS-dev.txt
REQUIREMENTS.txt
core/
deployment/
manage.py
53 changes: 44 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,26 @@ python:
- 3.4
- 3.5
- 3.6
services:
- postgresql

env:
- DJANGO_RELEASE='Django>=1.8,<1.9'
- DJANGO_RELEASE='Django>=1.9,<1.10'
- DJANGO_RELEASE='Django>=1.10,<1.11'
- DJANGO_RELEASE='Django>=1.11,<1.12'
- DJANGO_RELEASE='Django>=2.0,<2.1'
- DJANGO_RELEASE='Django>=2.1,<2.2'
global:
- ON_TRAVIS=true
- DATABASE_URL='postgres://postgres:@localhost:5432/test_db'
- SECRET_KEY='tT\xd7\xb06\xf7\x9b\xff\x0fZL\xca\xca\x11\xefM\xacr\xfb\xdf\xca\x9b'
- DJANGO_SETTINGS_MODULE=core.settings.test_travis
- RABBITMQ_HOST='rabbitmq'
- DJANGO_RELEASE='Django>=1.8,<1.9'
- DJANGO_RELEASE='Django>=1.9,<1.10'
- DJANGO_RELEASE='Django>=1.10,<1.11'
- DJANGO_RELEASE='Django>=1.11,<1.12'
- DJANGO_RELEASE='Django>=2.0,<2.1'
- DJANGO_RELEASE='Django>=2.1,<2.2'

sudo: false
dist: trusty

matrix:
exclude:
### These older Django version don't support Python 3.5+:
Expand All @@ -27,10 +40,32 @@ matrix:
# Django 2.1+ dropped support for python 3.4
- python: 3.4
env: DJANGO_RELEASE='Django>=2.1,<2.2'

addons:
postgresql: "9.3"
apt:
packages:
- postgresql-9.3-postgis-2.3

install:
- pip install "$DJANGO_RELEASE"
- pip install -r requirements/dev.txt
- pip install coveralls
- pip install -r REQUIREMENTS-dev.txt
- nodeenv -p --node=0.10.31
- npm -g install yuglify

before_script:
- psql -c 'create database test_db;' -U postgres
- psql -c 'CREATE EXTENSION postgis;' -U postgres -d test_db

script:
- flake8 td_biblio/
- PYTHONPATH=$(pwd) DATABASE_URL="sqlite:///:memory:" py.test
- flake8 --config .flake8 .
- python manage.py makemigrations
- python manage.py migrate
- python manage.py collectstatic --noinput --verbosity 0
- coverage run manage.py test
# - flake8 td_biblio/
# - PYTHONPATH=$(pwd) DATABASE_URL="sqlite:///:memory:" py.test
after_success: coveralls


3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ include requirements.txt
include requirements/base.txt
include requirements/dev.txt
include requirements/heroku.txt
recursive-include sandbox *
recursive-include core *
recursive-include docs *
recursive-include td_biblio/static *
recursive-include td_biblio/templates/td_biblio *
recursive-include td_biblio/tests/fixtures *

Loading