1e78e4e
%global         srcname     yfinance
3a4b9bb
%global         forgeurl    https://github.com/ranaroussi/%{srcname}
Packit b7e59eb
Version:        0.2.37
3a4b9bb
%global         tag         %{version}
3a4b9bb
%forgemeta
1e78e4e
1e78e4e
Name:           python-%{srcname}
210d4fa
Release:        %autorelease
1e78e4e
Summary:        Yahoo! Finance market data downloader
3a4b9bb
f2f5b9f
License:        Apache-2.0
3a4b9bb
URL:            %forgeurl
3a4b9bb
Source0:        %forgesource
1e78e4e
1e78e4e
BuildArch:      noarch
1e78e4e
1e78e4e
BuildRequires:  python3-devel
1e78e4e
1e78e4e
%global _description %{expand:
1e78e4e
Ever since Yahoo! finance decommissioned their historical data API, many
1e78e4e
programs that relied on it to stop working.
1e78e4e
1e78e4e
yfinance aims to solve this problem by offering a reliable, threaded,
1e78e4e
and Pythonic way to download historical market data from Yahoo! finance.}
1e78e4e
1e78e4e
%description %{_description}
1e78e4e
1e78e4e
1e78e4e
%package -n python3-%{srcname}
1e78e4e
Summary:        %{summary}
1e78e4e
1e78e4e
%description -n python3-%{srcname} %{_description}
1e78e4e
1e78e4e
1e78e4e
%prep
3a4b9bb
%forgeautosetup
1e78e4e
1e78e4e
# Remove the python shebang from non-executable files.
1e78e4e
sed -i '1{\@^#!/usr/bin/env python@d}' yfinance/*.py
1e78e4e
f8fa335
# Allow an older version of requests.
f8fa335
sed -i 's/requests>=2.31/requests>=2.28/' requirements.txt setup.py
0467380
1e78e4e
%generate_buildrequires
0467380
%pyproject_buildrequires
1e78e4e
1e78e4e
1e78e4e
%build
1e78e4e
%pyproject_wheel
1e78e4e
1e78e4e
1e78e4e
%install
1e78e4e
%pyproject_install
1e78e4e
1e78e4e
# A sample executable is included but it does not seem to work. It's not needed
1e78e4e
# for the package since this is a python library meant to be used by other
1e78e4e
# python executables.
1e78e4e
rm -vf %{buildroot}%{_bindir}/sample
1e78e4e
1e78e4e
%pyproject_save_files yfinance
1e78e4e
1e78e4e
0467380
%check
0467380
%pyproject_check_import
0467380
0467380
1e78e4e
%files -n python3-%{srcname} -f %{pyproject_files}
a634cdb
%doc README.md
1e78e4e
1e78e4e
1e78e4e
%changelog
210d4fa
%autochangelog