From: Bastian Krause <bst@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Bastian Krause <bst@pengutronix.de>
Subject: [ptxdist] [PATCH v3 19/19] python3-django: version bump 1.8.7 -> 2.2.16
Date: Tue, 22 Sep 2020 16:14:34 +0200 [thread overview]
Message-ID: <20200922141434.8544-19-bst@pengutronix.de> (raw)
In-Reply-To: <20200922141434.8544-1-bst@pengutronix.de>
This is the latest LTS version.
The lazy regex compile went mainline with 2bb1027d6b ("Fixed #25322 --
Lazily compiled core.validators regular expressions.").
The MigrationLoader pyc patch is no longer needed, "./manage.py migrate"
works fine.
Signed-off-by: Bastian Krause <bst@pengutronix.de>
---
Changes since v2:
- drop obsolete v1.8.7 patches
No changes since (implicit) v1.
---
...ly-compiled-core.validators-regular-.patch | 123 ------------------
...002-MigrationLoader-search-for-.py-c.patch | 36 -----
patches/Django-1.8.7/series | 2 -
rules/python3-django.in | 3 +
rules/python3-django.make | 4 +-
5 files changed, 5 insertions(+), 163 deletions(-)
delete mode 100644 patches/Django-1.8.7/0001-Fixed-25322-Lazily-compiled-core.validators-regular-.patch
delete mode 100644 patches/Django-1.8.7/0002-MigrationLoader-search-for-.py-c.patch
delete mode 100644 patches/Django-1.8.7/series
diff --git a/patches/Django-1.8.7/0001-Fixed-25322-Lazily-compiled-core.validators-regular-.patch b/patches/Django-1.8.7/0001-Fixed-25322-Lazily-compiled-core.validators-regular-.patch
deleted file mode 100644
index 3c3b0eac4..000000000
--- a/patches/Django-1.8.7/0001-Fixed-25322-Lazily-compiled-core.validators-regular-.patch
+++ /dev/null
@@ -1,123 +0,0 @@
-From 1753a76267a4dda6858d117858f233c0ed662a7f Mon Sep 17 00:00:00 2001
-From: Jonas Haag <jonas@lophus.org>
-Date: Wed, 26 Aug 2015 09:12:05 +0200
-Subject: [PATCH 1/1] Fixed #25322 -- Lazily compiled core.validators regular
- expressions.
-
-This speeds up import of 'django.core.validators' which can save a
-few hundred milliseconds when importing the module for the first
-time. It can be a significant speedup to the django-admin command.
----
- django/core/validators.py | 34 +++++++++++++++++++++++-----------
- 1 file changed, 23 insertions(+), 11 deletions(-)
-
-diff --git a/django/core/validators.py b/django/core/validators.py
-index 89d184f..7719b40 100644
---- a/django/core/validators.py
-+++ b/django/core/validators.py
-@@ -6,6 +6,7 @@ from django.core.exceptions import ValidationError
- from django.utils import six
- from django.utils.deconstruct import deconstructible
- from django.utils.encoding import force_text
-+from django.utils.functional import SimpleLazyObject
- from django.utils.ipv6 import is_valid_ipv6_address
- from django.utils.six.moves.urllib.parse import urlsplit, urlunsplit
- from django.utils.translation import ugettext_lazy as _, ungettext_lazy
-@@ -14,6 +15,18 @@ from django.utils.translation import ugettext_lazy as _, ungettext_lazy
- EMPTY_VALUES = (None, '', [], (), {})
-
-
-+def _lazy_re_compile(regex, flags=0):
-+ """Lazily compile a regex with flags."""
-+ def _compile():
-+ # Compile the regex if it was not passed pre-compiled.
-+ if isinstance(regex, six.string_types):
-+ return re.compile(regex, flags)
-+ else:
-+ assert not flags, "flags must be empty if regex is passed pre-compiled"
-+ return regex
-+ return SimpleLazyObject(_compile)
-+
-+
- @deconstructible
- class RegexValidator(object):
- regex = ''
-@@ -36,9 +49,7 @@ class RegexValidator(object):
- if self.flags and not isinstance(self.regex, six.string_types):
- raise TypeError("If the flags are set, regex must be a regular expression string.")
-
-- # Compile the regex if it was not passed pre-compiled.
-- if isinstance(self.regex, six.string_types):
-- self.regex = re.compile(self.regex, self.flags)
-+ self.regex = _lazy_re_compile(self.regex, self.flags)
-
- def __call__(self, value):
- """
-@@ -77,7 +88,7 @@ class URLValidator(RegexValidator):
- tld_re = r'\.(?:[a-z' + ul + r']{2,}|xn--[a-z0-9]+)\.?'
- host_re = '(' + hostname_re + domain_re + tld_re + '|localhost)'
-
-- regex = re.compile(
-+ regex = _lazy_re_compile(
- r'^(?:[a-z0-9\.\-]*)://' # scheme is validated separately
- r'(?:\S+(?::\S*)?@)?' # user:pass authentication
- r'(?:' + ipv4_re + '|' + ipv6_re + '|' + host_re + ')'
-@@ -126,7 +137,7 @@ class URLValidator(RegexValidator):
- url = value
-
- integer_validator = RegexValidator(
-- re.compile('^-?\d+\Z'),
-+ _lazy_re_compile('^-?\d+\Z'),
- message=_('Enter a valid integer.'),
- code='invalid',
- )
-@@ -140,16 +151,17 @@ def validate_integer(value):
- class EmailValidator(object):
- message = _('Enter a valid email address.')
- code = 'invalid'
-- user_regex = re.compile(
-+
-+ user_regex = _lazy_re_compile(
- r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*\Z" # dot-atom
- r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"\Z)', # quoted-string
- re.IGNORECASE)
-- domain_regex = re.compile(
-+ domain_regex = _lazy_re_compile(
- # max length of the domain is 249: 254 (max email length) minus one
- # period, two characters for the TLD, @ sign, & one character before @.
- r'(?:[A-Z0-9](?:[A-Z0-9-]{0,247}[A-Z0-9])?\.)+(?:[A-Z]{2,6}|[A-Z0-9-]{2,}(?<!-))\Z',
- re.IGNORECASE)
-- literal_regex = re.compile(
-+ literal_regex = _lazy_re_compile(
- # literal form, ipv4 or ipv6 address (SMTP 4.1.3)
- r'\[([A-f0-9:\.]+)\]\Z',
- re.IGNORECASE)
-@@ -209,14 +221,14 @@ class EmailValidator(object):
-
- validate_email = EmailValidator()
-
--slug_re = re.compile(r'^[-a-zA-Z0-9_]+\Z')
-+slug_re = _lazy_re_compile(r'^[-a-zA-Z0-9_]+\Z')
- validate_slug = RegexValidator(
- slug_re,
- _("Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens."),
- 'invalid'
- )
-
--ipv4_re = re.compile(r'^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\Z')
-+ipv4_re = _lazy_re_compile(r'^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\Z')
- validate_ipv4_address = RegexValidator(ipv4_re, _('Enter a valid IPv4 address.'), 'invalid')
-
-
-@@ -257,7 +269,7 @@ def ip_address_validators(protocol, unpack_ipv4):
- raise ValueError("The protocol '%s' is unknown. Supported: %s"
- % (protocol, list(ip_address_validator_map)))
-
--comma_separated_int_list_re = re.compile('^[\d,]+\Z')
-+comma_separated_int_list_re = _lazy_re_compile('^[\d,]+\Z')
- validate_comma_separated_integer_list = RegexValidator(
- comma_separated_int_list_re,
- _('Enter only digits separated by commas.'),
---
-2.6.4
-
diff --git a/patches/Django-1.8.7/0002-MigrationLoader-search-for-.py-c.patch b/patches/Django-1.8.7/0002-MigrationLoader-search-for-.py-c.patch
deleted file mode 100644
index a1dc20dff..000000000
--- a/patches/Django-1.8.7/0002-MigrationLoader-search-for-.py-c.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 65d28e3e9a47ad270e7017b6b2b269978c01c428 Mon Sep 17 00:00:00 2001
-From: Florian Scherf <f.scherf@pengutronix.de>
-Date: Wed, 3 Feb 2016 17:32:32 +0100
-Subject: [PATCH] MigrationLoader: search for *.py(c)
-
-The MigrationLoader originally searchs for *.py but we
-are running *.pyc only.
-Without this patch "./manage.py migrate" will crash.
-
-Signed-off-by: Florian Scherf <f.scherf@pengutronix.de>
----
- django/db/migrations/loader.py | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py
-index bbd60a6..77b50fd 100644
---- a/django/db/migrations/loader.py
-+++ b/django/db/migrations/loader.py
-@@ -88,10 +88,12 @@ class MigrationLoader(object):
- six.moves.reload_module(module)
- self.migrated_apps.add(app_config.label)
- directory = os.path.dirname(module.__file__)
-- # Scan for .py files
-+ # Scan for .py(c) files
- migration_names = set()
- for name in os.listdir(directory):
-- if name.endswith(".py"):
-+ root, ext = os.path.splitext(name)
-+
-+ if ext in ['.py', '.pyc']:
- import_name = name.rsplit(".", 1)[0]
- if import_name[0] not in "_.~":
- migration_names.add(import_name)
---
-2.7.0.rc3
-
diff --git a/patches/Django-1.8.7/series b/patches/Django-1.8.7/series
deleted file mode 100644
index c644f907c..000000000
--- a/patches/Django-1.8.7/series
+++ /dev/null
@@ -1,2 +0,0 @@
-0001-Fixed-25322-Lazily-compiled-core.validators-regular-.patch
-0002-MigrationLoader-search-for-.py-c.patch
diff --git a/rules/python3-django.in b/rules/python3-django.in
index 0475108bd..e55bfa582 100644
--- a/rules/python3-django.in
+++ b/rules/python3-django.in
@@ -3,6 +3,9 @@
menuconfig PYTHON3_DJANGO
tristate
select PYTHON3
+ select PYTHON3_DISTUTILS if RUNTIME
+ select PYTHON3_PYTZ if RUNTIME
+ select PYTHON3_SQLPARSE if RUNTIME
prompt "django "
help
Django is a high-level Python Web framework that encourages rapid
diff --git a/rules/python3-django.make b/rules/python3-django.make
index ffc73a4b8..64dc291ad 100644
--- a/rules/python3-django.make
+++ b/rules/python3-django.make
@@ -14,8 +14,8 @@ PACKAGES-$(PTXCONF_PYTHON3_DJANGO) += python3-django
#
# Paths and names
#
-PYTHON3_DJANGO_VERSION := 1.8.7
-PYTHON3_DJANGO_MD5 := 44c01355b5efa01938a89b8bd798b1ed
+PYTHON3_DJANGO_VERSION := 2.2.16
+PYTHON3_DJANGO_MD5 := 93faf5bbd54a19ea49f4932a813b9758
PYTHON3_DJANGO := Django-$(PYTHON3_DJANGO_VERSION)
PYTHON3_DJANGO_SUFFIX := tar.gz
PYTHON3_DJANGO_URL := https://www.djangoproject.com/download/$(PYTHON3_DJANGO_VERSION)/tarball/
--
2.28.0
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
next prev parent reply other threads:[~2020-09-22 14:14 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-22 14:14 [ptxdist] [PATCH v3 01/19] setup: introduce pypi mirror Bastian Krause
2020-09-22 14:14 ` [ptxdist] [PATCH v3 02/19] rules/pre/mirror: add ptx/mirror-pypi Bastian Krause
2020-10-06 8:18 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-22 14:14 ` [ptxdist] [PATCH v3 03/19] ptxd_lib_template: allow default url/suffix in ptxd_template_read_url Bastian Krause
2020-10-06 8:18 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-22 14:14 ` [ptxdist] [PATCH v3 04/19] package templates: add python3 template Bastian Krause
2020-10-06 8:18 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-22 14:14 ` [ptxdist] [PATCH v3 05/19] python3-async-timeout: version bump 2.0.0 -> 3.0.1 Bastian Krause
2020-10-06 8:18 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-22 14:14 ` [ptxdist] [PATCH v3 06/19] python3-chardet: version bump 2.3.0 -> 3.0.4 Bastian Krause
2020-10-06 8:18 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-22 14:14 ` [ptxdist] [PATCH v3 07/19] python3-attrs: version bump 19.3.0 -> 20.2.0 Bastian Krause
2020-10-06 8:18 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-22 14:14 ` [ptxdist] [PATCH v3 08/19] python3-idna: new package Bastian Krause
2020-10-06 8:18 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-22 14:14 ` [ptxdist] [PATCH v3 09/19] python3-yarl: version bump 0.8.1 -> 1.5.1 Bastian Krause
2020-10-06 8:18 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-22 14:14 ` [ptxdist] [PATCH v3 10/19] python3-multidict: version bump 2.1.4 -> 4.7.6 Bastian Krause
2020-10-06 8:18 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-22 14:14 ` [ptxdist] [PATCH v3 11/19] python3-aiohttp: mark dependencies as RUNTIME Bastian Krause
2020-10-06 8:18 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-22 14:14 ` [ptxdist] [PATCH v3 12/19] python3-aiohttp: add missing PYTHON3_ATTRS runtime dependency Bastian Krause
2020-10-06 8:18 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-22 14:14 ` [ptxdist] [PATCH v3 13/19] python3-aiohttp: version bump 3.4.4 -> 3.6.2 Bastian Krause
2020-10-06 8:18 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-22 14:14 ` [ptxdist] [PATCH v3 14/19] python3-aiohttp-wsgi: version bump 0.2.5 -> 0.8.2 Bastian Krause
2020-10-06 8:18 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-22 14:14 ` [ptxdist] [PATCH v3 15/19] python3-markupsafe: new package Bastian Krause
2020-10-06 8:18 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-22 14:14 ` [ptxdist] [PATCH v3 16/19] python3-jinja2: " Bastian Krause
2020-10-06 8:18 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-22 14:14 ` [ptxdist] [PATCH v3 17/19] python3-pytz: version bump 2018.5 -> 2020.1 Bastian Krause
2020-10-06 8:18 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-22 14:14 ` [ptxdist] [PATCH v3 18/19] python3-sqlparse: new package Bastian Krause
2020-10-06 8:18 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-22 14:14 ` Bastian Krause [this message]
2020-10-06 8:18 ` [ptxdist] [APPLIED] setup: introduce pypi mirror Michael Olbrich
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=20200922141434.8544-19-bst@pengutronix.de \
--to=bst@pengutronix.de \
--cc=ptxdist@pengutronix.de \
/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