%global python3_pkgversion 3.11 %bcond_without check %global srcname pandas-datareader %global summary Data readers from the pandas codebase %global common_description \ Data readers extracted from the pandas codebase, should be compatible with \ recent pandas versions. Name: python-%{srcname} Version: 0.10.0 Release: 2.ac16.py3.11%{?dist} Summary: %{summary} License: BSD-3-Clause URL: https://github.com/pydata/pandas-datareader Source0: %{pypi_source} # Old version of versioner still uses deprecated SafeConfigParser # https://github.com/pydata/pandas-datareader/issues/969 Patch: pandas-datareader-python312.patch BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %description %{common_description} %package -n python%{python3_pkgversion}-%{srcname} Summary: %{summary} %if %{with check} BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-numpy BuildRequires: python%{python3_pkgversion}-pandas BuildRequires: python%{python3_pkgversion}-requests BuildRequires: python%{python3_pkgversion}-wrapt %endif %{?python_provide:%python_provide python3-%{srcname}} %description -n python%{python3_pkgversion}-%{srcname} %{common_description} %prep %autosetup -n %{srcname}-%{version} -p1 %generate_buildrequires %pyproject_buildrequires -t %build %pyproject_wheel %install %pyproject_install %pyproject_save_files pandas_datareader %check # Most tests require network %pyproject_check_import for b in $(find %{buildroot}%{_bindir}/ -type f) ; do mv "$b" $(sed -re "s|(.*)$|\1-%{python3_pkgversion}|"<<<"$b"); done for m in $(find %{buildroot}%{_mandir}/ -type f) ; do mv "$m" $(sed -re "s|(.*).([1-8])(.*)$|\1-%{python3_pkgversion}.\2\3|"<<<"$m"); done for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s|(.*).mo$|\1-%{python3_pkgversion}.mo|"<<<"$m"); done for l in $(find %{buildroot}/usr/lib64/lib* -type f -o -type l) ; do mv "$l" $(sed -re "s|(.*).so(.*)$|\1-py%{python3_pkgversion}.so\2|"<<<"$l"); done for p in $(find %{buildroot}/usr/lib64/pkgconfig/* -type f) ; do mv "$p" $(sed -re "s|(.*).pc$|\1-py%{python3_pkgversion}.pc|"<<<"$p"); done %files -n python%{python3_pkgversion}-%{srcname} -f %{pyproject_files} %doc README.md %changelog * Fri May 17 2024 Ding-Yi Chen - 0.10.0-2.ac16.py3.11 - Cut corner packaging