Skip to content

Commit eb2afef

Browse files
Merge pull request #6 from alextford11/django-3.1
Django 3.1 and Python 3.8
2 parents 1c12cf3 + f8d9b0d commit eb2afef

File tree

8 files changed

+59
-52
lines changed

8 files changed

+59
-52
lines changed

.github/workflows/tests.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Tests
2+
on: push
3+
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
10+
- name: Set up Python
11+
uses: actions/setup-python@v2
12+
with:
13+
python-version: 3.8
14+
15+
- name: Install Dependencies
16+
run: make install
17+
18+
- name: Lint
19+
run: make lint
20+
21+
- name: Tests
22+
run: make test
23+
24+
- name: Codecov
25+
run: make codecov

.travis.yml

Lines changed: 0 additions & 34 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+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Django bootstrap forms for django-jinja
22
=======================================
33

4-
[![Build Status](https://travis-ci.org/tutorcruncher/django-jinja-bootstrap-form.svg?branch=master&style=flat)](https://travis-ci.org/tutorcruncher/django-jinja-bootstrap-form)
4+
[![Build Status](https://github.com/tutorcruncher/django-jinja-bootstrap-form/workflows/Tests/badge.svg)](https://github.com/tutorcruncher/django-jinja-bootstrap-form/actions)
55
[![PyPI Status](https://img.shields.io/pypi/v/django-jinja-bootstrap-form.svg?style=flat)](https://pypi.python.org/pypi/django-jinja-bootstrap-form)
66
[![codecov](https://codecov.io/gh/tutorcruncher/django-jinja-bootstrap-form/branch/master/graph/badge.svg)](https://codecov.io/gh/tutorcruncher/django-jinja-bootstrap-form)
77

bootstrapform_jinja/templatetags/bootstrap.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from collections import OrderedDict
2-
from django.forms import CheckboxInput, CheckboxSelectMultiple, FileInput, RadioSelect
3-
from django.forms.forms import BoundField
2+
from django.forms import BoundField, CheckboxInput, CheckboxSelectMultiple, FileInput, RadioSelect
43
from django.template.loader import get_template
54
from django.utils.safestring import mark_safe
65
from django_jinja import library

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)