general: stop supporting django 1.8 (#33423)
This commit is contained in:
parent
1f5bc01627
commit
496bdb525f
|
@ -24,7 +24,7 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
if (env.JOB_NAME == 'combo' && env.GIT_BRANCH == 'origin/master') {
|
if (env.JOB_NAME == 'combo' && env.GIT_BRANCH == 'origin/master') {
|
||||||
sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder combo'
|
sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder -d stretch combo'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import django
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
from django.utils.text import slugify
|
from django.utils.text import slugify
|
||||||
|
@ -22,24 +21,8 @@ from django.utils.text import slugify
|
||||||
from .models import MapLayer
|
from .models import MapLayer
|
||||||
|
|
||||||
|
|
||||||
if django.VERSION < (1, 11, 0):
|
class IconRadioSelect(forms.RadioSelect):
|
||||||
class RadioChoiceInput(forms.widgets.RadioChoiceInput):
|
option_template_name = 'maps/icon_radio_option.html'
|
||||||
def render(self, name=None, value=None, *args, **kwargs):
|
|
||||||
value = super(RadioChoiceInput, self).render(name=name, value=value, *args, **kwargs)
|
|
||||||
return u'<span class="icon-%s">%s</span>' % (self.choice_value, value)
|
|
||||||
|
|
||||||
|
|
||||||
class RadioFieldRenderer(forms.widgets.RadioFieldRenderer):
|
|
||||||
choice_input_class = RadioChoiceInput
|
|
||||||
|
|
||||||
|
|
||||||
class IconRadioSelect(forms.RadioSelect):
|
|
||||||
renderer = RadioFieldRenderer
|
|
||||||
|
|
||||||
else:
|
|
||||||
|
|
||||||
class IconRadioSelect(forms.RadioSelect):
|
|
||||||
option_template_name = 'maps/icon_radio_option.html'
|
|
||||||
|
|
||||||
|
|
||||||
class MapNewLayerForm(forms.ModelForm):
|
class MapNewLayerForm(forms.ModelForm):
|
||||||
|
|
|
@ -16,12 +16,7 @@
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
from django.utils.deprecation import CallableFalse, CallableTrue
|
||||||
import django
|
|
||||||
if django.VERSION < (1, 11, 0):
|
|
||||||
CallableFalse, CallableTrue = False, True
|
|
||||||
else:
|
|
||||||
from django.utils.deprecation import CallableFalse, CallableTrue
|
|
||||||
|
|
||||||
if 'mellon' in settings.INSTALLED_APPS:
|
if 'mellon' in settings.INSTALLED_APPS:
|
||||||
from mellon.models import UserSAMLIdentifier
|
from mellon.models import UserSAMLIdentifier
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import django
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.datastructures import MultiValueDict
|
from django.utils.datastructures import MultiValueDict
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
|
@ -41,11 +40,7 @@ class MultiSortWidget(forms.SelectMultiple):
|
||||||
self.choices.insert(0, option_tuple)
|
self.choices.insert(0, option_tuple)
|
||||||
|
|
||||||
# render the <select multiple>
|
# render the <select multiple>
|
||||||
if django.VERSION < (1, 11, 0):
|
rendered = super(MultiSortWidget, self).render(name, value,
|
||||||
rendered = super(MultiSortWidget, self).render(name, value,
|
|
||||||
attrs=attrs, choices=choices)
|
|
||||||
else:
|
|
||||||
rendered = super(MultiSortWidget, self).render(name, value,
|
|
||||||
attrs=attrs)
|
attrs=attrs)
|
||||||
|
|
||||||
# include it in a <div> that will be turned into an appropriate widget
|
# include it in a <div> that will be turned into an appropriate widget
|
||||||
|
|
|
@ -9,7 +9,7 @@ X-Python-Version: >= 2.7
|
||||||
Package: python-combo
|
Package: python-combo
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Depends: ${misc:Depends}, ${python:Depends},
|
Depends: ${misc:Depends}, ${python:Depends},
|
||||||
python-django (>= 1.8),
|
python-django (>= 1:1.11),
|
||||||
python-djangorestframework (>= 3.3),
|
python-djangorestframework (>= 3.3),
|
||||||
python-gadjo (>= 0.53),
|
python-gadjo (>= 0.53),
|
||||||
python-pyproj,
|
python-pyproj,
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -146,7 +146,7 @@ setup(
|
||||||
'Programming Language :: Python :: 2',
|
'Programming Language :: Python :: 2',
|
||||||
'Programming Language :: Python :: 3',
|
'Programming Language :: Python :: 3',
|
||||||
],
|
],
|
||||||
install_requires=['django>=1.8, <1.12',
|
install_requires=['django>=1.11, <1.12',
|
||||||
'django-ckeditor<=4.5.3',
|
'django-ckeditor<=4.5.3',
|
||||||
'gadjo>=0.53',
|
'gadjo>=0.53',
|
||||||
'feedparser',
|
'feedparser',
|
||||||
|
|
13
tox.ini
13
tox.ini
|
@ -1,6 +1,6 @@
|
||||||
[tox]
|
[tox]
|
||||||
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/combo/{env:BRANCH_NAME:}
|
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/combo/{env:BRANCH_NAME:}
|
||||||
envlist = py2-django18,coverage-py2-django111-pylint,py3-django111
|
envlist = coverage-py2-pylint,py3
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
|
@ -9,10 +9,10 @@ setenv =
|
||||||
py2: WCSCTL=wcs/wcsctl.py
|
py2: WCSCTL=wcs/wcsctl.py
|
||||||
DJANGO_SETTINGS_MODULE=combo.settings
|
DJANGO_SETTINGS_MODULE=combo.settings
|
||||||
COMBO_SETTINGS_FILE=tests/settings.py
|
COMBO_SETTINGS_FILE=tests/settings.py
|
||||||
|
coverage: COVERAGE=--cov-report xml --cov-report html --cov=combo/
|
||||||
deps =
|
deps =
|
||||||
django18: django>=1.8,<1.9
|
django>=1.11,<1.12
|
||||||
django111: django>=1.11,<1.12
|
pywebpush
|
||||||
django111: pywebpush
|
|
||||||
pytest-cov
|
pytest-cov
|
||||||
pytest-django
|
pytest-django
|
||||||
pytest-freezegun
|
pytest-freezegun
|
||||||
|
@ -32,6 +32,5 @@ commands =
|
||||||
./getlasso.sh
|
./getlasso.sh
|
||||||
python manage.py compilemessages
|
python manage.py compilemessages
|
||||||
./get_wcs.sh
|
./get_wcs.sh
|
||||||
django18: py.test {posargs: --junitxml=test_{envname}_results.xml --cov-report xml --cov-report html --cov=combo/ tests/}
|
py.test {env:COVERAGE:} {posargs: --junitxml=test_{envname}_results.xml tests/}
|
||||||
django18: ./pylint.sh combo/
|
pylint: ./pylint.sh combo/
|
||||||
django111: py.test {posargs: --junitxml=test_{envname}_results.xml tests/}
|
|
||||||
|
|
Loading…
Reference in New Issue