[packages/python-wtforms] - updated to 2.1 - added tests patch
qboosh
qboosh at pld-linux.org
Tue May 29 05:40:14 CEST 2018
commit 27c5a0ad867463ab60f807fb57045fa24fee5163
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Tue May 29 05:41:12 2018 +0200
- updated to 2.1
- added tests patch
python-wtforms-tests.patch | 27 ++++++++++
python-wtforms.spec | 121 +++++++++++++++++++++++++++++++--------------
2 files changed, 112 insertions(+), 36 deletions(-)
---
diff --git a/python-wtforms.spec b/python-wtforms.spec
index cac61ed..2962aaa 100644
--- a/python-wtforms.spec
+++ b/python-wtforms.spec
@@ -1,88 +1,142 @@
#
# Conditional build:
-%bcond_without doc # don't build doc
+%bcond_without doc # don't build doc
%bcond_without tests # do not perform "make test"
%bcond_without python2 # CPython 2.x module
%bcond_without python3 # CPython 3.x module
%define module wtforms
-Summary: A flexible forms validation and rendering library for python web development
-Summary(pl.UTF-8): Biblioteka umożliwiająca generację i walidację formularzy html w jezyku python
+Summary: A flexible forms validation and rendering library for Python 2 web development
+Summary(pl.UTF-8): Elastyczna biblioteka do generowania i walidacji formularzy WWW w Pythonie 2
Name: python-%{module}
-Version: 2.0.1
-Release: 7
+Version: 2.1
+Release: 1
License: BSD
Group: Development/Languages/Python
-Source0: http://pypi.python.org/packages/source/W/WTForms/WTForms-%{version}.zip
-# Source0-md5: aaac94c137b3cd63efeb3ded51082cde
+#Source0Download: https://pypi.org/simple/wtforms/
+Source0: https://files.pythonhosted.org/packages/source/W/WTForms/WTForms-%{version}.zip
+# Source0-md5: 6938a541fafd1a1ae2f6b9b88588eef2
+Patch0: %{name}-tests.patch
URL: http://wtforms.simplecodes.com/
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.710
BuildRequires: unzip
%if %{with python2}
-BuildRequires: python-distribute
+BuildRequires: python-modules >= 1:2.6
+BuildRequires: python-setuptools
+%if %{with tests}
+BuildRequires: python-babel >= 1.3
+%if %(test -f %{py_sitescriptdir}/babel/locale-data/de_CH.dat; echo $?)
+BuildRequires: python-babel(with_locale:de_CH)
+%endif
+%if %(test -f %{py_sitescriptdir}/babel/locale-data/de_DE.dat; echo $?)
+BuildRequires: python-babel(with_locale:de_DE)
+%endif
+%if %(test -f %{py_sitescriptdir}/babel/locale-data/es_ES.dat; echo $?)
+BuildRequires: python-babel(with_locale:es_ES)
+%endif
+%if %(test -f %{py_sitescriptdir}/babel/locale-data/en_US.dat; echo $?)
+BuildRequires: python-babel(with_locale:en_US)
+%endif
+%if %(test -f %{py_sitescriptdir}/babel/locale-data/hi_IN.dat; echo $?)
+BuildRequires: python-babel(with_locale:hi_IN)
+%endif
BuildRequires: python-sqlalchemy
+%if "%{py_ver}" < "2.7"
+BuildRequires: python-ordereddict
+%endif
+%endif
%endif
%if %{with python3}
-BuildRequires: python3-distribute
-BuildRequires: python3-modules
+BuildRequires: python3-modules >= 1:3.3
+BuildRequires: python3-setuptools
+%if %{with tests}
+BuildRequires: python3-babel >= 1.3
+%if %(test -f %{py3_sitescriptdir}/babel/locale-data/de_CH.dat; echo $?)
+BuildRequires: python3-babel(with_locale:de_CH)
+%endif
+%if %(test -f %{py3_sitescriptdir}/babel/locale-data/de_DE.dat; echo $?)
+BuildRequires: python3-babel(with_locale:de_DE)
+%endif
+%if %(test -f %{py3_sitescriptdir}/babel/locale-data/es_ES.dat; echo $?)
+BuildRequires: python3-babel(with_locale:es_ES)
+%endif
+%if %(test -f %{py3_sitescriptdir}/babel/locale-data/en_US.dat; echo $?)
+BuildRequires: python3-babel(with_locale:en_US)
+%endif
+%if %(test -f %{py3_sitescriptdir}/babel/locale-data/hi_IN.dat; echo $?)
+BuildRequires: python3-babel(with_locale:hi_IN)
+%endif
BuildRequires: python3-sqlalchemy
+BuildRequires: %{py3_sitescriptdir}/babel/locale-data/de_CH.dat
+BuildRequires: %{py3_sitescriptdir}/babel/locale-data/de_DE.dat
+BuildRequires: %{py3_sitescriptdir}/babel/locale-data/es_ES.dat
+BuildRequires: %{py3_sitescriptdir}/babel/locale-data/hi_IN.dat
%endif
-
-Requires: python-modules
+%endif
+Requires: python-modules >= 1:2.6
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-A flexible forms validation and rendering library for python web
+A flexible forms validation and rendering library for Python web
development.
%description -l pl.UTF-8
-Biblioteka umożliwiająca generację i walidację formularzy html w
-jezyku python
+Elastyczna biblioteka do skadania i kontroli poprawności formularzy
+WWW w Pythonie.
%package -n python3-%{module}
-Summary: -
-Summary(pl.UTF-8): -
+Summary: A flexible forms validation and rendering library for Python 3 web development
+Summary(pl.UTF-8): Elastyczna biblioteka do generowania i walidacji formularzy WWW w Pythonie 3
Group: Libraries/Python
-Requires: python3-modules
+Requires: python3-modules >= 1:3.3
%description -n python3-%{module}
A flexible forms validation and rendering library for python web
development.
%description -n python3-%{module} -l pl.UTF-8
-Biblioteka umożliwiająca generację i walidację formularzy html w
-jezyku python
+Elastyczna biblioteka do skadania i kontroli poprawności formularzy
+WWW w Pythonie.
%package apidocs
-Summary: %{module} API documentation
-Summary(pl.UTF-8): Dokumentacja API %{module}
+Summary: API documentation for Python WTForms module
+Summary(pl.UTF-8): Dokumentacja API modułu Pythona WTForms
Group: Documentation
%description apidocs
-API documentation for %{module}.
+API documentation for Python WTForms module.
%description apidocs -l pl.UTF-8
-Dokumentacja API %{module}.
-
+Dokumentacja API modułu Pythona WTForms.
%prep
%setup -q -n WTForms-%{version}
+%patch0 -p1
+
+# disable failing test
+%{__sed} -i "/OPTIONAL_TESTS/ s/'ext_django\.tests', //" tests/runtests.py
%build
%if %{with python2}
-%py_build %{?with_tests:test}
+%py_build
+
+%if %{with tests}
+%{__python} tests/runtests.py
+%endif
%endif
%if %{with python3}
-%py3_build %{?with_tests:test}
+%py3_build
+
+%if %{with tests}
+%{__python3} tests/runtests.py
+%endif
%endif
%if %{with doc}
-cd docs
-%{__make} -j1 html
-rm -rf _build/html/_sources
+%{__make} -C docs -j1 html
%endif
%install
@@ -105,12 +159,9 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc AUTHORS.txt CHANGES.rst LICENSE.txt README.md
-# change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
%{py_sitescriptdir}/%{module}
-%if "%{py_ver}" > "2.4"
%{py_sitescriptdir}/WTForms-%{version}-py*.egg-info
%endif
-%endif
%if %{with python3}
%files -n python3-%{module}
@@ -123,7 +174,5 @@ rm -rf $RPM_BUILD_ROOT
%if %{with doc}
%files apidocs
%defattr(644,root,root,755)
-%doc docs/_build/html/*
+%doc docs/_build/html/{_static,*.html,*.js}
%endif
-
-
diff --git a/python-wtforms-tests.patch b/python-wtforms-tests.patch
new file mode 100644
index 0000000..978784f
--- /dev/null
+++ b/python-wtforms-tests.patch
@@ -0,0 +1,27 @@
+--- WTForms-2.1/tests/ext_django/tests.py.orig 2015-12-14 22:37:32.000000000 +0100
++++ WTForms-2.1/tests/ext_django/tests.py 2018-05-26 20:58:32.424304869 +0200
+@@ -33,10 +33,10 @@
+ }
+ },
+ # this fixes warnings in django 1.7
+- MIDDLEWARE_CLASSES = [
+- 'django.contrib.sessions.middleware.SessionMiddleware',
+- 'django.contrib.auth.middleware.AuthenticationMiddleware',
+- 'django.contrib.messages.middleware.MessageMiddleware',
++ MIDDLEWARE_CLASSES=[
++ 'django.contrib.sessions.middleware.SessionMiddleware',
++ 'django.contrib.auth.middleware.AuthenticationMiddleware',
++ 'django.contrib.messages.middleware.MessageMiddleware',
+ ]
+ )
+
+--- WTForms-2.1/wtforms/ext/sqlalchemy/fields.py.orig 2014-12-18 11:55:24.000000000 +0100
++++ WTForms-2.1/wtforms/ext/sqlalchemy/fields.py 2018-05-26 21:21:58.377622148 +0200
+@@ -186,5 +186,5 @@
+
+
+ def get_pk_from_identity(obj):
+- cls, key = identity_key(instance=obj)
+- return ':'.join(text_type(x) for x in key)
++ key_vals = identity_key(instance=obj)
++ return ':'.join(text_type(x) for x in key_vals[1])
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-wtforms.git/commitdiff/27c5a0ad867463ab60f807fb57045fa24fee5163
More information about the pld-cvs-commit
mailing list