Skip to content

Commit 15bd760

Browse files
committed
Makefile, black, requirements, etc..
1 parent 748bb27 commit 15bd760

File tree

6 files changed

+37
-54
lines changed

6 files changed

+37
-54
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,13 @@ jobs:
1313
python-version: 3.8
1414

1515
- name: Install Dependencies
16-
run: pip install django django-jinja flake8 coverage
16+
run: make install
1717

18-
- name: Flake8
19-
run: flake8 bootstrapform_jinja/
18+
- name: Lint
19+
run: make lint
2020

2121
- name: Tests
22-
run: |
23-
cd testing
24-
coverage run --source=bootstrapform_jinja manage.py test
25-
mv .coverage ..
26-
cd ..
22+
run: make test
2723

2824
- name: Codecov
29-
run: pwd && ls -lha && bash <(curl -s https://codecov.io/bash)
25+
run: make codecov

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
black = black -S -l 120 --target-version py38
2+
3+
.PHONY: install
4+
install:
5+
pip install --progress-bar off -r requirements.txt
6+
7+
.PHONY: black
8+
black:
9+
$(black) bootstrapform_jinja/ testing/
10+
11+
.PHONY: lint
12+
lint:
13+
flake8 bootstrapform_jinja/ testing/
14+
$(black) --check bootstrapform_jinja/ testing/
15+
16+
.PHONY: test
17+
test:
18+
coverage run --source=bootstrapform_jinja testing/manage.py test
19+
20+
.PHONY: codecov
21+
codecov:
22+
bash <(curl -s https://codecov.io/bash)
23+

requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
black==19.10b0
2+
coverage==5.2.1
3+
django==3.1
4+
django-jinja==2.6.0
5+
flake8==3.8.3

testing/settings.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
23
BASE_DIR = os.path.dirname(__file__)
34

45
SECRET_KEY = 'django-jinja-bootstrap-form'
@@ -25,24 +26,13 @@
2526

2627
ROOT_URLCONF = 'testapp.urls'
2728

28-
DATABASES = {
29-
'default': {
30-
'ENGINE': 'django.db.backends.sqlite3',
31-
'NAME': ':memory:',
32-
}
33-
}
29+
DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:'}}
3430

3531
TEMPLATES = [
3632
{
3733
'BACKEND': 'django_jinja.backend.Jinja2',
3834
'APP_DIRS': True,
39-
'DIRS': (
40-
os.path.join(BASE_DIR, 'templates'),
41-
),
42-
'OPTIONS': {
43-
'match_extension': '.jinja',
44-
'trim_blocks': True,
45-
'lstrip_blocks': True,
46-
}
35+
'DIRS': (os.path.join(BASE_DIR, 'templates'),),
36+
'OPTIONS': {'match_extension': '.jinja', 'trim_blocks': True, 'lstrip_blocks': True},
4737
},
4838
]

testing/testapp/tests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,3 @@ def test_partial_form(self):
4646
response = client.get('/partial_bs_form/')
4747
self.assertContains(response, '<div class="form-group">', status_code=200)
4848
self.assertHTMLEqualToFixture(response, 'partial.html')
49-

0 commit comments

Comments
 (0)