Skip to content

Commit

Permalink
Drop support for Django 2.0, 2.1 and add support for 3.x; Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
dakrauth committed Mar 19, 2021
1 parent e21f829 commit 1eafafd
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 39 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test

on: push

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
django-generic-plus
###################

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

**django-generic-plus** is a python module which provides a Django model
Expand Down
4 changes: 2 additions & 2 deletions generic_plus/curation/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.forms import ValidationError
from django.db import models
from django.forms.models import ModelChoiceIterator
from django.utils.encoding import smart_text
from django.utils.encoding import smart_str

from .widgets import ContentObjectSelect

Expand All @@ -26,7 +26,7 @@ def choice(self, choice):
"empty_label": None,
"queryset": choice.get_queryset(),
"prepare_value": self.field.prepare_value,
"label_from_instance": staticmethod(smart_text),
"label_from_instance": staticmethod(smart_str),
"cache_choices": False,
})
sub_choices = list(ModelChoiceIterator(fake_field))
Expand Down
2 changes: 1 addition & 1 deletion generic_plus/forms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from django.core.files.uploadedfile import UploadedFile
from django.db import models
from django.db.models.fields.files import FieldFile
from django.forms.forms import BoundField
from django.forms.boundfield import BoundField
from django.forms.formsets import TOTAL_FORM_COUNT, DEFAULT_MAX_NUM
from django.forms.models import modelform_factory, ModelFormMetaclass
from django.utils.encoding import force_text
Expand Down
2 changes: 1 addition & 1 deletion generic_plus/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def patch_django():

def patch_model_form():
from django.forms import BaseForm, Field
from django.forms.forms import BoundField
from django.forms.boundfield import BoundField
from generic_plus.forms import GenericForeignFileFormField, GenericForeignFileBoundField

if not hasattr(Field, 'get_bound_field'):
Expand Down
5 changes: 1 addition & 4 deletions generic_plus/tests/test_curation/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@
import generic_plus.tests.test_curation.admin # noqa


if django.VERSION > (1, 9):
urlpatterns = [url(r'^admin/', admin.site.urls)]
else:
urlpatterns = [url(r'^admin/', include(admin.site.urls))]
urlpatterns = [url(r'^admin/', admin.site.urls)]
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name='django-generic-plus',
version="2.3.0",
version="2.4.0",
install_requires=[
'python-monkey-business>=1.0.0',
],
Expand All @@ -25,15 +25,16 @@
'Operating System :: OS Independent',
'Framework :: Django',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Framework :: Django :: 2.1',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'Programming Language :: Python',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
include_package_data=True,
zip_safe=False)
15 changes: 10 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
py{27,37}-dj111
py37-dj{20,21,22,30}
py27-dj111
py{37,38}-dj{111,22,30,31,32}

[testenv]
commands =
Expand All @@ -12,8 +12,13 @@ deps =
six>=1.15
lxml
dj-database-url
dj111: Django>=1.11.25,<2.0
dj20: Django>=2.0,<2.1
dj21: Django>=2.0,<2.1
dj111: Django==1.11.29
dj22: Django>=2.2,<3.0
dj30: Django>=3.0,<3.1
dj31: Django>=3.1,<3.2
dj32: Django>=3.2b1,<4.0

[gh-actions]
python =
3.7: py37
3.8: py38

0 comments on commit 1eafafd

Please sign in to comment.