diff --git a/python-SecretStorage.spec b/python-SecretStorage.spec index 83dd09c..e2a6b78 100644 --- a/python-SecretStorage.spec +++ b/python-SecretStorage.spec @@ -1,4 +1,5 @@ %bcond docs 1 +%bcond tests 1 %global srcname SecretStorage @@ -19,11 +20,16 @@ BuildArch: noarch # built libsecret does not ship those Python files, TODO make it so Source1: http://download.gnome.org/sources/libsecret/0.21/libsecret-0.21.4.tar.xz +BuildRequires: python3-devel + +# Test dependencies +%if %{with tests} BuildRequires: /usr/bin/dbus-launch BuildRequires: /usr/bin/xvfb-run -BuildRequires: python3-devel BuildRequires: python3-dbus BuildRequires: python3-gobject-base +%endif + # For building the documentation %if %{with docs} BuildRequires: python3-sphinx @@ -102,11 +108,12 @@ find build -name 'doctrees' -type d -print -exec rm -r '{}' + %check %pyproject_check_import +%if %{with tests} export PYTHONPATH=%{buildroot}%{python3_sitelib} for MOCK in libsecret-0.21.4/libsecret/mock-service-{normal,only-plain,lock}.py; do xvfb-run -a dbus-launch --exit-with-session %{__python3} tests/run_tests.py ${MOCK} done - +%endif %files -n python3-secretstorage -f %{pyproject_files} %doc changelog README.rst