Projet

Général

Profil

0001-general-stop-supporting-django-1.8-33423.patch

Frédéric Péters, 27 mai 2019 10:31

Télécharger (5,89 ko)

Voir les différences:

Subject: [PATCH] general: stop supporting django 1.8 (#33423)

 Jenkinsfile              |  2 +-
 combo/apps/maps/forms.py | 21 ++-------------------
 combo/profile/utils.py   |  7 +------
 combo/utils/forms.py     |  7 +------
 debian/control           |  2 +-
 setup.py                 |  2 +-
 tox.ini                  | 13 ++++++-------
 7 files changed, 13 insertions(+), 41 deletions(-)
Jenkinsfile
24 24
            steps {
25 25
                script {
26 26
                    if (env.JOB_NAME == 'combo' && env.GIT_BRANCH == 'origin/master') {
27
                        sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder combo'
27
                        sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder -d stretch combo'
28 28
                    }
29 29
                }
30 30
            }
combo/apps/maps/forms.py
14 14
# You should have received a copy of the GNU Affero General Public License
15 15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 16

  
17
import django
18 17
from django import forms
19 18
from django.utils.encoding import force_text
20 19
from django.utils.text import slugify
......
22 21
from .models import MapLayer
23 22

  
24 23

  
25
if django.VERSION < (1, 11, 0):
26
    class RadioChoiceInput(forms.widgets.RadioChoiceInput):
27
        def render(self, name=None, value=None, *args, **kwargs):
28
            value = super(RadioChoiceInput, self).render(name=name, value=value, *args, **kwargs)
29
            return u'<span class="icon-%s">%s</span>' % (self.choice_value, value)
30

  
31

  
32
    class RadioFieldRenderer(forms.widgets.RadioFieldRenderer):
33
        choice_input_class = RadioChoiceInput
34

  
35

  
36
    class IconRadioSelect(forms.RadioSelect):
37
        renderer = RadioFieldRenderer
38

  
39
else:
40

  
41
    class IconRadioSelect(forms.RadioSelect):
42
        option_template_name = 'maps/icon_radio_option.html'
24
class IconRadioSelect(forms.RadioSelect):
25
    option_template_name = 'maps/icon_radio_option.html'
43 26

  
44 27

  
45 28
class MapNewLayerForm(forms.ModelForm):
combo/profile/utils.py
16 16

  
17 17
from django.conf import settings
18 18
from django.contrib.auth.models import User
19

  
20
import django
21
if django.VERSION < (1, 11, 0):
22
    CallableFalse, CallableTrue = False, True
23
else:
24
    from django.utils.deprecation import CallableFalse, CallableTrue
19
from django.utils.deprecation import CallableFalse, CallableTrue
25 20

  
26 21
if 'mellon' in settings.INSTALLED_APPS:
27 22
    from mellon.models import UserSAMLIdentifier
combo/utils/forms.py
14 14
# You should have received a copy of the GNU Affero General Public License
15 15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 16

  
17
import django
18 17
from django import forms
19 18
from django.utils.datastructures import MultiValueDict
20 19
from django.utils.safestring import mark_safe
......
41 40
                self.choices.insert(0, option_tuple)
42 41

  
43 42
        # render the <select multiple>
44
        if django.VERSION < (1, 11, 0):
45
            rendered = super(MultiSortWidget, self).render(name, value,
46
                    attrs=attrs, choices=choices)
47
        else:
48
            rendered = super(MultiSortWidget, self).render(name, value,
43
        rendered = super(MultiSortWidget, self).render(name, value,
49 44
                    attrs=attrs)
50 45

  
51 46
        # include it in a <div> that will be turned into an appropriate widget
debian/control
9 9
Package: python-combo
10 10
Architecture: all
11 11
Depends: ${misc:Depends}, ${python:Depends},
12
    python-django (>= 1.8),
12
    python-django (>= 1:1.11),
13 13
    python-djangorestframework (>= 3.3),
14 14
    python-gadjo (>= 0.53),
15 15
    python-pyproj,
setup.py
146 146
        'Programming Language :: Python :: 2',
147 147
        'Programming Language :: Python :: 3',
148 148
    ],
149
    install_requires=['django>=1.8, <1.12',
149
    install_requires=['django>=1.11, <1.12',
150 150
        'django-ckeditor<=4.5.3',
151 151
        'gadjo>=0.53',
152 152
        'feedparser',
tox.ini
1 1
[tox]
2 2
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/combo/{env:BRANCH_NAME:}
3
envlist = py2-django18,coverage-py2-django111-pylint,py3-django111
3
envlist = coverage-py2-pylint,py3
4 4

  
5 5
[testenv]
6 6
usedevelop = True
......
9 9
  py2: WCSCTL=wcs/wcsctl.py
10 10
  DJANGO_SETTINGS_MODULE=combo.settings
11 11
  COMBO_SETTINGS_FILE=tests/settings.py
12
  coverage: COVERAGE=--junitxml=test_results.xml --cov-report xml --cov-report html --cov=combo/
12 13
deps =
13
  django18: django>=1.8,<1.9
14
  django111: django>=1.11,<1.12
15
  django111: pywebpush
14
  django>=1.11,<1.12
15
  pywebpush
16 16
  pytest-cov
17 17
  pytest-django
18 18
  pytest-freezegun
......
32 32
  ./getlasso.sh
33 33
  python manage.py compilemessages
34 34
  ./get_wcs.sh
35
  django18: py.test {posargs: --junitxml=test_{envname}_results.xml --cov-report xml --cov-report html --cov=combo/ tests/}
36
  django18: ./pylint.sh combo/
37
  django111: py.test {posargs: --junitxml=test_{envname}_results.xml tests/}
35
  py.test {env:COVERAGE:} {posargs:tests/}
36
  ./pylint.sh combo/
38
-