From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/django/files/, dev-python/django/
Date: Tue, 1 Jun 2021 20:35:41 +0000 (UTC) [thread overview]
Message-ID: <1622579732.e586f438da0e7d5bb4b28977d9c5d879aa6fb84d.mgorny@gentoo> (raw)
commit: e586f438da0e7d5bb4b28977d9c5d879aa6fb84d
Author: Ekaterina Vaartis <vaartis <AT> kotobank <DOT> ch>
AuthorDate: Sun May 16 00:11:41 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jun 1 20:35:32 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e586f438
dev-python/django: Bump 3.2.3 to r1 and python 3.10
Signed-off-by: Ekaterina Vaartis <vaartis <AT> kotobank.ch>
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
...{django-3.2.3.ebuild => django-3.2.3-r1.ebuild} | 11 ++-
.../django/files/django-3.2.3-py310-repr.patch | 92 ++++++++++++++++++++++
2 files changed, 102 insertions(+), 1 deletion(-)
diff --git a/dev-python/django/django-3.2.3.ebuild b/dev-python/django/django-3.2.3-r1.ebuild
similarity index 90%
rename from dev-python/django/django-3.2.3.ebuild
rename to dev-python/django/django-3.2.3-r1.ebuild
index 87dacd55b40..310cc821be3 100644
--- a/dev-python/django/django-3.2.3.ebuild
+++ b/dev-python/django/django-3.2.3-r1.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python3_{7..9} )
+PYTHON_COMPAT=( python3_{7..10} )
PYTHON_REQ_USE='sqlite?,threads(+)'
inherit bash-completion-r1 distutils-r1 optfeature verify-sig
@@ -50,6 +50,8 @@ BDEPEND="
PATCHES=(
"${FILESDIR}"/${PN}-3.1-bashcomp.patch
+ # From https://github.com/django/django/pull/14228
+ "${FILESDIR}"/${P}-py310-repr.patch
)
distutils_enable_sphinx docs --no-autodoc
@@ -67,6 +69,13 @@ src_unpack() {
default
}
+python_prepare_all() {
+ # Fails because of warnings
+ sed -i 's/test_dumpdata_proxy_with_concrete/_&/' tests/fixtures/tests.py
+
+ distutils-r1_python_prepare_all
+}
+
python_test() {
# Tests have non-standard assumptions about PYTHONPATH,
# and don't work with ${BUILD_DIR}/lib.
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
new file mode 100644
index 00000000000..9bc32ecf176
--- /dev/null
+++ b/dev-python/django/files/django-3.2.3-py310-repr.patch
@@ -0,0 +1,92 @@
+diff --git a/django/db/models/constraints.py b/django/db/models/constraints.py
+index b073df17636a..6dfc42942f79 100644
+--- a/django/db/models/constraints.py
++++ b/django/db/models/constraints.py
+@@ -4,6 +4,7 @@
+ from django.db.models.indexes import IndexExpression
+ from django.db.models.query_utils import Q
+ from django.db.models.sql.query import Query
++from django.utils.version import PY310
+
+ __all__ = ['CheckConstraint', 'Deferrable', 'UniqueConstraint']
+
+@@ -85,6 +86,11 @@ class Deferrable(Enum):
+ DEFERRED = 'deferred'
+ IMMEDIATE = 'immediate'
+
++ # A similar format is used in Python 3.10+.
++ if not PY310:
++ def __repr__(self):
++ return '%s.%s' % (self.__class__.__qualname__, self._name_)
++
+
+ class UniqueConstraint(BaseConstraint):
+ def __init__(
+@@ -218,7 +224,7 @@ def __repr__(self):
+ '' if not self.expressions else ' expressions=%s' % repr(self.expressions),
+ ' name=%s' % repr(self.name),
+ '' if self.condition is None else ' condition=%s' % self.condition,
+- '' if self.deferrable is None else ' deferrable=%s' % self.deferrable,
++ '' if self.deferrable is None else ' deferrable=%r' % self.deferrable,
+ '' if not self.include else ' include=%s' % repr(self.include),
+ '' if not self.opclasses else ' opclasses=%s' % repr(self.opclasses),
+ )
+diff --git a/django/db/models/enums.py b/django/db/models/enums.py
+index 7082a397c237..dd9088597d4d 100644
+--- a/django/db/models/enums.py
++++ b/django/db/models/enums.py
+@@ -2,6 +2,7 @@
+ from types import DynamicClassAttribute
+
+ from django.utils.functional import Promise
++from django.utils.version import PY310
+
+ __all__ = ['Choices', 'IntegerChoices', 'TextChoices']
+
+@@ -74,6 +75,11 @@ def __str__(self):
+ """
+ return str(self.value)
+
++ # A similar format is used in Python 3.10+.
++ if not PY310:
++ def __repr__(self):
++ return '%s.%s' % (self.__class__.__qualname__, self._name_)
++
+
+ class IntegerChoices(int, Choices):
+ """Class for creating enumerated integer choices."""
+diff --git a/tests/model_enums/tests.py b/tests/model_enums/tests.py
+index 78f8b146be92..cda835010d7e 100644
+--- a/tests/model_enums/tests.py
++++ b/tests/model_enums/tests.py
+@@ -48,7 +48,7 @@ def test_integerchoices(self):
+ self.assertEqual(Suit.values, [1, 2, 3, 4])
+ self.assertEqual(Suit.names, ['DIAMOND', 'SPADE', 'HEART', 'CLUB'])
+
+- self.assertEqual(repr(Suit.DIAMOND), '<Suit.DIAMOND: 1>')
++ self.assertEqual(repr(Suit.DIAMOND), 'Suit.DIAMOND')
+ self.assertEqual(Suit.DIAMOND.label, 'Diamond')
+ self.assertEqual(Suit.DIAMOND.value, 1)
+ self.assertEqual(Suit['DIAMOND'], Suit.DIAMOND)
+@@ -89,7 +89,7 @@ def test_textchoices(self):
+ self.assertEqual(YearInSchool.values, ['FR', 'SO', 'JR', 'SR', 'GR'])
+ self.assertEqual(YearInSchool.names, ['FRESHMAN', 'SOPHOMORE', 'JUNIOR', 'SENIOR', 'GRADUATE'])
+
+- self.assertEqual(repr(YearInSchool.FRESHMAN), "<YearInSchool.FRESHMAN: 'FR'>")
++ self.assertEqual(repr(YearInSchool.FRESHMAN), 'YearInSchool.FRESHMAN')
+ self.assertEqual(YearInSchool.FRESHMAN.label, 'Freshman')
+ self.assertEqual(YearInSchool.FRESHMAN.value, 'FR')
+ self.assertEqual(YearInSchool['FRESHMAN'], YearInSchool.FRESHMAN)
+diff --git a/django/utils/version.py b/django/utils/version.py
+index 4b26586b36..b84ca7db27 100644
+--- a/django/utils/version.py
++++ b/django/utils/version.py
+@@ -13,7 +13,7 @@ PY36 = sys.version_info >= (3, 6)
+ PY37 = sys.version_info >= (3, 7)
+ PY38 = sys.version_info >= (3, 8)
+ PY39 = sys.version_info >= (3, 9)
+-
++PY310 = sys.version_info >= (3, 10)
+
+ def get_version(version=None):
+ """Return a PEP 440-compliant version number from VERSION."""
next reply other threads:[~2021-06-01 20:35 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-01 20:35 Michał Górny [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-05-08 5:32 [gentoo-commits] repo/gentoo:master commit in: dev-python/django/files/, dev-python/django/ Michał Górny
2024-07-10 6:38 Michał Górny
2024-06-19 17:21 Michał Górny
2023-07-23 11:24 Michał Górny
2023-05-04 15:30 Michał Górny
2023-05-04 8:06 Michał Górny
2023-03-30 15:41 Michał Górny
2022-06-13 7:18 Michał Górny
2021-12-07 23:27 Michał Górny
2021-10-17 21:15 Michał Górny
2021-08-03 8:52 Michał Górny
2021-05-09 8:23 Michał Górny
2021-02-13 20:15 Michał Górny
2020-10-29 20:25 Michał Górny
2020-05-06 6:04 Michał Górny
2020-03-05 19:07 Michał Górny
2018-09-03 13:33 Virgil Dupras
2018-07-21 1:06 Virgil Dupras
2018-07-21 0:20 Virgil Dupras
2015-12-02 7:53 Justin Lecher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1622579732.e586f438da0e7d5bb4b28977d9c5d879aa6fb84d.mgorny@gentoo \
--to=mgorny@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox