%global python3_pkgversion 3.11 %global modname tqdm %global srcname %{modname} %bcond tests 0 Name: python-%{modname} Version: 4.66.4 Release: 2.ac16.py3.11%{?dist} Summary: Fast, Extensible Progress Meter # see PACKAGE-LICENSING for more info License: MPLv2.0 and MIT URL: https://github.com/tqdm/tqdm Source0: %{pypi_source} BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-wheel BuildRequires: python%{python3_pkgversion}-setuptools_scm+toml %if %{with tests} # tox.ini contains coverage and unpackaged dependencies (nbval) # We will use pytest directly BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-pytest-asyncio >= 0.17 BuildRequires: python%{python3_pkgversion}-pytest-timeout # optional test deps BuildRequires: python%{python3_pkgversion}-tkinter BuildRequires: python%{python3_pkgversion}-dask BuildRequires: python%{python3_pkgversion}-numpy BuildRequires: python%{python3_pkgversion}-pandas BuildRequires: python%{python3_pkgversion}-rich %endif %global _description \ tqdm (read taqadum, تقدّم) means "progress" in Arabic.\ \ Instantly make your loops show a smart progress meter - just wrap any iterable\ with "tqdm(iterable)", and you are done! %description %{_description} %package -n python%{python3_pkgversion}-%{modname} Summary: %{summary} %{?python_provide:%python_provide python3-%{modname}} %description -n python%{python3_pkgversion}-%{modname} %{_description} Python 3 version. %prep %autosetup -n %{modname}-%{version} chmod -x tqdm/completion.sh # https://github.com/tqdm/tqdm/pull/1292 echo 'include tqdm/tqdm.1' >> MANIFEST.in echo 'include tqdm/completion.sh' >> MANIFEST.in %generate_buildrequires %pyproject_buildrequires -r %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{modname} install -Dpm0644 \ %{buildroot}%{python3_sitelib}/tqdm/tqdm.1 \ %{buildroot}%{_mandir}/man1/tqdm.1 install -Dpm0644 \ %{buildroot}%{python3_sitelib}/tqdm/completion.sh \ %{buildroot}%{_datadir}/bash-completion/completions/tqdm.bash %check %if %{with tests} # The performance tests don't run properly in Koji builders rm -f tests/tests_perf.py %pytest %endif 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}-%{modname} -f %{pyproject_files} %license LICENCE %doc README.rst examples %{_bindir}/tqdm-%{python3_pkgversion} %{_mandir}/man1/tqdm-%{python3_pkgversion}.1* %dir %{_datadir}/bash-completion %dir %{_datadir}/bash-completion/completions %{_datadir}/bash-completion/completions/tqdm.bash %changelog * Sun May 12 2024 Ding-Yi Chen - 4.66.4-2.ac16.py3.11 - Cut corner packaging