Skip to contentSkip to conversation

package/python-django: bump to version 2.2.6

PATCH Superseded aduskett at gmail.com 2 participants 3 messages Oct 15, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/python-django: bump to version 2.2.6

From: Adam Duskett <[email protected]>

---
 package/python-django/python-django.hash | 4 ++--
 package/python-django/python-django.mk   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
package/python-django/python-django.hash +2 -2
index b89ee907d3..0e6b7b2c63 100644
@@ -1,5 +1,5 @@
 # md5, sha256 from https://pypi.org/pypi/django/json
-md5	b32e396c354880742d85a7628a0bdd5a  Django-2.2.4.tar.gz
-sha256	16a5d54411599780ac9dfe3b9b38f90f785c51259a584e0b24b6f14a7f69aae8  Django-2.2.4.tar.gz
+md5	796c175a2f94e938c60d84b4565216af  Django-2.2.6.tar.gz
+sha256	a8ca1033acac9f33995eb2209a6bf18a4681c3e5269a878e9a7e0b7384ed1ca3  Django-2.2.6.tar.gz
 # Locally computed sha256 checksums
 sha256	b846415d1b514e9c1dff14a22deb906d794bc546ca6129f950a18cd091e2a669  LICENSE
package/python-django/python-django.mk +2 -2
index 7dbf7a38fd..1c810b8af7 100644
@@ -4,10 +4,10 @@
 #
 ################################################################################
 
-PYTHON_DJANGO_VERSION = 2.2.4
+PYTHON_DJANGO_VERSION = 2.2.6
 PYTHON_DJANGO_SOURCE = Django-$(PYTHON_DJANGO_VERSION).tar.gz
 # The official Django site has an unpractical URL
-PYTHON_DJANGO_SITE = https://files.pythonhosted.org/packages/19/11/3449a2071df9427e7a5c4dddee2462e88840dd968a9b0c161097154fcb0c
+PYTHON_DJANGO_SITE = https://files.pythonhosted.org/packages/c7/2c/bbd0fddf6a08456c3100b8e8b230f3288d4511985aa4e2368b0d115b5aae
 PYTHON_DJANGO_LICENSE = BSD-3-Clause
 PYTHON_DJANGO_LICENSE_FILES = LICENSE
 PYTHON_DJANGO_SETUP_TYPE = setuptools
Signature · 1 line
2.21.0
#1 lore raw

PATCH 2/2 support/testing/tests/package/test_python_django.py: New test

From: Adam Duskett <[email protected]>

This test comprises of two simple steps:
1: Start a new simple project called testsite.
2: Run ./manage.py migrate on the new testsite.

---
 .gitlab-ci.yml                                |  1 +
 .../tests/package/sample_python_django.py     |  1 +
 .../tests/package/test_python_django.py       | 26 +++++++++++++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 support/testing/tests/package/sample_python_django.py
 create mode 100644 support/testing/tests/package/test_python_django.py
