# Default: when bootstrapping -> disable tests %bcond bootstrap 0 %bcond tests %{without bootstrap} # Similar to what we have in pythonX.Y.spec files. # If enabled, provides unversioned executables and other stuff. # Disable it if you build this package in an alternative stack. %bcond main_python 1 Name: python-wheel Version: 0.46.3 Release: %autorelease Epoch: 1 Summary: Built-package format for Python License: MIT URL: https://github.com/pypa/wheel Source: %{url}/archive/%{version}/wheel-%{version}.tar.gz BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel %if %{with tests} BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-setuptools %if %{defined fedora} # optional test dependencies (flit is unwanted in RHEL, a test is skipped without both of those) BuildRequires: python%{python3_pkgversion}-build BuildRequires: python%{python3_pkgversion}-flit %endif # several tests compile extensions # those tests are skipped if gcc is not found BuildRequires: gcc %endif %global _description %{expand: This is a command line tool for manipulating Python wheel files, as defined in PEP 427. It contains the following functionality: - Convert .egg archives into .whl. - Unpack wheel archives. - Repack wheel archives. - Add or remove tags in existing wheel archives.} %description %{_description} %package -n python%{python3_pkgversion}-wheel Summary: %{summary} %description -n python%{python3_pkgversion}-wheel %{_description} %prep %autosetup -n wheel-%{version} -p1 %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l wheel mv %{buildroot}%{_bindir}/wheel{,-%{python3_version}} %if %{with main_python} ln -s wheel-%{python3_version} %{buildroot}%{_bindir}/wheel-3 ln -s wheel-3 %{buildroot}%{_bindir}/wheel %endif %check # Smoke test %{py3_test_envvars} wheel-%{python3_version} version %py3_check_import wheel %if %{with tests} %pytest -v %endif %files -n python%{python3_pkgversion}-wheel -f %{pyproject_files} %doc README.rst %{_bindir}/wheel-%{python3_version} %if %{with main_python} %{_bindir}/wheel %{_bindir}/wheel-3 %endif %changelog %autochangelog