summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Langlois2020-10-15 17:12:10 -0400
committerEric Langlois2020-10-15 17:12:10 -0400
commitd472ee4a44d186b38cc489c91f6bbab7a6bd2376 (patch)
treef13f582fd33fe79d11bca503f100219f31f14c5c
parentf9facda434ad510db2aef8a3b4ea04afdc38daf5 (diff)
downloadaur-python-akro.tar.gz
upgpkg: python-akro 0.0.8-1
Patch akro tests to work without tensorflow.
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD11
-rw-r--r--akro-fix-test-imports.patch49
3 files changed, 60 insertions, 2 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d597312d4c94..abc49ac1298c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -13,7 +13,9 @@ pkgbase = python-akro
depends = python-gym
depends = python-numpy
source = https://files.pythonhosted.org/packages/source/a/akro/akro-0.0.8.tar.gz
+ source = akro-fix-test-imports.patch
sha256sums = 4fc0dc1acf35db19b39a209e20ce14dc8197723c73d3adf3ba7f8cdc1dbf6e58
+ sha256sums = 7fa5b22dec473c540c9962143ab90f6dbf3487f1909b7aa7cdd2d34fb7e2343d
pkgname = python-akro
diff --git a/PKGBUILD b/PKGBUILD
index 83e9b581bd6c..e8d487f27c5c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -19,8 +19,15 @@ checkdepends=(
'python-pytest-cov'
'python-pytest-xdist'
)
-source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz")
-sha256sums=('4fc0dc1acf35db19b39a209e20ce14dc8197723c73d3adf3ba7f8cdc1dbf6e58')
+source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz"
+ "$_name-fix-test-imports.patch")
+sha256sums=('4fc0dc1acf35db19b39a209e20ce14dc8197723c73d3adf3ba7f8cdc1dbf6e58'
+ '7fa5b22dec473c540c9962143ab90f6dbf3487f1909b7aa7cdd2d34fb7e2343d')
+
+prepare() {
+ cd "$_name-$pkgver"
+ patch -p1 -i "$srcdir/$_name-fix-test-imports.patch"
+}
build() {
cd "$_name-$pkgver"
diff --git a/akro-fix-test-imports.patch b/akro-fix-test-imports.patch
new file mode 100644
index 000000000000..d9a4e67491b6
--- /dev/null
+++ b/akro-fix-test-imports.patch
@@ -0,0 +1,49 @@
+From 7f6d99f6a16e000e79cc18b546259c2db98952a0 Mon Sep 17 00:00:00 2001
+From: Eric Langlois <eric@langlois.xyz>
+Date: Thu, 15 Oct 2020 16:23:02 -0400
+Subject: [PATCH] Fix tf imports in some test files
+
+Changed `import tensorflow as tf` to `from akro import tf`
+so that tests will still run if tensorflow is not installed.
+
+This makes tf imports in these files consistent with the other test
+files.
+---
+ tests/akro/test_discrete.py | 2 +-
+ tests/akro/test_tuple.py | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/akro/test_discrete.py b/tests/akro/test_discrete.py
+index 56c0407..1d4de11 100644
+--- a/tests/akro/test_discrete.py
++++ b/tests/akro/test_discrete.py
+@@ -3,9 +3,9 @@ import unittest
+
+ import numpy as np
+ import pytest
+-import tensorflow as tf
+
+ from akro import Discrete
++from akro import tf
+ from akro import theano
+ from akro.requires import requires_tf, requires_theano
+
+diff --git a/tests/akro/test_tuple.py b/tests/akro/test_tuple.py
+index 9235e8e..f67b9ba 100644
+--- a/tests/akro/test_tuple.py
++++ b/tests/akro/test_tuple.py
+@@ -2,10 +2,10 @@ import pickle
+ import unittest
+
+ import numpy as np
+-import tensorflow as tf
+
+ from akro import Box
+ from akro import Discrete
++from akro import tf
+ from akro import theano
+ from akro import Tuple
+ from akro.requires import requires_tf, requires_theano
+--
+2.28.0
+