.gitlab-ci.yml +1 -0
index 59efd51340..a840bcba0e 100644
@@ -438,6 +438,7 @@ tests.package.test_python_constantly.TestPythonPy3Constantly: { extends: .runtim
 tests.package.test_python_crossbar.TestPythonPy3Crossbar: { extends: .runtime_test }
 tests.package.test_python_cryptography.TestPythonPy2Cryptography: { extends: .runtime_test }
 tests.package.test_python_cryptography.TestPythonPy3Cryptography: { extends: .runtime_test }
+tests.package.test_python_django.TestPythonPy3Django: { extends: .runtime_test }
 tests.package.test_python_incremental.TestPythonPy2Incremental: { extends: .runtime_test }
 tests.package.test_python_incremental.TestPythonPy3Incremental: { extends: .runtime_test }
 tests.package.test_python_passlib.TestPythonPy2Passlib: { extends: .runtime_test }
support/testing/tests/package/sample_python_django.py new file +1 -0
new file mode 100644
index 0000000000..e7753d48fb
@@ -0,0 +1 @@
+import django
support/testing/tests/package/test_python_django.py new file +26 -0
new file mode 100644
index 0000000000..595134f50e
@@ -0,0 +1,26 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonDjango(TestPythonPackageBase):
+    config = TestPythonPackageBase.config
+    sample_scripts = ["tests/package/sample_python_django.py"]
+
+    def run_sample_scripts(self):
+        cmd = "cd /opt; /usr/bin/django-admin startproject testsite"
+        _, exit_code = self.emulator.run(cmd, timeout=30)
+        self.assertEqual(exit_code, 0)
+        cmd = "cd /opt/testsite; " + self.interpreter + " ./manage.py migrate"
+        output, exit_code = self.emulator.run(cmd, timeout=30)
+        self.assertIn("Operations to perform:", output[0])
+        self.assertEqual(exit_code, 0)
+
+class TestPythonPy3Django(TestPythonDjango):
+    __test__ = True
+    config = TestPythonDjango.config + \
+        """
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_DJANGO=y
+        BR2_PACKAGE_PYTHON_SQLPARSE=y
+        BR2_PACKAGE_PYTHON3_SQLITE=y
+        """
+
Signature · 1 line
2.21.0
#2 lore raw

PATCH 2/2 support/testing/tests/package/test_python_django.py: New test

Hello,

Quoted 1 line · On Tue, Oct 15, 2019 at 03:13 PM, wrote:

support/testing/tests/package/test_python_django.py: New test

The commit summary should be:
support/testing: add python-django test

Quoted 5 lines

This test comprises of two simple steps:
1: Start a new simple project called testsite.
2: Run ./manage.py migrate on the new testsite.

After changing the commit summary and fixing the warnings from flake8, and changing or not the ';' to '&&' between the commands, you can add:

I tested both the original patch and with all suggestions to the test I make below, so this tag is unconditional:

Quoted 8 lines
---
 .gitlab-ci.yml                                |  1 +
 .../tests/package/sample_python_django.py     |  1 +
 .../tests/package/test_python_django.py       | 26 +++++++++++++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 support/testing/tests/package/sample_python_django.py
 create mode 100644 support/testing/tests/package/test_python_django.py

Tip: if you add this file to your entry in the DEVELOPERS file you will be notified if it ever fails.

[snip]

support/testing/tests/package/sample_python_django.py line 1

Quoted 3 lines

+++ b/support/testing/tests/package/sample_python_django.py

support/testing/tests/package/sample_python_django.py new file +1 -0
@@ -0,0 +1 @@
+import django

In order to comply to flake8:
sample_python_django.py:1:1: F401 'django' imported but unused use:
import django # noqa: F401

Quoted 6 lines
support/testing/tests/package/test_python_django.py new file +0 -0
new file mode 100644
index 0000000000..595134f50e

support/testing/tests/package/test_python_django.py line 9

Quoted 9 lines
support/testing/tests/package/test_python_django.py new file +9 -0
@@ -0,0 +1,26 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonDjango(TestPythonPackageBase):
+    config = TestPythonPackageBase.config
+    sample_scripts = ["tests/package/sample_python_django.py"]
+
+    def run_sample_scripts(self):
+        cmd = "cd /opt; /usr/bin/django-admin startproject testsite"

This ';' reminded me about a suggestion (a long time ago) from Thomas that is still pending on my TODO list for another test... I will repeat it here:

        cmd = "cd /opt && /usr/bin/django-admin startproject testsite"

Maybe && between each command would be better?

support/testing/tests/package/test_python_django.py line 12

Quoted 3 lines
support/testing/tests/package/test_python_django.py new file +3 -0
+        _, exit_code = self.emulator.run(cmd, timeout=30)
+        self.assertEqual(exit_code, 0)
+        cmd = "cd /opt/testsite; " + self.interpreter + " ./manage.py migrate"

The same here:

        cmd = "cd /opt/testsite && " + self.interpreter + " ./manage.py migrate"

support/testing/tests/package/test_python_django.py line 16

Quoted 4 lines
support/testing/tests/package/test_python_django.py new file +4 -0
+        output, exit_code = self.emulator.run(cmd, timeout=30)
+        self.assertIn("Operations to perform:", output[0])
+        self.assertEqual(exit_code, 0)
+

test_python_django.py:17:1: E302 expected 2 blank lines, found 1

support/testing/tests/package/test_python_django.py line 26

Quoted 11 lines
support/testing/tests/package/test_python_django.py new file +10 -0
+class TestPythonPy3Django(TestPythonDjango):
+    __test__ = True
+    config = TestPythonDjango.config + \
+        """
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_DJANGO=y
+        BR2_PACKAGE_PYTHON_SQLPARSE=y
+        BR2_PACKAGE_PYTHON3_SQLITE=y
+        """
 
+

test_python_django.py:26:1: W391 blank line at end of file

Quoted 2 lines
Signature · 1 line
2.21.0

Regards,
Ricardo