]> git.pld-linux.org Git - packages/python-wcwidth.git/commitdiff
- updated to 0.2.5
authorJakub Bogusz <qboosh@pld-linux.org>
Fri, 11 Mar 2022 21:03:03 +0000 (22:03 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Fri, 11 Mar 2022 21:03:03 +0000 (22:03 +0100)
python-wcwidth.spec

index 3ba94a4f6c1f2b2ff111fd3b2cc44c67dfbd2cb4..6036d255e0d5be1eb67a39c6cb83f7bb47582313 100644 (file)
@@ -1,5 +1,7 @@
+# TODO: finish doc
 #
 # Conditional build:
+%bcond_with    doc     # Sphinx documentation
 %bcond_without tests   # unit tests
 %bcond_without python2 # CPython 2.x module
 %bcond_without python3 # CPython 3.x module
 Summary:       Measure the number of terminal column cells of wide-character codes
 Summary(pl.UTF-8):     Pomiar liczby kolumn terminala koniecznych do wyświetlenia znaków
 Name:          python-%{module}
-Version:       0.1.8
-Release:       2
+Version:       0.2.5
+Release:       1
 License:       MIT
 Group:         Libraries/Python
 #Source0Download: https://github.com/jquast/wcwidth/releases
 Source0:       https://github.com/jquast/wcwidth/archive/%{version}/%{module}-%{version}.tar.gz
-# Source0-md5: 66162542f776260ae611085ca92a97f1
+# Source0-md5: c82382572afdbba64470f56374502952
 URL:           https://pypi.org/project/wcwidth/
 %if %{with python2}
 BuildRequires: python-modules >= 1:2.7
 BuildRequires: python-setuptools
 %if %{with tests}
+BuildRequires: python-backports.functools_lru_cache >= 1.2.1
 BuildRequires: python-pytest
+BuildRequires: python-pytest-cov
 %endif
 %endif
 %if %{with python3}
@@ -28,10 +32,17 @@ BuildRequires:      python3-modules >= 1:3.4
 BuildRequires: python3-setuptools
 %if %{with tests}
 BuildRequires: python3-pytest
+BuildRequires: python3-pytest-cov
 %endif
 %endif
 BuildRequires: rpm-pythonprov
 BuildRequires: rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires: python3-sphinx-paramlinks
+BuildRequires: python3-sphinx_rtd_theme
+BuildRequires: python3-sphinxcontrib-manpage
+BuildRequires: sphinx-pdg-3
+%endif
 Requires:      python-modules >= 1:2.7
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -68,7 +79,11 @@ takowy.
 %py_build
 
 %if %{with tests}
-%{__python} -m pytest wcwidth/tests
+# test_package_version refers to distribution, fails without installed package
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS=pytest_cov.plugin \
+PYTHONPATH=$(pwd) \
+%{__python} -m pytest tests -k 'not test_package_version'
 %endif
 %endif
 
@@ -76,8 +91,15 @@ takowy.
 %py3_build
 
 %if %{with tests}
-%{__python3} -m pytest wcwidth/tests
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS=pytest_cov.plugin \
+PYTHONPATH=$(pwd) \
+%{__python3} -m pytest tests -k 'not test_package_version'
+%endif
 %endif
+
+%if %{with doc}
+sphinx-build-3 -b html docs docs/build/html
 %endif
 
 %install
@@ -87,13 +109,10 @@ rm -rf $RPM_BUILD_ROOT
 %py_install
 
 %py_postclean
-%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/wcwidth/tests
 %endif
 
 %if %{with python3}
 %py3_install
-
-%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/wcwidth/tests
 %endif
 
 %clean
@@ -102,15 +121,15 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python2}
 %files
 %defattr(644,root,root,755)
-%doc LICENSE.txt README.rst
+%doc LICENSE README.rst
 %{py_sitescriptdir}/wcwidth
-%{py_sitescriptdir}/wcwidth-0.1.7-py*.egg-info
+%{py_sitescriptdir}/wcwidth-%{version}-py*.egg-info
 %endif
 
 %if %{with python3}
 %files -n python3-%{module}
 %defattr(644,root,root,755)
-%doc LICENSE.txt README.rst
+%doc LICENSE README.rst
 %{py3_sitescriptdir}/wcwidth
-%{py3_sitescriptdir}/wcwidth-0.1.7-py*.egg-info
+%{py3_sitescriptdir}/wcwidth-%{version}-py*.egg-info
 %endif
This page took 0.196918 seconds and 4 git commands to generate.