## START: Set by rpmautospec ## (rpmautospec version 0.8.4) ## 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 %global forgeurl https://github.com/australian-imaging-service/xnat4tests Version: 0.4.1 %global tag v%{version} %forgemeta Name: python-%{pypi_name} Release: %autorelease Summary: Create basic XNAT instance for API tests # The entire source is Apache-2.0, except that versioneer.py and the # _version.py it generates are CC0-1.0, not generally allowed for code in # Fedora, but OK under the exception for existing uses in Fedora prior to # 2022-08-01. While these are included in the source RPM, we re-generate # _version.py using the system python-versioneer, which is a later version # under Unlicense so the resulting _version.py is also Unlicense. License: Apache-2.0 AND Unlicense URL: %forgeurl Source: %forgesource BuildArch: noarch BuildRequires: git-core BuildRequires: python3-devel BuildRequires: python3dist(pytest) %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 -S git # Remove duplicated entry point # We'll create a symlink by the same name instead sed -r -i '/x4t/d' setup.py # Remove xnat4tests/docker-src/ (part of the test suite) rm -rvf xnat4tests/docker-src/ # Our tarball is from a commit created dynamically using git archive. # That means .gitattributes kicks in and replaces placeholders in # xnat4tests/_version.py with real values like commit sha. We need the # placeholders or Versioneer goes looking for a tag belonging to a non # existent commit only in upstream's repo. %python3 versioneer.py setup # Above command also modifies xnat4tests/__init__.py, re-adding the code # defining __version__. It's already in there. Revert. git restore --staged --worktree xnat4tests/__init__.py # 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 RPM package' 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.rst AUTHORS %{_bindir}/%{pypi_name} %{_bindir}/x4t %changelog ## START: Generated by rpmautospec * Sun Aug 16 2026 Filipe Rosset - 0.4.1-1 - Update to 0.4.1 * Thu Jul 16 2026 Fedora Release Engineering - 0.3.14-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild * Fri Jun 05 2026 Python Maint - 0.3.14-8 - Rebuilt for Python 3.15 * Sat Jan 17 2026 Fedora Release Engineering - 0.3.14-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild * Fri Sep 19 2025 Python Maint - 0.3.14-6 - Rebuilt for Python 3.14.0rc3 bytecode * Fri Aug 15 2025 Python Maint - 0.3.14-5 - Rebuilt for Python 3.14.0rc2 bytecode * Fri Jul 25 2025 Fedora Release Engineering - 0.3.14-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild * Wed Jun 11 2025 Python Maint - 0.3.14-3 - Rebuilt for Python 3.14 * Wed Jun 11 2025 Benjamin A. Beasley - 0.3.14-2 - Rebuilt for Python 3.14 (close RHBZ#2372204) * Fri May 23 2025 Sandro - 0.3.14-1 - New package: python-xnat4tests (RHBZ#2257923) ## END: Generated by rpmautospec