## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global pypi_name xnat4tests Name: python-%{pypi_name} Version: 0.3.12 Release: %{autorelease} Summary: Create basic XNAT instance for API tests %global forgeurl https://github.com/australian-imaging-service/xnat4tests %global tag v%{version} %forgemeta License: Apache-2.0 URL: %forgeurl Source: %forgesource # License change from CC0-1.0 to Apache-2.0 # https://github.com/Australian-Imaging-Service/xnat4tests/issues/17 Patch: license_change.patch BuildArch: noarch BuildRequires: git-core BuildRequires: python3-devel BuildRequires: python3dist(pytest) BuildRequires: python3dist(versioneer) %global _description %{expand: Xnat4Tests runs a basic XNAT repository instance in a single Docker to be used for quick demonstrations on your workstation or integrated within test suites for tools that use XNAT’s REST API.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} Provides: xnat4tests = %{?epoch:%{epoch}:}%{version}-%{release} %description -n python3-%{pypi_name} %_description %prep %forgeautosetup -p1 -S git # Unpin xnat sed -i -r 's/(xnat)==(.*,)/\1>=\2/' setup.py # Remove duplicated entry point # We'll create a symlink by the same name instead sed -i '/x4t/d' setup.py # Fix deprecated parameter sed -i -r 's/license_file/license_files/g' setup.cfg # Remove empty file (rpmlint reports as error) [ -s xnat4tests/testing.py ] || rm xnat4tests/testing.py # Remove xnat4tests/docker-src (part of the test suite) rm -rf xnat4tests/docker-src # Upstream has `export-subst` set in `.gitattributes` # for `xnat4tests/_version.py` # Revert those lines to the default, so the version is set correctly. #sed -i -r \ #-e 's/(git_refnames = ).*$/\1"$Format:%d$"/' \ #-e 's/(git_full = ).*$/\1"$Format:%H$"/' \ #-e 's/(git_date = ).*$/\1"$Format:%ci$"/' \ #xnat4tests/_version.py # Generate version information using Versioneer versioneer install --no-vendor # Versioneer wants a tag to set version # Make sure this is last in %%prep to avoid dev release git add --all git commit --allow-empty -m '[Fedora] Changes for mock build' git tag v%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{pypi_name} # Create symlink x4t -> xnat4tests (replacing duplicate entry point) pushd %{buildroot}%{_bindir} ln -s xnat4tests x4t popd %check # Unfortunately, the majority of tests require network (docker) # Run the single test not requiring network... %pytest -r fEs tests/test_config.py # ...and run import test and admire the smoke. %pyproject_check_import %files -n python3-%{pypi_name} -f %{pyproject_files} %doc README.* AUTHORS %{_bindir}/%{pypi_name} %{_bindir}/x4t %changelog ## START: Generated by rpmautospec * Fri Apr 18 2025 Sandro - 0.3.12-1 - Update to 0.3.12 - Change license to Apache-2.0 * Wed Jan 10 2024 Sandro - 0.3.10-2 - Fix issues and pecularities * Wed Jan 10 2024 Sandro - 0.3.10-1 - Initial package ## END: Generated by rpmautospec