summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Kudelin2020-11-30 00:26:47 +0300
committerAnton Kudelin2020-11-30 00:26:47 +0300
commit9498f806b0b9ccbb7d2cfaae4af507736fec0a70 (patch)
tree1c6acfa9d214c8f52aa6d196f967cba5fcf345c1
parent3990bbba1f48f0a5e60ad7b352d69657b9d95cf5 (diff)
downloadaur-9498f806b0b9ccbb7d2cfaae4af507736fec0a70.tar.gz
Updated to 1.6
-rw-r--r--.SRCINFO10
-rw-r--r--72.patch73
-rw-r--r--PKGBUILD20
3 files changed, 15 insertions, 88 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f593ab528f15..750ce225f3a8 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = python-yahoofinancials
pkgdesc = A powerful financial data module used for pulling data from Yahoo Finance
- pkgver = 1.5
- pkgrel = 2
+ pkgver = 1.6
+ pkgrel = 1
url = https://github.com/JECSand/yahoofinancials
arch = any
license = MIT
@@ -9,10 +9,8 @@ pkgbase = python-yahoofinancials
depends = python-requests
depends = python-beautifulsoup4
depends = python-pytz
- source = python-yahoofinancials-1.5.tar.gz::https://github.com/JECSand/yahoofinancials/archive/1.5.tar.gz
- source = 72.patch
- sha256sums = 372d30edbb25e6bd6fafa73bf915412b40522912cff14cba9ec28a50a3a105bd
- sha256sums = 837ff84e3e285bb5e8da0323c7d520f6ff5df3ce9b28cad1da390a8f896c99ad
+ source = python-yahoofinancials-1.6.tar.gz::https://github.com/JECSand/yahoofinancials/archive/1.6.tar.gz
+ sha256sums = 682e19372c8fe09df47195690cb145884815e6afcbf1c24dabf101433c7e6691
pkgname = python-yahoofinancials
diff --git a/72.patch b/72.patch
deleted file mode 100644
index ac34ac733421..000000000000
--- a/72.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From 5805c54f96c9222e587603d49130a7c0e710480b Mon Sep 17 00:00:00 2001
-From: Sylvan Butler <gitstuff.sylvan@xoxy.net>
-Date: Fri, 6 Mar 2020 19:55:52 -0700
-Subject: [PATCH 1/3] yahoo issue was the client version
-
----
- yahoofinancials/__init__.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/yahoofinancials/__init__.py b/yahoofinancials/__init__.py
-index 294392b..797a89b 100644
---- a/yahoofinancials/__init__.py
-+++ b/yahoofinancials/__init__.py
-@@ -68,7 +68,7 @@ class ManagedException(Exception):
-
- # Class used to open urls for financial data
- class UrlOpener(FancyURLopener):
-- version = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11'
-+ version = 'w3m/0.5.3+git20180125'
-
-
- # Class containing Yahoo Finance ETL Functionality
-
-From 5a5566d5de0328e4e799d443b315a5d829a09fe8 Mon Sep 17 00:00:00 2001
-From: Sylvan Butler <gitstuff.sylvan@xoxy.net>
-Date: Fri, 24 Apr 2020 09:38:39 -0600
-Subject: [PATCH 2/3] fix for bs4 4.9.0 script change
-
-preserves compatibility with prior versions
----
- yahoofinancials/__init__.py | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/yahoofinancials/__init__.py b/yahoofinancials/__init__.py
-index 797a89b..bd0f885 100644
---- a/yahoofinancials/__init__.py
-+++ b/yahoofinancials/__init__.py
-@@ -150,6 +150,9 @@ def _scrape_data(self, url, tech_type, statement_type):
- re_script = soup.find("script", text=re.compile("root.App.main"))
- if re_script is not None:
- script = re_script.text
-+ # bs4 4.9.0 changed so text from scripts is no longer considered text
-+ if not script:
-+ script = re_script.string
- self._cache[url] = loads(re.search("root.App.main\s+=\s+(\{.*\})", script).group(1))
- response.close()
- break
-
-From e36587b928c00b69f3876187aa15ab48818bccc8 Mon Sep 17 00:00:00 2001
-From: Sylvan Butler <gitstuff.sylvan@xoxy.net>
-Date: Fri, 6 Mar 2020 20:16:51 -0700
-Subject: [PATCH 3/3] fix test for 2020 adjclose
-
----
- test/test_yahoofinancials.py | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/test/test_yahoofinancials.py b/test/test_yahoofinancials.py
-index 2b79bc6..bcb6c73 100644
---- a/test/test_yahoofinancials.py
-+++ b/test/test_yahoofinancials.py
-@@ -83,8 +83,10 @@ def test_yf_fundamentals(self):
- def test_yf_historical_price(self):
- single_stock_prices = self.test_yf_stock_single.get_historical_price_data('2015-01-15', '2017-10-15', 'weekly')
- expect_dict = {'high': 49.099998474121094, 'volume': 125737200, 'formatted_date': '2015-01-12',
-- 'low': 46.599998474121094, 'adjclose': 45.35684585571289, 'date': 1421038800,
-+ 'low': 46.599998474121094, 'date': 1421038800,
- 'close': 47.61000061035156, 'open': 48.959999084472656}
-+ # ignore adjclose as it will change with every dividend paid in the future
-+ del single_stock_prices['C']['prices'][0]['adjclose']
- self.assertDictEqual(single_stock_prices['C']['prices'][0], expect_dict)
-
- # Historical Stock Daily Dividend Test
diff --git a/PKGBUILD b/PKGBUILD
index 7666e85d1642..eb25fff87555 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,27 +3,29 @@
_name=yahoofinancials
pkgname=python-$_name
-pkgver=1.5
-pkgrel=2
+pkgver=1.6
+pkgrel=1
pkgdesc='A powerful financial data module used for pulling data from Yahoo Finance'
url='https://github.com/JECSand/yahoofinancials'
arch=('any')
license=('MIT')
depends=('python-requests' 'python-beautifulsoup4' 'python-pytz')
makedepends=('python-setuptools')
-source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz"
- "72.patch")
-sha256sums=('372d30edbb25e6bd6fafa73bf915412b40522912cff14cba9ec28a50a3a105bd'
- '837ff84e3e285bb5e8da0323c7d520f6ff5df3ce9b28cad1da390a8f896c99ad')
+source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
+sha256sums=('682e19372c8fe09df47195690cb145884815e6afcbf1c24dabf101433c7e6691')
-build(){
+build() {
cd "$srcdir/$_name-$pkgver"
- patch -p1 < ../72.patch
python setup.py build
}
+check() {
+ cd "$srcdir/$_name-$pkgver"
+ python test/test_yahoofinancials.py
+}
+
package() {
cd "$_name-$pkgver"
- python setup.py install --root="$pkgdir" --optimize=1 --skip-build
+ python setup.py install --root="$pkgdir" -O1 --skip-build
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}