]> git.pld-linux.org Git - packages/python3-keyring.git/blobdiff - python-keyring.spec
rebuild with tests and docs
[packages/python3-keyring.git] / python-keyring.spec
index eed04ea9b39e5afef9595581e750048b782350bf..c2ce3f0da243e3acf73dae1a13a14e88a32999b0 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Conditional build:
 %bcond_without doc     # Sphinx documentation
-%bcond_with    tests   # test target [broken with \--build-base]
+%bcond_without tests   # py.test tests
 %bcond_without python2 # CPython 2.x module
 %bcond_without python3 # CPython 3.x module
 
@@ -9,41 +9,47 @@
 Summary:       Python 2 library to access the system keyring service
 Summary(pl.UTF-8):     Biblioteka Pythona 2 do dostępu do systemowego pęku kluczy
 Name:          python-%{module}
-Version:       9.3.1
-Release:       1
+# keep 18.x here for python2 support
+Version:       18.0.1
+Release:       4
 License:       MIT, PSF
 Group:         Libraries/Python
-Source0:       https://pypi.python.org/packages/7e/84/65816c2936cf7191bcb5b3e3dc4fb87def6f8a38be25b3a78131bbb08594/%{module}-%{version}.tar.gz
-# Source0-md5: 934aad9f3cdcc860029a0122fb5f67bb
+#Source0Download: https://pypi.python.org/simple/keyring
+Source0:       https://files.pythonhosted.org/packages/source/k/keyring/%{module}-%{version}.tar.gz
+# Source0-md5: 00cdec34da9c15ad804441979b70830b
 URL:           https://pypi.python.org/pypi/keyring
-BuildRequires: rpmbuild(macros) >= 1.710
 %if %{with python2}
 BuildRequires: python-devel >= 1:2.7
 BuildRequires: python-setuptools
-BuildRequires: python-setuptools_scm >= 1.9
+BuildRequires: python-setuptools_scm >= 1.15.0
 %if %{with tests}
+BuildRequires: python-entrypoints
 BuildRequires: python-pytest >= 2.8
-BuildRequires: python-pytest-runner
+BuildRequires: python-pytest-flake8
+BuildRequires: python-secretstorage
 %endif
 %endif
 %if %{with python3}
-BuildRequires: python3-devel >= 1:3.2
+BuildRequires: python3-devel >= 1:3.3
 BuildRequires: python3-setuptools
-BuildRequires: python3-setuptools_scm >= 1.9
+BuildRequires: python3-setuptools_scm >= 1.15.0
 %if %{with tests}
+BuildRequires: python3-entrypoints
 BuildRequires: python3-pytest >= 2.8
-BuildRequires: python3-pytest-runner
+BuildRequires: python3-pytest-flake8
+BuildRequires: python3-secretstorage
 %endif
 %endif
 %if %{with doc}
-BuildRequires: python3-Sphinx
-BuildRequires: python3-rst.linker
+BuildRequires: python-Sphinx
+BuildRequires: python-jaraco.packaging >= 3.2
+BuildRequires: python-rst.linker >= 1.9
 %endif
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.714
 Requires:      python-modules >= 1:2.7
 # kwalletd5 through dbus
 Suggests:      python-dbus
-# SecretService
-Suggests:      python-secretstorage
 Obsoletes:     python-keyring-gnome < 0.5.1
 Obsoletes:     python-keyring-kwallet < 0.5.1
 BuildArch:     noarch
@@ -66,8 +72,6 @@ Group:                Libraries/Python
 Requires:      python3-modules >= 1:3.3
 # kwalletd5 through dbus
 Suggests:      python-dbus
-# SecretService
-Suggests:      python-secretstorage
 
 %description -n python3-%{module}
 The Python keyring lib provides a easy way to access the system
@@ -95,11 +99,25 @@ Dokumentacja API biblioteki Pythona keyring.
 
 %build
 %if %{with python2}
-%py_build %{?with_tests:test}
+%py_build %{?with_doc:build_sphinx}
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS="pytest_flake8" \
+PYTHONPATH=$(pwd)/build-2/lib \
+%{__python} -m pytest tests keyring/tests
+%endif
 %endif
 
 %if %{with python3}
-%py3_build %{?with_tests:test} %{?with_doc:build_sphinx}
+%py3_build
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS="pytest_flake8" \
+PYTHONPATH=$(pwd)/build-3/lib \
+%{__python3} -m pytest tests keyring/tests
+%endif
 %endif
 
 %install
@@ -108,7 +126,8 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python3}
 %py3_install
 
-%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/tests
+# keep base tests classes (for e.g. python-keyrings.alt tests), remove just backends unit tests
+%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/keyring/tests/backends
 # "keyring" name is too generic, add -py[version] suffix
 %{__mv} $RPM_BUILD_ROOT%{_bindir}/keyring{,-py3}
 %endif
@@ -117,7 +136,9 @@ rm -rf $RPM_BUILD_ROOT
 %py_install
 
 %py_postclean
-%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/tests
+
+# keep base tests classes (for e.g. python-keyrings.alt tests), remove just backends unit tests
+%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/keyring/tests/backends
 # "keyring" name is too generic, add -py[version] suffix
 %{__mv} $RPM_BUILD_ROOT%{_bindir}/keyring{,-py2}
 ln -sf keyring-py2 $RPM_BUILD_ROOT%{_bindir}/keyring-py
@@ -145,8 +166,8 @@ rm -rf $RPM_BUILD_ROOT
 %{py3_sitescriptdir}/keyring-%{version}-py*.egg-info
 %endif
 
-%if %{with python3} && %{with doc}
+%if %{with python2} && %{with doc}
 %files apidocs
 %defattr(644,root,root,755)
-%doc build-3/sphinx/html/{_static,*.html,*.js}
+%doc build-2/sphinx/html/{_static,*.html,*.js}
 %endif
This page took 0.201008 seconds and 4 git commands to generate.