1 |
commit: e586f438da0e7d5bb4b28977d9c5d879aa6fb84d |
2 |
Author: Ekaterina Vaartis <vaartis <AT> kotobank <DOT> ch> |
3 |
AuthorDate: Sun May 16 00:11:41 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jun 1 20:35:32 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e586f438 |
7 |
|
8 |
dev-python/django: Bump 3.2.3 to r1 and python 3.10 |
9 |
|
10 |
Signed-off-by: Ekaterina Vaartis <vaartis <AT> kotobank.ch> |
11 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
12 |
|
13 |
...{django-3.2.3.ebuild => django-3.2.3-r1.ebuild} | 11 ++- |
14 |
.../django/files/django-3.2.3-py310-repr.patch | 92 ++++++++++++++++++++++ |
15 |
2 files changed, 102 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/dev-python/django/django-3.2.3.ebuild b/dev-python/django/django-3.2.3-r1.ebuild |
18 |
similarity index 90% |
19 |
rename from dev-python/django/django-3.2.3.ebuild |
20 |
rename to dev-python/django/django-3.2.3-r1.ebuild |
21 |
index 87dacd55b40..310cc821be3 100644 |
22 |
--- a/dev-python/django/django-3.2.3.ebuild |
23 |
+++ b/dev-python/django/django-3.2.3-r1.ebuild |
24 |
@@ -3,7 +3,7 @@ |
25 |
|
26 |
EAPI=7 |
27 |
|
28 |
-PYTHON_COMPAT=( python3_{7..9} ) |
29 |
+PYTHON_COMPAT=( python3_{7..10} ) |
30 |
PYTHON_REQ_USE='sqlite?,threads(+)' |
31 |
|
32 |
inherit bash-completion-r1 distutils-r1 optfeature verify-sig |
33 |
@@ -50,6 +50,8 @@ BDEPEND=" |
34 |
|
35 |
PATCHES=( |
36 |
"${FILESDIR}"/${PN}-3.1-bashcomp.patch |
37 |
+ # From https://github.com/django/django/pull/14228 |
38 |
+ "${FILESDIR}"/${P}-py310-repr.patch |
39 |
) |
40 |
|
41 |
distutils_enable_sphinx docs --no-autodoc |
42 |
@@ -67,6 +69,13 @@ src_unpack() { |
43 |
default |
44 |
} |
45 |
|
46 |
+python_prepare_all() { |
47 |
+ # Fails because of warnings |
48 |
+ sed -i 's/test_dumpdata_proxy_with_concrete/_&/' tests/fixtures/tests.py |
49 |
+ |
50 |
+ distutils-r1_python_prepare_all |
51 |
+} |
52 |
+ |
53 |
python_test() { |
54 |
# Tests have non-standard assumptions about PYTHONPATH, |
55 |
# and don't work with ${BUILD_DIR}/lib. |
56 |
|
57 |
diff --git a/dev-python/django/files/django-3.2.3-py310-repr.patch b/dev-python/django/files/django-3.2.3-py310-repr.patch |
58 |
new file mode 100644 |
59 |
index 00000000000..9bc32ecf176 |
60 |
--- /dev/null |
61 |
+++ b/dev-python/django/files/django-3.2.3-py310-repr.patch |
62 |
@@ -0,0 +1,92 @@ |
63 |
+diff --git a/django/db/models/constraints.py b/django/db/models/constraints.py |
64 |
+index b073df17636a..6dfc42942f79 100644 |
65 |
+--- a/django/db/models/constraints.py |
66 |
++++ b/django/db/models/constraints.py |
67 |
+@@ -4,6 +4,7 @@ |
68 |
+ from django.db.models.indexes import IndexExpression |
69 |
+ from django.db.models.query_utils import Q |
70 |
+ from django.db.models.sql.query import Query |
71 |
++from django.utils.version import PY310 |
72 |
+ |
73 |
+ __all__ = ['CheckConstraint', 'Deferrable', 'UniqueConstraint'] |
74 |
+ |
75 |
+@@ -85,6 +86,11 @@ class Deferrable(Enum): |
76 |
+ DEFERRED = 'deferred' |
77 |
+ IMMEDIATE = 'immediate' |
78 |
+ |
79 |
++ # A similar format is used in Python 3.10+. |
80 |
++ if not PY310: |
81 |
++ def __repr__(self): |
82 |
++ return '%s.%s' % (self.__class__.__qualname__, self._name_) |
83 |
++ |
84 |
+ |
85 |
+ class UniqueConstraint(BaseConstraint): |
86 |
+ def __init__( |
87 |
+@@ -218,7 +224,7 @@ def __repr__(self): |
88 |
+ '' if not self.expressions else ' expressions=%s' % repr(self.expressions), |
89 |
+ ' name=%s' % repr(self.name), |
90 |
+ '' if self.condition is None else ' condition=%s' % self.condition, |
91 |
+- '' if self.deferrable is None else ' deferrable=%s' % self.deferrable, |
92 |
++ '' if self.deferrable is None else ' deferrable=%r' % self.deferrable, |
93 |
+ '' if not self.include else ' include=%s' % repr(self.include), |
94 |
+ '' if not self.opclasses else ' opclasses=%s' % repr(self.opclasses), |
95 |
+ ) |
96 |
+diff --git a/django/db/models/enums.py b/django/db/models/enums.py |
97 |
+index 7082a397c237..dd9088597d4d 100644 |
98 |
+--- a/django/db/models/enums.py |
99 |
++++ b/django/db/models/enums.py |
100 |
+@@ -2,6 +2,7 @@ |
101 |
+ from types import DynamicClassAttribute |
102 |
+ |
103 |
+ from django.utils.functional import Promise |
104 |
++from django.utils.version import PY310 |
105 |
+ |
106 |
+ __all__ = ['Choices', 'IntegerChoices', 'TextChoices'] |
107 |
+ |
108 |
+@@ -74,6 +75,11 @@ def __str__(self): |
109 |
+ """ |
110 |
+ return str(self.value) |
111 |
+ |
112 |
++ # A similar format is used in Python 3.10+. |
113 |
++ if not PY310: |
114 |
++ def __repr__(self): |
115 |
++ return '%s.%s' % (self.__class__.__qualname__, self._name_) |
116 |
++ |
117 |
+ |
118 |
+ class IntegerChoices(int, Choices): |
119 |
+ """Class for creating enumerated integer choices.""" |
120 |
+diff --git a/tests/model_enums/tests.py b/tests/model_enums/tests.py |
121 |
+index 78f8b146be92..cda835010d7e 100644 |
122 |
+--- a/tests/model_enums/tests.py |
123 |
++++ b/tests/model_enums/tests.py |
124 |
+@@ -48,7 +48,7 @@ def test_integerchoices(self): |
125 |
+ self.assertEqual(Suit.values, [1, 2, 3, 4]) |
126 |
+ self.assertEqual(Suit.names, ['DIAMOND', 'SPADE', 'HEART', 'CLUB']) |
127 |
+ |
128 |
+- self.assertEqual(repr(Suit.DIAMOND), '<Suit.DIAMOND: 1>') |
129 |
++ self.assertEqual(repr(Suit.DIAMOND), 'Suit.DIAMOND') |
130 |
+ self.assertEqual(Suit.DIAMOND.label, 'Diamond') |
131 |
+ self.assertEqual(Suit.DIAMOND.value, 1) |
132 |
+ self.assertEqual(Suit['DIAMOND'], Suit.DIAMOND) |
133 |
+@@ -89,7 +89,7 @@ def test_textchoices(self): |
134 |
+ self.assertEqual(YearInSchool.values, ['FR', 'SO', 'JR', 'SR', 'GR']) |
135 |
+ self.assertEqual(YearInSchool.names, ['FRESHMAN', 'SOPHOMORE', 'JUNIOR', 'SENIOR', 'GRADUATE']) |
136 |
+ |
137 |
+- self.assertEqual(repr(YearInSchool.FRESHMAN), "<YearInSchool.FRESHMAN: 'FR'>") |
138 |
++ self.assertEqual(repr(YearInSchool.FRESHMAN), 'YearInSchool.FRESHMAN') |
139 |
+ self.assertEqual(YearInSchool.FRESHMAN.label, 'Freshman') |
140 |
+ self.assertEqual(YearInSchool.FRESHMAN.value, 'FR') |
141 |
+ self.assertEqual(YearInSchool['FRESHMAN'], YearInSchool.FRESHMAN) |
142 |
+diff --git a/django/utils/version.py b/django/utils/version.py |
143 |
+index 4b26586b36..b84ca7db27 100644 |
144 |
+--- a/django/utils/version.py |
145 |
++++ b/django/utils/version.py |
146 |
+@@ -13,7 +13,7 @@ PY36 = sys.version_info >= (3, 6) |
147 |
+ PY37 = sys.version_info >= (3, 7) |
148 |
+ PY38 = sys.version_info >= (3, 8) |
149 |
+ PY39 = sys.version_info >= (3, 9) |
150 |
+- |
151 |
++PY310 = sys.version_info >= (3, 10) |
152 |
+ |
153 |
+ def get_version(version=None): |
154 |
+ """Return a PEP 440-compliant version number from VERSION.""" |