# This specfile is licensed under: # SPDX-License-Identifier: MIT # License text: https://spdx.org/licenses/MIT.html # SPDX-FileCopyrightText: Fedora Project Authors # SPDX-FileCopyrightText: 2022 Maxwell G %bcond_without tests %if %{defined el7} # EPEL 7 does not enable the Python runtime dependency generator by default. %global __pythondist_requires %{_rpmconfigdir}/pythondistdeps.py --requires # EPEL 7 does not have a %%pytest macro :(. # This is a simplified version of EPEL 8's that only has what we need. # We also need to disable some tests which are incompatible with EPEL 7's # very old pytest. %global pytest %{expand:\\\ PYTHONPATH="$%{buildroot}%{python3_sitelib}"\\\ PYTHONDONTWRITEBYTECODE=1\\\ %{_bindir}/pytest-%{python3_version} \\\ -k "not test_prepare_metadata\\\ and not test_wheel\\\ and not test_sdist\\\ and not test_bad_description_extension\\\ and not test_extras_dev_warning"} %endif Name: python-flit-core Version: 3.7.1 Release: 1%{?dist} Summary: Simplified packaging of Python modules License: BSD-3-Clause URL: https://github.com/pypa/flit Source0: %{pypi_source flit_core} # The BSD-3-Clause license requires reproducing the license text, # so we copy it from the upstream repository as a temporary measure # until https://github.com/pypa/flit/pull/603 which includes these files # in the sdist is merged. Source1: %{url}/raw/%{version}/LICENSE#/LICENSE.upstream # Add custom tmp_path pytest fixture # RHEL 8's old pytest does not support this fixture. Patch0: 0001-Add-custom-tmp_path-pytest-fixture.patch BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-tomli %if %{with tests} BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-testpath %endif %global _description %{expand: Flit is a simple way to put Python packages and modules on PyPI. Flit only creates packages in the new 'wheel' format. People using older versions of pip (<1.5) or easy_install will not be able to install them. Flit packages a single importable module or package at a time, using the import name as the name on PyPI. All sub-packages and data files within a package are included automatically. Flit requires Python 3, but you can use it to distribute modules for Python 2, so long as they can be imported on Python 3.} %description %_description %package -n python3-flit-core Summary: %{summary} %py_provides python3-flit-core # We manually specify this, because it's bundled upstream and not in the metadata Requires: python%{python3_pkgversion}-tomli %description -n python3-flit-core %_description %prep %autosetup -p1 -n flit_core-%{version} cp %{SOURCE1} . mv LICENSE{.upstream,} # Remove vendored tomli that flit_core includes to solve the circular dependency. # (flit_core requires tomli, but flit_core is needed to build tomli). # We don't use this, as python3-tomli already has its own bootstrap bcond # to build without flit_core. sed -i 's|from \.vendor import tomli|import tomli|' flit_core/config.py rm -rf flit_core/vendor %build %python3 -m flit_core.wheel %install %py3_install_wheel flit_core-%{version}-py3-none-any.whl # don't ship tests in flit_core package # if upstream decides to change the installation, it can be removed: # https://github.com/takluyver/flit/issues/403 rm -r %{buildroot}%{python3_sitelib}/flit_core/tests/ %check %py3_check_import flit_core %if %{with tests} %pytest %endif %files -n python3-flit-core %doc README.rst %license LICENSE %{python3_sitelib}/flit_core/ %{python3_sitelib}/flit_core-%{version}.dist-info/ %changelog * Thu Oct 06 2022 Maxwell G - 3.7.1-1 - Initial EPEL 8 package (rhbz#2133111).