5b48abc
# Require network, so run locally in mock with --with=tests --enable-network
5b48abc
# All tests pass
1bf7920
%bcond_with tests
4c398f2
61367b8
%global commit d36123b7ebc8a945d06a28d14e55829853edb70a
5b48abc
4c398f2
%global desc %{expand: \
4c398f2
A new XNAT client that exposes XNAT objects/functions as python objects/functions.
4c398f2
The aim is to abstract as much of the REST API away as possible and make xnatpy feel
4c398f2
like native Python code. This reduces the need for the user to know the details
4c398f2
of the REST API. Low level functionality can still be accessed via the connection object
4c398f2
which has get, head, put, post, delete methods for more directly calling the REST API.}
d8bae9a
fc70c99
Name:           python-xnat
61367b8
Version:        0.4.0
fc70c99
Release:        %autorelease
d8bae9a
Summary:        A new XNAT client that exposes XNAT objects/functions as python objects/functions.
d8bae9a
License:        ASL 2.0
fc70c99
URL:            https://gitlab.com/radiology/infrastructure/xnatpy/
fc70c99
Source0:        %{url}/-/archive/%{version}/xnat-%{version}.tar.gz
d8bae9a
BuildArch:      noarch
d8bae9a
d8bae9a
%description
4c398f2
%{desc}
4c398f2
fc70c99
%package -n python3-xnat
4c398f2
Summary:        %{summary}
4c398f2
4c398f2
BuildRequires: python3-devel
fc70c99
fc70c99
%description -n python3-xnat
4c398f2
%{desc}
d8bae9a
d8bae9a
%prep
5b48abc
%autosetup -n xnatpy-%{version}-%{commit}
fc70c99
fc70c99
# Remove version locks etc.
fc70c99
sed -i -e 's/pytest==.*/pytest/' -e 's/pytest-cov==.*/pytest-cov/' -e '/tox/ d' test_requirements.txt
61367b8
sed -i '/sphinx/d' requirements.txt
fc70c99
fc70c99
%generate_buildrequires
fc70c99
%pyproject_buildrequires %{?with_tests: -r requirements.txt test_requirements.txt}
d8bae9a
d8bae9a
%build
fc70c99
%pyproject_wheel
d8bae9a
d8bae9a
%install
fc70c99
%pyproject_install
fc70c99
%pyproject_save_files xnat
4c398f2
4c398f2
%check
212e1b8
%if %{with tests}
5b48abc
%{pytest}
212e1b8
%endif
5b48abc
fc70c99
%files -n python3-xnat -f %{pyproject_files}
96684e7
%doc README.rst
61367b8
%{_bindir}/xnat
d8bae9a
%{_bindir}/xnat_cp_project
fc70c99
%{_bindir}/xnat_data_integrity-check
d8bae9a
d8bae9a
%changelog
fc70c99
%autochangelog