File python-yfinance.spec of Package python-yfinance
#
# spec file for package python-yfinance
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
Name: python-yfinance
Version: 0.2.51
Release: 0
Summary: Download market data from Yahoo! Finance API
License: Apache-2.0
URL: https://github.com/ranaroussi/yfinance
Source: https://files.pythonhosted.org/packages/source/y/yfinance/yfinance-%{version}.tar.gz
BuildRequires: python-rpm-macros
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
# SECTION test requirements
BuildRequires: %{python_module beautifulsoup4 >= 4.11.1}
BuildRequires: %{python_module frozendict >= 2.3.4}
BuildRequires: %{python_module html5lib >= 1.1}
BuildRequires: %{python_module lxml >= 4.9.1}
BuildRequires: %{python_module multitasking >= 0.0.7}
BuildRequires: %{python_module numpy >= 1.16.5}
BuildRequires: %{python_module pandas >= 1.3.0}
BuildRequires: %{python_module peewee >= 3.16.2}
BuildRequires: %{python_module platformdirs >= 2.0.0}
BuildRequires: %{python_module pytz >= 2022.5}
BuildRequires: %{python_module requests >= 2.31}
BuildRequires: %{python_module requests-cache >= 1.0}
# /SECTION
BuildRequires: fdupes
Requires: python-beautifulsoup4 >= 4.11.1
Requires: python-frozendict >= 2.3.4
Requires: python-html5lib >= 1.1
Requires: python-lxml >= 4.9.1
Requires: python-multitasking >= 0.0.7
Requires: python-numpy >= 1.16.5
Requires: python-pandas >= 1.3.0
Requires: python-peewee >= 3.16.2
Requires: python-platformdirs >= 2.0.0
Requires: python-pytz >= 2022.5
Requires: python-requests >= 2.31
Suggests: python-requests_cache >= 1.0
Suggests: python-requests_ratelimiter >= 0.3.1
Suggests: python-scipy >= 1.6.3
BuildArch: noarch
%python_subpackages
%description
Download market data from Yahoo! Finance API
%prep
%autosetup -p1 -n yfinance-%{version}
# require requests_ratelimiter that is notavailable
rm tests/test_{price{s,_repair},search,ticker,utils}.py
# Remove the python shebang from non-executable files.
sed -i '1{\@^#!/usr/bin/env python@d}' yfinance/*.py
%build
%pyproject_wheel
%install
%pyproject_install
# not required, package can be used as a library
rm -vf %{buildroot}%{_bindir}/sample
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pyunittest discover -s tests -v
%files %{python_files}
%doc README.md
%license LICENSE.txt
%{python_sitelib}/yfinance
%{python_sitelib}/yfinance-%{version}.dist-info
%changelog