77b0a1e
# These are unreliable, unfortunately.
77b0a1e
%bcond_with xvfb_tests
77b0a1e
2907708
%global desc \
2907708
A collection of custom wx widgets and utilities used by FSLeyes.
2907708
2907708
d7ad8ae
Name:           python-fsleyes-widgets
270b2d6
Version:        0.12.3
d7ad8ae
Release:        %autorelease
2907708
Summary:        A collection of custom wx widgets and utilities used by FSLeyes
2907708
2907708
License:        ASL 2.0
d7ad8ae
URL:            https://pypi.python.org/pypi/fsleyes-widgets
270b2d6
Source0:        %{pypi_source fsleyes-widgets}
2907708
2907708
BuildArch:      noarch
2907708
BuildRequires:  python3-devel
270b2d6
%if %{with xvfb_tests}
2907708
BuildRequires:  xorg-x11-server-Xvfb
270b2d6
%endif
2907708
2907708
%description
2907708
%{desc}
2907708
d7ad8ae
%package -n python3-fsleyes-widgets
2907708
Summary:        %{summary}
2907708
d7ad8ae
%description -n python3-fsleyes-widgets
2907708
%{desc}
2907708
9669633
# do not generate docs because sphinx docs bundle js etc. which are very hard to unbundle
2907708
2907708
%prep
d7ad8ae
%autosetup -n fsleyes-widgets-%{version}
2907708
2907708
# remove unneeded shebangs
2907708
find . -name "*py" -exec sed -i '/#!\/usr\/bin\/env python/ d' '{}' \;
2907708
9669633
# remove sphinx from requirements because we're not generating sphinx docs
9669633
sed -i '/sphinx/ d' requirements-dev.txt
9669633
d7ad8ae
%generate_buildrequires
d7ad8ae
%pyproject_buildrequires -r requirements-dev.txt requirements.txt
d7ad8ae
854c1b9
2907708
%build
d7ad8ae
%pyproject_wheel
2907708
2907708
%install
d7ad8ae
%pyproject_install
d7ad8ae
%pyproject_save_files fsleyes_widgets
2907708
2907708
2907708
%check
77b0a1e
%if %{with xvfb_tests}
2907708
# From https://git.fmrib.ox.ac.uk/fsl/fsleyes/widgets/blob/master/.ci/test_template.sh
d7ad8ae
# These tests fail, so Ive disabled them for the time being. Upstream has been e-mailed.
854c1b9
# set sceen size for test_widgetgrid.py
d7ad8ae
# cannot use %%pytest, xvfb doesnt like the CFLAGS etc. that it sets
854c1b9
xvfb-run -a -s "-screen 0 1920x1200x24" pytest-3 tests --ignore=tests/test_autotextctrl.py --ignore=tests/test_bitmapradio.py --ignore=tests/test_bitmaptoggle.py --ignore=tests/test_colourbutton.py --ignore=tests/test_floatslider.py --ignore=tests/test_notebook.py --ignore=tests/test_rangeslider.py --ignore=tests/test_texttag.py --ignore=tests/test_numberdialog.py
77b0a1e
%endif
2907708
d7ad8ae
%files -n python3-fsleyes-widgets -f %{pyproject_files}
2907708
%license LICENSE COPYRIGHT
2907708
%doc README.rst
2907708
2907708
%changelog
d7ad8ae
%autochangelog