[packages/python3-django-configurations] - python-django-configurations.spec updated to 2.3.2 for python 3.6+/django 2.2+ - added email-tests

qboosh qboosh at pld-linux.org
Sun Sep 24 16:13:54 CEST 2023


commit 486025dfa254d339b21437bb1a5813f0ea66e607
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Sep 24 15:34:27 2023 +0200

    - python-django-configurations.spec updated to 2.3.2 for python 3.6+/django 2.2+
    - added email-tests patch to adjust tests for dj_email_url 1.0.5+

 django-configurations-email-tests.patch            | 26 ++++++
 django-configurations-runner.patch                 | 32 -------
 ...ions.spec => python3-django-configurations.spec | 98 ++++------------------
 3 files changed, 40 insertions(+), 116 deletions(-)
---
diff --git a/python-django-configurations.spec b/python3-django-configurations.spec
similarity index 52%
rename from python-django-configurations.spec
rename to python3-django-configurations.spec
index b5579cf..811d72b 100644
--- a/python-django-configurations.spec
+++ b/python3-django-configurations.spec
@@ -7,53 +7,37 @@
 
 Summary:	Helper for organizing Django settings
 Summary(pl.UTF-8):	Moduł pomocniczy do organizowania ustawień Django
-Name:		python-django-configurations
-# keep 2.2 here for python2 support
-Version:	2.2
+Name:		python3-django-configurations
+# 2.3.x is the last version for Django 2.2
+Version:	2.3.2
 Release:	1
 License:	BSD
 Group:		Libraries/Python
 #Source0Download: https://pypi.org/simple/django-configurations/
 Source0:	https://files.pythonhosted.org/packages/source/d/django-configurations/django-configurations-%{version}.tar.gz
-# Source0-md5:	b66c70be1a6a6f1808c61cb984326d70
-Patch0:		django-configurations-runner.patch
+# Source0-md5:	54b8f7ad39dcbac2387f3c56a81cb68f
+Patch0:		django-configurations-email-tests.patch
 URL:		https://pypi.org/project/django-configurations/
-%if %{with python2}
-BuildRequires:	python-modules >= 1:2.7
-BuildRequires:	python-setuptools
-BuildRequires:	python-setuptools_scm
-%if %{with tests}
-BuildRequires:	python-Sphinx >= 1.4
-BuildRequires:	python-dj_database_url
-BuildRequires:	python-dj_email_url
-BuildRequires:	python-dj_search_url
-BuildRequires:	python-django >= 1.11
-BuildRequires:	python-django < 2.0
-BuildRequires:	python-django_cache_url >= 1.0.0
-BuildRequires:	python-mock
-BuildRequires:	python-six
-%endif
-%endif
-%if %{with python3}
-BuildRequires:	python3-modules >= 1:3.5
+BuildRequires:	python3-modules >= 1:3.6
 BuildRequires:	python3-setuptools
 BuildRequires:	python3-setuptools_scm
 %if %{with tests}
-BuildRequires:	python3-Sphinx >= 1.4
 BuildRequires:	python3-dj_database_url
-BuildRequires:	python3-dj_email_url
+BuildRequires:	python3-dj_email_url >= 1.0.5
 BuildRequires:	python3-dj_search_url
-BuildRequires:	python3-django >= 1.11
+BuildRequires:	python3-django >= 2.2
 BuildRequires:	python3-django_cache_url >= 1.0.0
-BuildRequires:	python3-six
+%if "%{py3_ver}" == "3.6" || "%{py3_ver}" == "3.7"
+BuildRequires:	python3-importlib_metadata
 %endif
 %endif
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
 %if %{with doc}
-BuildRequires:	sphinx-pdg-2 >= 1.4
+BuildRequires:	python3-django >= 2.2
+BuildRequires:	sphinx-pdg-3 >= 4
 %endif
-Requires:	python-modules >= 1:2.7
+Requires:	python3-modules >= 1:3.6
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -69,24 +53,6 @@ poleganie na składaniu klas Pythona. Rozszerza sposób ładowania
 ustawień oparty na modułach Django o dobrze ustalone wzorce
 programowania obiektowego.
 
-%package -n python3-django-configurations
-Summary:	Helper for organizing Django settings
-Summary(pl.UTF-8):	Moduł pomocniczy do organizowania ustawień Django
-Group:		Libraries/Python
-Requires:	python3-modules >= 1:3.5
-
-%description -n python3-django-configurations
-django-configurations eases Django project configuration by relying on
-the composability of Python classes. It extends the notion of Django's
-module based settings loading with well established
-object oriented programming patterns.
-
-%description -n python3-django-configurations -l pl.UTF-8
-django-configurations ułatwia konfigurowanie projektów Django poprzez
-poleganie na składaniu klas Pythona. Rozszerza sposób ładowania
-ustawień oparty na modułach Django o dobrze ustalone wzorce
-programowania obiektowego.
-
 %package apidocs
 Summary:	API documentation for Python django-configurations module
 Summary(pl.UTF-8):	Dokumentacja API modułu Pythona django-configurations
@@ -103,19 +69,6 @@ Dokumentacja API modułu Pythona django-configurations.
 %patch0 -p1
 
 %build
