pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

py-zipline: Fix syntax errors with python37 and python38



Module Name:	pkgsrc-wip
Committed By:	Min Kim <minskim%NetBSD.org@localhost>
Pushed By:	minskim
Date:		Fri Jan 24 11:51:04 2020 -0800
Changeset:	b85ba7fed9b0c6b77b22aefd0ff100a6ee3f0e46

Modified Files:
	py-zipline/distinfo
Added Files:
	py-zipline/patches/patch-zipline_assets_asset__writer.py
	py-zipline/patches/patch-zipline_assets_assets.py
	py-zipline/patches/patch-zipline_testing_core.py

Log Message:
py-zipline: Fix syntax errors with python37 and python38

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=b85ba7fed9b0c6b77b22aefd0ff100a6ee3f0e46

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 py-zipline/distinfo                                |  3 +++
 .../patches/patch-zipline_assets_asset__writer.py  | 24 ++++++++++++++++++++++
 py-zipline/patches/patch-zipline_assets_assets.py  | 22 ++++++++++++++++++++
 py-zipline/patches/patch-zipline_testing_core.py   | 20 ++++++++++++++++++
 4 files changed, 69 insertions(+)

diffs:
diff --git a/py-zipline/distinfo b/py-zipline/distinfo
index b8969476e8..a85b8e7af0 100644
--- a/py-zipline/distinfo
+++ b/py-zipline/distinfo
@@ -4,3 +4,6 @@ SHA1 (zipline-1.2.0.tar.gz) = 22ddbd436a90a7d82eeef873948b17bb92a7e14c
 RMD160 (zipline-1.2.0.tar.gz) = 866b8ec00545efa9db85ad8a5a4c4af036646e91
 SHA512 (zipline-1.2.0.tar.gz) = 435646dbdb0eda6954fc8dcaeced3fe29b3a3eeb54735aabd769cf827b49e227e6b7fb6f14cae89456274d9106db643beb6ffcff69c5aa7af77a2d77e69e1e44
 Size (zipline-1.2.0.tar.gz) = 659617 bytes
+SHA1 (patch-zipline_assets_asset__writer.py) = 7d83ce61414a41eb53c2dc08cc08b27d7de0e7d0
+SHA1 (patch-zipline_assets_assets.py) = cbe5412b797206e0c55e2b0b2afab7e7c731c4ed
+SHA1 (patch-zipline_testing_core.py) = f499e381370422fa9b75214b94d629b5d4ee5aaa
diff --git a/py-zipline/patches/patch-zipline_assets_asset__writer.py b/py-zipline/patches/patch-zipline_assets_asset__writer.py
new file mode 100644
index 0000000000..bee7560b08
--- /dev/null
+++ b/py-zipline/patches/patch-zipline_assets_asset__writer.py
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Compatibility with Python 3.7 and 3.8
+
+--- zipline/assets/asset_writer.py.orig	2017-12-11 17:11:41.000000000 +0000
++++ zipline/assets/asset_writer.py
+@@ -253,7 +253,7 @@ def _split_symbol_mappings(df):
+                 len(ambigious),
+                 '' if len(ambigious) == 1 else 's',
+                 '\n'.join(
+-                    '%s:\n  intersections: %s\n  %s' % (
++                    ('%s:\n  intersections: %s\n  %s' % (
+                         symbol,
+                         tuple(map(_format_range, intersections)),
+                         # indent the dataframe string
+@@ -262,7 +262,7 @@ def _split_symbol_mappings(df):
+                     for symbol, (intersections, df) in sorted(
+                         ambigious.items(),
+                         key=first,
+-                    ),
++                    )),
+                 ),
+             )
+         )
diff --git a/py-zipline/patches/patch-zipline_assets_assets.py b/py-zipline/patches/patch-zipline_assets_assets.py
new file mode 100644
index 0000000000..a96d969960
--- /dev/null
+++ b/py-zipline/patches/patch-zipline_assets_assets.py
@@ -0,0 +1,22 @@
+$NetBSD$
+
+Compatibility with Python 3.7 and 3.8
+
+--- zipline/assets/assets.py.orig	2017-12-11 17:11:41.000000000 +0000
++++ zipline/assets/assets.py
+@@ -605,13 +605,13 @@ class AssetFinder(object):
+         symbols = {
+             row.sid: {c: row[c] for c in symbol_columns}
+             for row in concat(
+-                self.engine.execute(
++                (self.engine.execute(
+                     self._select_most_recent_symbols_chunk(sid_group),
+                 ).fetchall()
+                 for sid_group in partition_all(
+                     SQLITE_MAX_VARIABLE_NUMBER,
+                     sids
+-                ),
++                )),
+             )
+         }
+ 
diff --git a/py-zipline/patches/patch-zipline_testing_core.py b/py-zipline/patches/patch-zipline_testing_core.py
new file mode 100644
index 0000000000..aa4f2144b3
--- /dev/null
+++ b/py-zipline/patches/patch-zipline_testing_core.py
@@ -0,0 +1,20 @@
+$NetBSD$
+
+Compatibility with Python 3.7 and 3.8
+
+--- zipline/testing/core.py.orig	2018-03-12 17:33:52.000000000 +0000
++++ zipline/testing/core.py
+@@ -914,10 +914,10 @@ class SubTestFailures(AssertionError):
+ 
+     def __str__(self):
+         return 'failures:\n  %s' % '\n  '.join(
+-            '\n    '.join((
+-                ', '.join('%s=%r' % item for item in scope.items()),
++            ('\n    '.join((
++                ', '.join(('%s=%r' % item for item in scope.items())),
+                 self._format_exc(exc_info),
+-            )) for scope, exc_info in self.failures,
++            )) for scope, exc_info in self.failures),
+         )
+ 
+ 


Home | Main Index | Thread Index | Old Index