53ee60b
# These may be disabled if they become unreliable
53ee60b
%bcond xvfb_tests 1
6cb22aa
59fd707
%global desc %{expand:
27bc17b
fsleyes-props is a library which is used by FSLeyes, and which allows you to:
126c156
126c156
- Listen for change to attributes on a python object,
27bc17b
- Automatically generate wxpython widgets which are bound to attributes of a
27bc17b
  python object
126c156
- Automatically generate a command line interface to set values of the
126c156
  attributes of a python object.}
126c156
8d9f716
Name:           python-fsleyes-props
8e82692
Version:        1.11.0
ef05193
Release:        %autorelease
126c156
Summary:        [wx]Python event programming framework
126c156
263c374
License:        Apache-2.0
8d9f716
URL:            https://pypi.python.org/pypi/fsleyes-props
1f89c99
Source:         %{pypi_source fsleyes-props}
126c156
126c156
BuildArch:      noarch
126c156
149f324
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
149f324
ExcludeArch:    %{ix86}
149f324
59fd707
%description %{desc}
126c156
ffccc4f
8d9f716
%package -n python3-fsleyes-props
126c156
Summary:        %{summary}
126c156
BuildRequires:  python3-devel
8d9f716
%if %{with xvfb_tests}
126c156
BuildRequires:  xorg-x11-server-Xvfb
9a7511b
BuildRequires:  %{py3_dist pytest}
8d9f716
%endif
126c156
ffccc4f
59fd707
%description -n python3-fsleyes-props %{desc}
126c156
ffccc4f
126c156
%prep
8d9f716
%autosetup -n fsleyes-props-%{version}
126c156
2fffbd0
find fsleyes_props -name '*.py' -exec sed -r -i '1{/^#!/d}' '{}' '+'
126c156
9a7511b
# disable coverage
8dad22c
sed -i 's/--cov=fsleyes_props//' pyproject.toml
9a7511b
ffccc4f
8d9f716
%generate_buildrequires
8d9f716
%pyproject_buildrequires
126c156
126c156
8d9f716
%build
8d9f716
%pyproject_wheel
126c156
ffccc4f
126c156
%install
8d9f716
%pyproject_install
8d9f716
%pyproject_save_files fsleyes_props
126c156
126c156
126c156
%check
6cb22aa
%if %{with xvfb_tests}
8d9f716
# These tests fail. Upstream says tests are not reliable, but work on his Ubuntu setup.
8410ab3
ignore="${ignore-} --ignore=tests/test_widget_boolean.py"
8410ab3
ignore="${ignore-} --ignore=tests/test_widget_number.py"
8410ab3
ignore="${ignore-} --ignore=tests/test_widget_point.py"
8410ab3
8410ab3
%global __pytest xvfb-run -a pytest
8410ab3
%pytest -v ${ignore-}
6cb22aa
%endif
126c156
126c156
8d9f716
%files -n python3-fsleyes-props -f %{pyproject_files}
8790cf8
# The .dist-info directory contains LICENSE but not COPYRIGHT, so manual
8790cf8
# handling is still required:
126c156
%license LICENSE COPYRIGHT
ca8e26d
%doc CHANGELOG.rst
126c156
%doc README.rst
126c156
126c156
%changelog
ef05193
%autochangelog