Skip to content

Commit 1eafafd

Browse files
committed
Drop support for Django 2.0, 2.1 and add support for 3.x; Python 3.8
1 parent e21f829 commit 1eafafd

File tree

9 files changed

+44
-39
lines changed

9 files changed

+44
-39
lines changed

.github/workflows/test.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Test
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: [3.7, 3.8]
11+
12+
steps:
13+
- uses: actions/checkout@v1
14+
- name: Set up Python ${{ matrix.python-version }}
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install tox tox-gh-actions
22+
- name: Test with tox
23+
run: tox

.travis.yml

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

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
django-generic-plus
22
###################
33

4-
.. image:: https://travis-ci.org/theatlantic/django-generic-plus.svg?branch=master
5-
:target: https://travis-ci.org/theatlantic/django-generic-plus
4+
.. image:: https://github.com/theatlantic/django-generic-plus/actions/workflows/test.yml/badge.svg
5+
:target: https://github.com/theatlantic/django-generic-plus/actions
66
:alt: Build Status
77

88
**django-generic-plus** is a python module which provides a Django model

generic_plus/curation/forms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from django.forms import ValidationError
44
from django.db import models
55
from django.forms.models import ModelChoiceIterator
6-
from django.utils.encoding import smart_text
6+
from django.utils.encoding import smart_str
77

88
from .widgets import ContentObjectSelect
99

@@ -26,7 +26,7 @@ def choice(self, choice):
2626
"empty_label": None,
2727
"queryset": choice.get_queryset(),
2828
"prepare_value": self.field.prepare_value,
29-
"label_from_instance": staticmethod(smart_text),
29+
"label_from_instance": staticmethod(smart_str),
3030
"cache_choices": False,
3131
})
3232
sub_choices = list(ModelChoiceIterator(fake_field))

generic_plus/forms/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from django.core.files.uploadedfile import UploadedFile
1111
from django.db import models
1212
from django.db.models.fields.files import FieldFile
13-
from django.forms.forms import BoundField
13+
from django.forms.boundfield import BoundField
1414
from django.forms.formsets import TOTAL_FORM_COUNT, DEFAULT_MAX_NUM
1515
from django.forms.models import modelform_factory, ModelFormMetaclass
1616
from django.utils.encoding import force_text

generic_plus/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def patch_django():
1111

1212
def patch_model_form():
1313
from django.forms import BaseForm, Field
14-
from django.forms.forms import BoundField
14+
from django.forms.boundfield import BoundField
1515
from generic_plus.forms import GenericForeignFileFormField, GenericForeignFileBoundField
1616

1717
if not hasattr(Field, 'get_bound_field'):

generic_plus/tests/test_curation/urls.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,4 @@
66
import generic_plus.tests.test_curation.admin # noqa
77

88

9-
if django.VERSION > (1, 9):
10-
urlpatterns = [url(r'^admin/', admin.site.urls)]
11-
else:
12-
urlpatterns = [url(r'^admin/', include(admin.site.urls))]
9+
urlpatterns = [url(r'^admin/', admin.site.urls)]

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
setup(
66
name='django-generic-plus',
7-
version="2.3.0",
7+
version="2.4.0",
88
install_requires=[
99
'python-monkey-business>=1.0.0',
1010
],
@@ -25,15 +25,16 @@
2525
'Operating System :: OS Independent',
2626
'Framework :: Django',
2727
'Framework :: Django :: 1.11',
28-
'Framework :: Django :: 2.0',
29-
'Framework :: Django :: 2.1',
3028
'Framework :: Django :: 2.2',
3129
'Framework :: Django :: 3.0',
30+
'Framework :: Django :: 3.1',
31+
'Framework :: Django :: 3.2',
3232
'Programming Language :: Python',
3333
"Programming Language :: Python :: 2",
3434
'Programming Language :: Python :: 2.7',
3535
'Programming Language :: Python :: 3',
3636
'Programming Language :: Python :: 3.7',
37+
'Programming Language :: Python :: 3.8',
3738
],
3839
include_package_data=True,
3940
zip_safe=False)

tox.ini

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
envlist =
3-
py{27,37}-dj111
4-
py37-dj{20,21,22,30}
3+
py27-dj111
4+
py{37,38}-dj{111,22,30,31,32}
55

66
[testenv]
77
commands =
@@ -12,8 +12,13 @@ deps =
1212
six>=1.15
1313
lxml
1414
dj-database-url
15-
dj111: Django>=1.11.25,<2.0
16-
dj20: Django>=2.0,<2.1
17-
dj21: Django>=2.0,<2.1
15+
dj111: Django==1.11.29
1816
dj22: Django>=2.2,<3.0
1917
dj30: Django>=3.0,<3.1
18+
dj31: Django>=3.1,<3.2
19+
dj32: Django>=3.2b1,<4.0
20+
21+
[gh-actions]
22+
python =
23+
3.7: py37
24+
3.8: py38

0 commit comments

Comments
 (0)