From ae2dd37aa0c9d65d57fe5a6b6520b65176e038c272558e05cf2fd36446a107c1 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 13 Aug 2018 08:39:20 +0000 Subject: [PATCH 1/3] - Remove dependency on unittetst2 Added remove_unittest2.patch to facilitate that OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-html2text?expand=0&rev=25 --- python-html2text.changes | 6 ++++ python-html2text.spec | 57 ++++++++++++++++++----------------- remove_unittest2.patch | 64 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+), 27 deletions(-) create mode 100644 remove_unittest2.patch diff --git a/python-html2text.changes b/python-html2text.changes index 917b3ab..44013b0 100644 --- a/python-html2text.changes +++ b/python-html2text.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Aug 13 08:38:04 UTC 2018 - mcepl@suse.com + +- Remove dependency on unittetst2 + Added remove_unittest2.patch to facilitate that + ------------------------------------------------------------------- Thu Apr 27 16:33:29 UTC 2017 - toddrme2178@gmail.com diff --git a/python-html2text.spec b/python-html2text.spec index 748456e..f4b4da1 100644 --- a/python-html2text.spec +++ b/python-html2text.spec @@ -1,7 +1,7 @@ # # spec file for package python-html2text # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,27 +16,26 @@ # -%bcond_without tests +# +%define upname html2text %{?!python_module:%define python_module() python-%{**} python3-%{**}} -Name: python-html2text +%bcond_without tests +Name: python-%{upname} Version: 2016.9.19 Release: 0 -Url: https://github.com/Alir3z4/html2text/ Summary: Turn HTML into equivalent Markdown-structured text -License: GPL-3.0 +License: GPL-3.0-only Group: Development/Languages/Python -Source: https://files.pythonhosted.org/packages/source/h/html2text/html2text-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: fdupes -BuildRequires: python-rpm-macros +URL: https://github.com/Alir3z4/html2text/ +Source: https://files.pythonhosted.org/packages/source/h/%{upname}/%{upname}-%{version}.tar.gz +Patch0: remove_unittest2.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} -%if %{with tests} -BuildRequires: python2-unittest2 -%endif -Requires(post): update-alternatives -Requires(preun): update-alternatives +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires(post): update-alternatives +Requires(preun): update-alternatives BuildArch: noarch %python_subpackages @@ -46,9 +45,10 @@ easy-to-read plain ASCII text. Better yet, that ASCII also happens to be valid Markdown (a text-to-HTML format). %prep -%setup -q -n html2text-%{version} +%setup -q -n %{upname}-%{version} +%patch0 -p1 # remove useless shebang -sed -i '/^#!/d' html2text/__init__.py +sed -i '/^#!/d' %{upname}/__init__.py %build %python_build @@ -58,15 +58,18 @@ sed -i '/^#!/d' html2text/__init__.py %python_expand %fdupes %{buildroot}%{$python_sitelib} # To avoid conflicts with the rst2html5 package -mv %{buildroot}%{_bindir}/html2text %{buildroot}%{_bindir}/html2text-python -ln -s -f %{_sysconfdir}/alternatives/html2text %{buildroot}%{_bindir}/html2text +mv %{buildroot}%{_bindir}/%{upname} %{buildroot}%{_bindir}/%{upname}-python +ln -s -f %{_sysconfdir}/alternatives/%{upname} %{buildroot}%{_bindir}/%{upname} + +# remove executable bits from egg files +%python_expand chmod -x %{buildroot}%{$python_sitelib}/%{upname}-*.egg-info/* %post -update-alternatives --install %{_bindir}/html2text html2text %{_bindir}/html2text-python 15 +update-alternatives --install %{_bindir}/%{upname} %{upname} %{_bindir}/%{upname}-python 15 %preun -if [ ! -f %{_bindir}/html2text-python ] ; then - update-alternatives --remove html2text %{_bindir}/html2text-python +if [ ! -f %{_bindir}/%{upname}-python ] ; then + update-alternatives --remove %{upname} %{_bindir}/%{upname}-python fi %if %{with tests} @@ -74,12 +77,12 @@ fi %python_exec setup.py test %endif -%files %python_files -%defattr(-,root,root,-) -%doc COPYING README.md AUTHORS.rst ChangeLog.rst -%python3_only %{_bindir}/html2text -%python3_only %{_bindir}/html2text-python -%python3_only %ghost %{_sysconfdir}/alternatives/html2text +%files %{python_files} +%license COPYING +%doc README.md AUTHORS.rst ChangeLog.rst +%python3_only %{_bindir}/%{upname} +%python3_only %{_bindir}/%{upname}-python +%python3_only %ghost %{_sysconfdir}/alternatives/%{upname} %{python_sitelib}/* %changelog diff --git a/remove_unittest2.patch b/remove_unittest2.patch new file mode 100644 index 0000000..8bf330c --- /dev/null +++ b/remove_unittest2.patch @@ -0,0 +1,64 @@ +--- a/setup.py ++++ b/setup.py +@@ -9,14 +9,7 @@ try: + except ImportError: + read_md = lambda f: open(f, 'r').read() + +-requires_list = [] +-try: +- import unittest2 as unittest +-except ImportError: +- import unittest +-else: +- if sys.version_info <= (2, 6): +- requires_list.append("unittest2") ++import unittest + + + class RunTests(Command): +@@ -59,9 +52,6 @@ setup( + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', +- 'Programming Language :: Python :: 2.4', +- 'Programming Language :: Python :: 2.5', +- 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.0', +@@ -75,7 +65,6 @@ setup( + html2text=html2text.cli:main + """, + license='GNU GPL 3', +- requires=requires_list, + packages=find_packages(exclude=['test']), + include_package_data=True, + zip_safe=False, +--- a/test/test_html2text.py ++++ b/test/test_html2text.py +@@ -5,10 +5,7 @@ import re + import subprocess + import sys + +-if sys.version_info[:2] < (2, 7): +- import unittest2 as unittest +-else: +- import unittest ++import unittest + import logging + + logging.basicConfig(format='%(levelname)s:%(funcName)s:%(message)s', +--- a/test/test_memleak.py ++++ b/test/test_memleak.py +@@ -1,9 +1,7 @@ + import sys +-if sys.version_info[:2] < (2, 7): +- import unittest2 as unittest +-else: +- import unittest + import logging ++import unittest ++ + logging.basicConfig(format='%(levelname)s:%(funcName)s:%(message)s', + level=logging.DEBUG) + From c5b6b6eb96fa7745de70c4816c2b2c7773b4bccef4e2560d80de864b090c6157 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 13 Aug 2018 11:48:24 +0000 Subject: [PATCH 2/3] - Upgrade to 2018.1.9: Fix #188: Non-ASCII in title attribute causes encode error. Feature #194: Add support for the tag. Feature #193: Add support for the tag. Fix #157: Fix images link with div wrap Fix #55: Fix error when empty title tags Fix #160: The html2text tests are failing on Windows and on Cygwin due to differences in eol handling between Windows/*nix Feature #164: Housekeeping: Add flake8 to the travis build, cleanup existing flake8 violations, add py3.6 and pypy3 to the travis build Fix #109: Fix for unexpanded < > & Fix #143: Fix line wrapping for the lines starting with bold Adds support for numeric bold text indication in font-weight, as used by Google (and presumably others.) Fix #173 and #142: Stripping whitespace in crucial markdown and adding whitespace as necessary Don't drop any cell data on tables uneven row lengths (e.g. colspan in use) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-html2text?expand=0&rev=26 --- html2text-2016.9.19.tar.gz | 3 --- html2text-2018.1.9.tar.gz | 3 +++ python-html2text.changes | 24 ++++++++++++++++++++++++ python-html2text.spec | 18 ++++++------------ remove_unittest2.patch | 22 +++++++++++----------- 5 files changed, 44 insertions(+), 26 deletions(-) delete mode 100644 html2text-2016.9.19.tar.gz create mode 100644 html2text-2018.1.9.tar.gz diff --git a/html2text-2016.9.19.tar.gz b/html2text-2016.9.19.tar.gz deleted file mode 100644 index 42f66c7..0000000 --- a/html2text-2016.9.19.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:554ef5fd6c6cf6e3e4f725a62a3e9ec86a0e4d33cd0928136d1c79dbeb7b2d55 -size 47899 diff --git a/html2text-2018.1.9.tar.gz b/html2text-2018.1.9.tar.gz new file mode 100644 index 0000000..86a9599 --- /dev/null +++ b/html2text-2018.1.9.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:627514fb30e7566b37be6900df26c2c78a030cc9e6211bda604d8181233bcdd4 +size 52211 diff --git a/python-html2text.changes b/python-html2text.changes index 44013b0..f75ae94 100644 --- a/python-html2text.changes +++ b/python-html2text.changes @@ -1,3 +1,27 @@ +------------------------------------------------------------------- +Mon Aug 13 11:39:14 UTC 2018 - mcepl@suse.com + +- Upgrade to 2018.1.9: + Fix #188: Non-ASCII in title attribute causes encode error. + Feature #194: Add support for the tag. + Feature #193: Add support for the tag. + Fix #157: Fix images link with div wrap + Fix #55: Fix error when empty title tags + Fix #160: The html2text tests are failing on Windows and on + Cygwin due to differences in eol handling between + Windows/*nix + Feature #164: Housekeeping: Add flake8 to the travis build, + cleanup existing flake8 violations, add py3.6 and pypy3 + to the travis build + Fix #109: Fix for unexpanded < > & + Fix #143: Fix line wrapping for the lines starting with bold + Adds support for numeric bold text indication in font-weight, + as used by Google (and presumably others.) + Fix #173 and #142: Stripping whitespace in crucial markdown + and adding whitespace as necessary + Don't drop any cell data on tables uneven row lengths + (e.g. colspan in use) + ------------------------------------------------------------------- Mon Aug 13 08:38:04 UTC 2018 - mcepl@suse.com diff --git a/python-html2text.spec b/python-html2text.spec index f4b4da1..e75b2e2 100644 --- a/python-html2text.spec +++ b/python-html2text.spec @@ -22,7 +22,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %bcond_without tests Name: python-%{upname} -Version: 2016.9.19 +Version: 2018.1.9 Release: 0 Summary: Turn HTML into equivalent Markdown-structured text License: GPL-3.0-only @@ -57,20 +57,16 @@ sed -i '/^#!/d' %{upname}/__init__.py %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} -# To avoid conflicts with the rst2html5 package -mv %{buildroot}%{_bindir}/%{upname} %{buildroot}%{_bindir}/%{upname}-python -ln -s -f %{_sysconfdir}/alternatives/%{upname} %{buildroot}%{_bindir}/%{upname} +%python_clone -a %{buildroot}%{_bindir}/%{upname} # remove executable bits from egg files %python_expand chmod -x %{buildroot}%{$python_sitelib}/%{upname}-*.egg-info/* %post -update-alternatives --install %{_bindir}/%{upname} %{upname} %{_bindir}/%{upname}-python 15 +%python_install_alternative html2text -%preun -if [ ! -f %{_bindir}/%{upname}-python ] ; then - update-alternatives --remove %{upname} %{_bindir}/%{upname}-python -fi +%postun +%python_uninstall_alternative html2text %if %{with tests} %check @@ -80,9 +76,7 @@ fi %files %{python_files} %license COPYING %doc README.md AUTHORS.rst ChangeLog.rst -%python3_only %{_bindir}/%{upname} -%python3_only %{_bindir}/%{upname}-python -%python3_only %ghost %{_sysconfdir}/alternatives/%{upname} +%python_alternative %{_bindir}/%{upname} %{python_sitelib}/* %changelog diff --git a/remove_unittest2.patch b/remove_unittest2.patch index 8bf330c..d65c7f6 100644 --- a/remove_unittest2.patch +++ b/remove_unittest2.patch @@ -1,8 +1,8 @@ --- a/setup.py +++ b/setup.py -@@ -9,14 +9,7 @@ try: +@@ -18,14 +18,7 @@ try: except ImportError: - read_md = lambda f: open(f, 'r').read() + read_md = read_md_open -requires_list = [] -try: @@ -16,7 +16,7 @@ class RunTests(Command): -@@ -59,9 +52,6 @@ setup( +@@ -68,9 +61,6 @@ setup( 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', @@ -26,7 +26,7 @@ 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.0', -@@ -75,7 +65,6 @@ setup( +@@ -85,7 +75,6 @@ setup( html2text=html2text.cli:main """, license='GNU GPL 3', @@ -36,7 +36,7 @@ zip_safe=False, --- a/test/test_html2text.py +++ b/test/test_html2text.py -@@ -5,10 +5,7 @@ import re +@@ -7,10 +7,7 @@ import re import subprocess import sys @@ -45,20 +45,20 @@ -else: - import unittest +import unittest - import logging + logging.basicConfig(format='%(levelname)s:%(funcName)s:%(message)s', --- a/test/test_memleak.py +++ b/test/test_memleak.py -@@ -1,9 +1,7 @@ +@@ -1,10 +1,7 @@ + import html2text + import logging import sys -if sys.version_info[:2] < (2, 7): - import unittest2 as unittest -else: - import unittest - import logging +import unittest -+ - logging.basicConfig(format='%(levelname)s:%(funcName)s:%(message)s', - level=logging.DEBUG) + + logging.basicConfig(format='%(levelname)s:%(funcName)s:%(message)s', From daf8229e860d55b3e66c658b46e71bbbb049fb30478f476f4f8b8550538eb153 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 16 Aug 2018 10:36:47 +0000 Subject: [PATCH 3/3] Accepting request 629535 from home:jengelh:branches:devel:languages:python - Use noun phrase for summary. Ensure accuracy and neutrality of description. OBS-URL: https://build.opensuse.org/request/show/629535 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-html2text?expand=0&rev=27 --- python-html2text.changes | 6 ++++++ python-html2text.spec | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/python-html2text.changes b/python-html2text.changes index f75ae94..e58cec5 100644 --- a/python-html2text.changes +++ b/python-html2text.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Aug 16 10:23:31 UTC 2018 - jengelh@inai.de + +- Use noun phrase for summary. Ensure accuracy and + neutrality of description. + ------------------------------------------------------------------- Mon Aug 13 11:39:14 UTC 2018 - mcepl@suse.com diff --git a/python-html2text.spec b/python-html2text.spec index e75b2e2..cc145d4 100644 --- a/python-html2text.spec +++ b/python-html2text.spec @@ -24,7 +24,7 @@ Name: python-%{upname} Version: 2018.1.9 Release: 0 -Summary: Turn HTML into equivalent Markdown-structured text +Summary: Python script for turning HTML into Markdown text License: GPL-3.0-only Group: Development/Languages/Python URL: https://github.com/Alir3z4/html2text/ @@ -40,9 +40,8 @@ BuildArch: noarch %python_subpackages %description -html2text is a Python script that converts a page of HTML into clean, -easy-to-read plain ASCII text. Better yet, that ASCII also happens to -be valid Markdown (a text-to-HTML format). +html2text is a Python script that converts a page of HTML into +Markdown (a text-to-HTML format). %prep %setup -q -n %{upname}-%{version}