mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 21:37:15 +02:00
testing/py3-ecos: build with gpep517, enable tests
This commit is contained in:
parent
b87ba9e6f4
commit
e6cbfd5df1
@ -2,36 +2,41 @@
|
||||
# Maintainer: Anjandev Momi <anjan@momi.ca>
|
||||
pkgname=py3-ecos
|
||||
pkgver=2.0.11
|
||||
pkgrel=3
|
||||
pkgrel=4
|
||||
pkgdesc="python interface for ECOS"
|
||||
url="https://github.com/embotech/ecos-python"
|
||||
arch="all"
|
||||
license="GPL-3.0-only"
|
||||
depends="py3-numpy py3-scipy ecos"
|
||||
makedepends="py3-setuptools ecos-dev py3-numpy-dev python3-dev"
|
||||
makedepends="py3-setuptools ecos-dev py3-numpy-dev python3-dev py3-gpep517"
|
||||
checkdepends="py3-nose"
|
||||
subpackages="$pkgname-pyc"
|
||||
source="ecos-python-$pkgver.tar.gz::https://github.com/embotech/ecos-python/archive/refs/tags/v$pkgver.tar.gz
|
||||
use_external_ecos.patch
|
||||
assertEquals.patch
|
||||
"
|
||||
builddir="$srcdir/ecos-python-$pkgver"
|
||||
options="!check" # cannot get checks to pass
|
||||
|
||||
build() {
|
||||
make version
|
||||
python3 setup.py build
|
||||
gpep517 build-wheel \
|
||||
--wheel-dir .dist \
|
||||
--output-fd 3 3>&1 >&2
|
||||
}
|
||||
|
||||
check() {
|
||||
python setup.py build_ext --inplace
|
||||
nosetests
|
||||
python3 -m venv --clear --without-pip --system-site-packages .testenv
|
||||
gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
|
||||
.testenv/bin/python3 -m nose
|
||||
}
|
||||
|
||||
package() {
|
||||
python3 setup.py install --skip-build --root="$pkgdir"
|
||||
gpep517 install-wheel --destdir "$pkgdir" \
|
||||
.dist/*.whl
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
30ee09ca02f8b2c4b308917f766bd82df62e78737f3a4f7490c89add45473606c1aad431073445d47e488553a8f34642e680c5c98b034c56df15033d3a298180 ecos-python-2.0.11.tar.gz
|
||||
671bea0c1eadf6fe67a632af6598bc1bc48fbe2ddbdc4439f6bcc52636a9a5b43e7f1c5b7a384a737088a16f69ca3835048b562eeb4c6894a52f381d759ec6c9 use_external_ecos.patch
|
||||
1d25d4583aa0cb5031238aa49df03cec3a5e31c262c4b6c6657bd51149afa0194331c91c8a7fbb36413f0fb518ec0876ceedfcc0bb5a207497b9128183290b81 assertEquals.patch
|
||||
"
|
||||
|
22
testing/py3-ecos/assertEquals.patch
Normal file
22
testing/py3-ecos/assertEquals.patch
Normal file
@ -0,0 +1,22 @@
|
||||
diff --git a/src/test_interface.py b/src/test_interface.py
|
||||
index aa18622..d33c2a5 100644
|
||||
--- a/src/test_interface.py
|
||||
+++ b/src/test_interface.py
|
||||
@@ -8,7 +8,7 @@ def import_error(msg):
|
||||
print()
|
||||
|
||||
try:
|
||||
- from nose.tools import assert_raises, assert_almost_equals
|
||||
+ from nose.tools import assert_raises, assert_almost_equal
|
||||
except ImportError:
|
||||
import_error("Please install nose to run tests.")
|
||||
raise
|
||||
@@ -40,7 +40,7 @@ b = np.array([3.])
|
||||
dims = {'q': [], 'l': 2}
|
||||
|
||||
def check_solution(solution, expected):
|
||||
- assert_almost_equals(solution, expected, places=5)
|
||||
+ assert_almost_equal(solution, expected, places=5)
|
||||
|
||||
def test_problems():
|
||||
myopts = {'feastol': 2e-8, 'reltol': 2e-8, 'abstol': 2e-8, 'verbose':True};
|
Loading…
Reference in New Issue
Block a user