-
Notifications
You must be signed in to change notification settings - Fork 124
/
Makefile
55 lines (42 loc) · 1.93 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
export DJANGO_SETTINGS_MODULE=django_multitenant.tests.settings
test-dependencies:
pip install -r requirements/test-requirements.txt
pip install Django=="${DJANGO_VERSION}"
pip install djangorestframework
test:
py.test --cov-report xml --cov=django_multitenant/tests/. -s django_multitenant/tests/ -k 'not concurrency' --ignore django_multitenant/tests/test_missing_modules.py
test-missing-modules:
# Test that the package works without the djangorestframework
pip uninstall -y djangorestframework
# We need to remove the rest_framework from the settings.py.
# Normally, application without rest_framework will not be installed in setting file.
# In our application we are installing rest_framework in test settings file to test the rest_framework related tasks.
cp django_multitenant/tests/settings.py django_multitenant/tests/settings.py.bak
sed -i '/INSTALLED_APPS/{n; /rest_framework/d;}' django_multitenant/tests/settings.py
py.test -s --cov-report xml --cov=django_multitenant/tests/. django_multitenant/tests/test_missing_modules.py -k 'not concurrency'
# Revert the changes in settings.py
mv django_multitenant/tests/settings.py.bak django_multitenant/tests/settings.py
test-migrations:
./manage.py migrate tests
revert-test-migrations:
./manage.py migrate tests 0002_distribute
# We fake the 0002_distribute rollback, because it uses lots of raw sql and
# otherwise we have to add reverse_sql='' everywhere. The backwards
# migration of 0001_initial will drop the tables anyway.
./manage.py migrate --fake tests 0001_initial
./manage.py migrate tests zero
release-dependencies:
pip install -r requirements/release-requirements.txt
format:
black .
format-check:
black --version
black . --check
lint:
prospector -X --profile-path .prospector.yaml
release:
python -m build --sdist
twine check dist/*
twine upload --skip-existing dist/*
test-model:
py.test -s django_multitenant/tests/test_models.py -k 'not concurrency'