-%if %{with python2}
-%py_build
-
-%if %{with tests}
-#django-cadmin-2 test -v2 tests
-DJANGO_CONFIGURATION=Test \
-DJANGO_SETTINGS_MODULE=tests.settings.main \
-PYTHONPATH=$(pwd) \
-%{__python} -c 'from configurations.management import execute_from_command_line ; execute_from_command_line(["django-cadmin", "test", "-v2"])'
-%endif
-%endif
-
-%if %{with python3}
 %py3_build
 
 %if %{with tests}
@@ -125,53 +78,30 @@ DJANGO_SETTINGS_MODULE=tests.settings.main \
 PYTHONPATH=$(pwd) \
 %{__python3} -c 'from configurations.management import execute_from_command_line ; execute_from_command_line(["django-cadmin", "test", "-v2"])'
 %endif
-%endif
 
 %if %{with doc}
 PYTHONPATH=$(pwd) \
-%{__make} -C docs html \
-	SPHINXBUILD=sphinx-build-2
+sphinx-build-3 -b html docs docs/_build/html
 %endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%if %{with python2}
-%py_install
-
-%{__mv} $RPM_BUILD_ROOT%{_bindir}/django-cadmin{,-2}
-
-%py_postclean
-%endif
-
-%if %{with python3}
 %py3_install
 
 %{__mv} $RPM_BUILD_ROOT%{_bindir}/django-cadmin{,-3}
 ln -sf django-cadmin-3 $RPM_BUILD_ROOT%{_bindir}/django-cadmin
-%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%if %{with python2}
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS LICENSE README.rst
-%attr(755,root,root) %{_bindir}/django-cadmin-2
-%{py_sitescriptdir}/configurations
-%{py_sitescriptdir}/django_configurations-%{version}-py*.egg-info
-%endif
-
-%if %{with python3}
-%files -n python3-django-configurations
-%defattr(644,root,root,755)
-%doc AUTHORS LICENSE README.rst
 %attr(755,root,root) %{_bindir}/django-cadmin
 %attr(755,root,root) %{_bindir}/django-cadmin-3
 %{py3_sitescriptdir}/configurations
 %{py3_sitescriptdir}/django_configurations-%{version}-py*.egg-info
-%endif
 
 %if %{with doc}
 %files apidocs
diff --git a/django-configurations-email-tests.patch b/django-configurations-email-tests.patch
new file mode 100644
index 0000000..804295a
--- /dev/null
+++ b/django-configurations-email-tests.patch
@@ -0,0 +1,26 @@
+--- django-configurations-2.3.2/tests/test_values.py.orig	2022-01-25 10:30:05.000000000 +0100
++++ django-configurations-2.3.2/tests/test_values.py	2023-09-24 14:00:05.387028481 +0200
+@@ -411,6 +411,7 @@ class ValueTests(TestCase):
+                 'EMAIL_HOST_PASSWORD': 'password',
+                 'EMAIL_HOST_USER': 'user at domain.com',
+                 'EMAIL_PORT': 587,
++                'EMAIL_TIMEOUT': None,
+                 'EMAIL_USE_SSL': False,
+                 'EMAIL_USE_TLS': True})
+         with env(EMAIL_URL='console://'):
+@@ -421,6 +422,7 @@ class ValueTests(TestCase):
+                 'EMAIL_HOST_PASSWORD': None,
+                 'EMAIL_HOST_USER': None,
+                 'EMAIL_PORT': None,
++                'EMAIL_TIMEOUT': None,
+                 'EMAIL_USE_SSL': False,
+                 'EMAIL_USE_TLS': False})
+         with env(EMAIL_URL='smtps://user@domain.com:password@smtp.example.com:wrong'):  # noqa: E501
+@@ -503,6 +505,7 @@ class ValueTests(TestCase):
+                 'EMAIL_HOST_PASSWORD': 'password',
+                 'EMAIL_HOST_USER': 'user at domain.com',
+                 'EMAIL_PORT': 587,
++                'EMAIL_TIMEOUT': None,
+                 'EMAIL_USE_SSL': False,
+                 'EMAIL_USE_TLS': True
+             })
diff --git a/django-configurations-runner.patch b/django-configurations-runner.patch
deleted file mode 100644
index 4ff00d1..0000000
--- a/django-configurations-runner.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From ac6d31bb8310d3c3915d696d919429c2a0aa5a89 Mon Sep 17 00:00:00 2001
-From: Victor Seva <linuxmaniac at torreviejawireless.org>
-Date: Tue, 24 Mar 2020 10:52:41 +0100
-Subject: [PATCH] testing: remove django-discover-runner
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-project supports Django 1.11+
-
-> https://pypi.org/project/django-discover-runner/
-
-This runner has been added to Django 1.6 as the default test runner.
-If you use Django 1.6 or above you don’t need this app.
-
-fix #250
----
- setup.py | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/setup.py b/setup.py
-index add1cff..b032109 100644
---- a/setup.py
-+++ b/setup.py
-@@ -34,7 +34,6 @@ def read(*parts):
-         'email': ['dj-email-url'],
-         'search': ['dj-search-url'],
-         'testing': [
--            'django-discover-runner',
-             'mock',
-             'django-cache-url>=1.0.0',
-             'dj-database-url',
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-django-configurations.git/commitdiff/486025dfa254d339b21437bb1a5813f0ea66e607



More information about the pld-cvs-commit mailing list