From 6f3242262b4c8165d6b586e504dd22c56fa49419 Mon Sep 17 00:00:00 2001 From: Jason Manley Date: Sun, 6 Nov 2022 17:06:40 -0600 Subject: [PATCH] New package: python3-finvizfinance-0.14.5 --- .../patches/quote.py.patch | 31 +++++++++++++++++++ srcpkgs/python3-finvizfinance/template | 18 +++++++++++ 2 files changed, 49 insertions(+) create mode 100644 srcpkgs/python3-finvizfinance/patches/quote.py.patch create mode 100644 srcpkgs/python3-finvizfinance/template diff --git a/srcpkgs/python3-finvizfinance/patches/quote.py.patch b/srcpkgs/python3-finvizfinance/patches/quote.py.patch new file mode 100644 index 000000000000..8fad457ba40b --- /dev/null +++ b/srcpkgs/python3-finvizfinance/patches/quote.py.patch @@ -0,0 +1,31 @@ +Wrap a test that was failing with exception handling in order to pass testing. +https://github.com/lit26/finvizfinance/commit/ddd263736be278c8834242679c08c804d17ba1c0 +--- a/finvizfinance/quote.py 2023-02-03 21:17:45.000000000 -0600 ++++ b/finvizfinance/quote.py 2023-05-29 17:56:18.702135822 -0500 +@@ -133,12 +133,20 @@ + table = self.soup.find("table", class_="fullview-title") + rows = table.findAll("tr") + +- fundament_info["Company"] = rows[1].text +- ( +- fundament_info["Sector"], +- fundament_info["Industry"], +- fundament_info["Country"], +- ) = rows[2].text.split(" | ") ++ try: ++ fundament_info["Company"] = rows[1].text ++ ( ++ fundament_info["Sector"], ++ fundament_info["Industry"], ++ fundament_info["Country"], ++ ) = rows[2].text.split(" | ") ++ except IndexError: ++ (_, fundament_info["Company"], _) = rows[0].text.split(' | ') ++ ( ++ fundament_info["Sector"], ++ fundament_info["Industry"], ++ fundament_info["Country"], ++ ) = rows[1].text.split(" | ") + + fundament_table = self.soup.find("table", class_="snapshot-table2") + rows = fundament_table.findAll("tr") diff --git a/srcpkgs/python3-finvizfinance/template b/srcpkgs/python3-finvizfinance/template new file mode 100644 index 000000000000..7402fd3d1b8b --- /dev/null +++ b/srcpkgs/python3-finvizfinance/template @@ -0,0 +1,18 @@ +# Template file for 'python3-finvizfinance' +pkgname=python3-finvizfinance +version=0.14.5 +revision=1 +build_style=python3-module +hostmakedepends="python3-setuptools" +depends="python3 python3-requests python3-BeautifulSoup4 python3-pandas python3-lxml" +checkdepends="${depends} python3-pytest python3-pytest-mock" +short_desc="FinViz API Python 3 Module" +maintainer="Jason Elswick " +license="MIT" +homepage="https://pypi.org/project/finvizfinance/" +distfiles="${PYPI_SITE}/f/finvizfinance/finvizfinance-${version}.tar.gz" +checksum=c97fe0e69d681d9108113aed943988561665d0d4dbd64ffa0b666a2899c25899 + +post_install() { + vlicense LICENSE +}