File tree Expand file tree Collapse file tree 4 files changed +106
-1
lines changed Expand file tree Collapse file tree 4 files changed +106
-1
lines changed Original file line number Diff line number Diff line change
1
+ version : 2
2
+ workflows :
3
+ version : 2
4
+ test :
5
+ jobs :
6
+ - test-py37
7
+ - test-py36
8
+ - test-py35
9
+ - pre-commit
10
+ jobs :
11
+ test-py37 : &test-template
12
+ docker :
13
+ - image : circleci/python:3.7
14
+ - &test-template-pg
15
+ image : postgres:latest
16
+ name : pg
17
+ environment :
18
+ POSTGRES_USER : user
19
+ POSTGRES_PASSWORD : pass
20
+ POSTGRES_DB : postgres
21
+ - &test-template-redis
22
+ image : redis:latest
23
+ environment : &test-template-env
24
+ PY_FACTOR : py37
25
+ PG_HOST : pg
26
+ PG_USER : user
27
+ PG_PASSWORD : pass
28
+ steps :
29
+ - checkout
30
+ - restore_cache :
31
+ keys :
32
+ - v1-dependencies-{{ checksum "pyproject.lock" }}-{{ checksum "tox.ini" }}
33
+ - v1-dependencies-
34
+ - run :
35
+ name : Installing top-level dependencies
36
+ command : |
37
+ export PATH=~/.local/bin:$PATH
38
+ pip install --user tox poetry
39
+ - run :
40
+ name : Waiting for Postgres to start up
41
+ command : |
42
+ for i in `seq 1 60`;
43
+ do
44
+ nc -z $PG_HOST 5432 && echo Success && exit 0
45
+ echo -n .
46
+ sleep 1
47
+ done
48
+ echo Failed waiting for Postgres && exit 1
49
+ - run :
50
+ name : Running tests
51
+ command : |
52
+ export PATH=~/.local/bin:$PATH
53
+ export TOXENV=$(tox --listenvs | grep "^${PY_FACTOR}-" | tr '\n' ',')
54
+ tox
55
+ - save_cache :
56
+ paths :
57
+ - ~/.local
58
+ - ./.tox
59
+ key : v1-dependencies-{{ checksum "pyproject.lock" }}-{{ checksum "tox.ini" }}
60
+ test-py36 :
61
+ << : *test-template
62
+ docker :
63
+ - image : circleci/python:3.6
64
+ - *test-template-pg
65
+ - *test-template-redis
66
+ environment :
67
+ << : *test-template-env
68
+ PY_FACTOR : py36
69
+ test-py35 :
70
+ << : *test-template
71
+ docker :
72
+ - image : circleci/python:3.5
73
+ - *test-template-pg
74
+ - *test-template-redis
75
+ environment :
76
+ << : *test-template-env
77
+ PY_FACTOR : py35
78
+ pre-commit :
79
+ docker :
80
+ - image : circleci/python:3.7
81
+ steps :
82
+ - checkout
83
+ - restore_cache :
84
+ keys :
85
+ - v1-pre-commit
86
+ - run :
87
+ name : install pre-commit
88
+ command : pip install --user pre-commit
89
+ - run :
90
+ name : run pre-commit
91
+ command : ~/.local/bin/pre-commit run --all-files
92
+ - save_cache :
93
+ paths :
94
+ - ~/.local
95
+ - ~/.cache/pre-commit
96
+ key : v1-pre-commit
Original file line number Diff line number Diff line change 73
73
74
74
# Database
75
75
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
76
-
77
76
DATABASES = {
78
77
"default" : {
79
78
"ENGINE" : "django.db.backends.postgresql_psycopg2" ,
80
79
"NAME" : "django-pgtree-test" ,
80
+ "HOST" : os .environ .get ("PG_HOST" , "" ),
81
+ "USER" : os .environ .get ("PG_USER" , "" ),
82
+ "PASSWORD" : os .environ .get ("PG_PASSWORD" , "" ),
81
83
}
82
84
}
83
85
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ class Migration(migrations.Migration):
12
12
dependencies = []
13
13
14
14
operations = [
15
+ migrations .RunSQL (
16
+ "CREATE EXTENSION IF NOT EXISTS ltree" , migrations .RunSQL .noop
17
+ ),
15
18
migrations .CreateModel (
16
19
name = "TestModel" ,
17
20
fields = [
Original file line number Diff line number Diff line change 14
14
psycopg2-binary
15
15
skip_install =true
16
16
whitelist_externals =sh
17
+ passenv =
18
+ PG_HOST
19
+ PG_USER
20
+ PG_PASSWORD
17
21
commands =
18
22
sh -c " rm -f dist/*.whl && poetry build -f wheel && pip install dist/*.whl"
19
23
pytest {posargs}
You can’t perform that action at this time.
0 commit comments