File: finish-removing-six-from-wtforms-ecosystem.patch

package info (click to toggle)
wtforms-json 0.3.5-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 260 kB
  • sloc: python: 819; makefile: 140; sh: 11
file content (67 lines) | stat: -rw-r--r-- 1,959 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Subject: upstream looks inactive, finish removing six from wtforms ecosystem
Author: Alexandre Detiste <tchet@debian.org>
Forwarded: https://github.com/kvesteri/wtforms-json/pull/62/files

--- a/setup.py
+++ b/setup.py
@@ -64,7 +64,6 @@
     platforms='any',
     install_requires=[
         'WTForms>=1.0.5',
-        'six>=1.3.0'
     ],
     extras_require=extras_require,
     cmdclass={'test': PyTest},
--- a/tests/test_field_type_coercion.py
+++ b/tests/test_field_type_coercion.py
@@ -1,4 +1,3 @@
-import six  # noqa
 from pytest import mark
 from wtforms import Form, IntegerField, SelectMultipleField, StringField
 try:
@@ -47,7 +46,7 @@
     )
 
 
-@mark.skipif('sa is None or six.PY3 or not HAS_SQLALCHEMY_SUPPORT')
+@mark.skipif('sa is None or True or not HAS_SQLALCHEMY_SUPPORT')
 class TestQuerySelectField(object):
     def setup_method(self, method):
         self.Base = declarative_base()
--- a/wtforms_json/__init__.py
+++ b/wtforms_json/__init__.py
@@ -3,7 +3,6 @@
 except:
     from collections import Mapping, MutableMapping
 
-import six
 from wtforms import Form
 try:
     from wtforms_sqlalchemy.fields import (
@@ -148,7 +147,7 @@
     def is_required(field):
         return DataRequired in [v.__class__ for v in field.validators]
 
-    for name, f in six.iteritems(self._fields):
+    for name, f in self._fields.items():
         if f.is_missing:
             if is_optional(f):
                 continue
@@ -206,7 +205,7 @@
                 except TypeError:
                     self.data = self.default
             else:
-                self.data = six.text_type(self.data)
+                self.data = str(self.data)
 
     return process
 
@@ -267,7 +266,7 @@
 
 def monkey_patch_process_formdata(func):
     def process_formdata(self, valuelist):
-        valuelist = list(map(six.text_type, valuelist))
+        valuelist = list(map(str, valuelist))
 
         return func(self, valuelist)
     return process_formdata