Blob Blame History Raw
%global _without_tests 1
%global modname tqdm
%global srcname %{modname}

# The tests only run on Fedora 37 and newer, due to a requirement on
# pytest-asyncio >= 0.17
%if 0%{?fedora} >= 37
%bcond_without tests
%bcond_with tests

Name:           python-%{modname}
Version:        4.66.2
Release:        %autorelease
Summary:        Fast, Extensible Progress Meter

# see PACKAGE-LICENSING for more info
License:        MPLv2.0 and MIT
Source0:        %{pypi_source}

BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  python3-wheel
BuildRequires:  python3-setuptools_scm+toml

%if %{with tests}
# tox.ini contains coverage and unpackaged dependencies (nbval)
# We will use pytest directly
BuildRequires:  python3-pytest
BuildRequires:  python3-pytest-asyncio >= 0.17
BuildRequires:  python3-pytest-timeout

# optional test deps
BuildRequires:  python3-tkinter
BuildRequires:  python3-dask
BuildRequires:  python3-numpy
BuildRequires:  python3-pandas
BuildRequires:  python3-rich

%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 python3-%{modname}
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{modname}}

%description -n python3-%{modname} %{_description}

Python 3 version.

%autosetup -n %{modname}-%{version}
chmod -x tqdm/

echo 'include tqdm/tqdm.1' >>
echo 'include tqdm/' >>

%pyproject_buildrequires -r


%pyproject_save_files %{modname}
install -Dpm0644 \
  %{buildroot}%{python3_sitelib}/tqdm/tqdm.1 \
install -Dpm0644 \
  %{buildroot}%{python3_sitelib}/tqdm/ \

%if %{with tests}

%files -n python3-%{modname} -f %{pyproject_files}
%license LICENCE
%doc README.rst examples
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions