summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorUniversebenzene2019-06-08 22:59:15 +0800
committerUniversebenzene2019-06-08 22:59:15 +0800
commit3568b016206260cb3821133933a783eef21c4b95 (patch)
tree7154dcc173accab13128249e6cbfe1d7ea6aa635
parente20e3b5fb38f654cfbeada2f49a8f9fee32242fc (diff)
downloadaur-3568b016206260cb3821133933a783eef21c4b95.tar.gz
Apply patches from debian
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD27
-rw-r--r--correct_ephem_name.patch (renamed from python-astroplan.patch)11
-rw-r--r--disable_failing_assertion.patch13
-rw-r--r--fix_doctest_failures.patch22
5 files changed, 61 insertions, 26 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 8a8ae11cd4b..6926d520591 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,21 +1,25 @@
-# Generated by mksrcinfo v8
-# Wed Dec 5 18:34:00 UTC 2018
pkgbase = python-astroplan
pkgdesc = A python package to help astronomers plan observations
pkgver = 0.4
- pkgrel = 4
+ pkgrel = 5
url = https://astroplan.readthedocs.io/en/latest/
arch = i686
arch = x86_64
license = BSD
+ checkdepends = python-matplotlib
+ checkdepends = python-pytest-mpl
makedepends = cython
makedepends = python-astropy>=1.3
makedepends = python-pytz
makedepends = python-astropy-helpers
source = https://files.pythonhosted.org/packages/source/a/astroplan/astroplan-0.4.tar.gz
- source = python-astroplan.patch
+ source = correct_ephem_name.patch
+ source = disable_failing_assertion.patch
+ source = fix_doctest_failures.patch
md5sums = 8ac6dec44aadae0b98775658856a4f01
- md5sums = dbeae8fbb4ac0945676630db8d219c59
+ md5sums = 46f97fe32bba5028f27628bdde8c9da3
+ md5sums = 7b5c558e1b8f87b614913a0657623720
+ md5sums = d74e4eaf50f34476d90476264354fbcc
pkgname = python-astroplan
depends = python>=3.5
diff --git a/PKGBUILD b/PKGBUILD
index 13b34cc48b7..93940f3709f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
pkgname=('python-astroplan')
#'python-astroplan-doc')
pkgver=0.4
-pkgrel=4
+pkgrel=5
pkgdesc="A python package to help astronomers plan observations"
arch=('i686' 'x86_64')
url="https://astroplan.readthedocs.io/en/latest/"
@@ -15,16 +15,23 @@ makedepends=('cython'
# 'python-sphinx'
# 'python-matplotlib'
# 'python-astroquery')
-#checkdepends=('python-matplotlib' 'python-pytest-mpl')
+checkdepends=('python-matplotlib' 'python-pytest-mpl')
source=("https://files.pythonhosted.org/packages/source/a/astroplan/astroplan-${pkgver}.tar.gz"
- 'python-astroplan.patch')
+ 'correct_ephem_name.patch'
+ 'disable_failing_assertion.patch'
+ 'fix_doctest_failures.patch')
md5sums=('8ac6dec44aadae0b98775658856a4f01'
- 'dbeae8fbb4ac0945676630db8d219c59')
+ '46f97fe32bba5028f27628bdde8c9da3'
+ '7b5c558e1b8f87b614913a0657623720'
+ 'd74e4eaf50f34476d90476264354fbcc')
prepare() {
cd ${srcdir}/astroplan-${pkgver}
- patch -Np1 -i "${srcdir}/python-astroplan.patch"
+ sed -i -e '/auto_use/s/True/False/' setup.cfg
+ patch -Np1 -i "${srcdir}/correct_ephem_name.patch"
+ patch -Np1 -i "${srcdir}/disable_failing_assertion.patch"
+ patch -Np1 -i "${srcdir}/fix_doctest_failures.patch"
}
build() {
@@ -35,11 +42,11 @@ build() {
# python setup.py build_docs
}
-#check() {
-# cd ${srcdir}/astroplan-${pkgver}
-#
-# python setup.py test
-#}
+check() {
+ cd ${srcdir}/astroplan-${pkgver}
+
+ python setup.py test
+}
package_python-astroplan() {
depends=('python>=3.5' 'python-numpy>=1.10' 'python-astropy>=1.3' 'python-pytz')
diff --git a/python-astroplan.patch b/correct_ephem_name.patch
index ef204b1d6f7..134b56e16fa 100644
--- a/python-astroplan.patch
+++ b/correct_ephem_name.patch
@@ -9,14 +9,3 @@
PYTEST_HEADER_MODULES['matplotlib'] = 'matplotlib'
PYTEST_HEADER_MODULES['nose'] = 'nose'
PYTEST_HEADER_MODULES['pytest-mpl'] = 'pytest_mpl'
---- a/setup.cfg 2017-10-24 09:42:38.000000000 +0800
-+++ b/setup.cfg 2018-02-08 20:24:32.376333521 +0800
-@@ -13,7 +13,7 @@
- doctest_plus = enabled
-
- [ah_bootstrap]
--auto_use = True
-+auto_use = False
-
- [metadata]
- package_name = astroplan
diff --git a/disable_failing_assertion.patch b/disable_failing_assertion.patch
new file mode 100644
index 00000000000..c3bf5697324
--- /dev/null
+++ b/disable_failing_assertion.patch
@@ -0,0 +1,13 @@
+Author: Vincent Prat <vinceprat@free.fr>
+Description: Disable assertion that fails without reason
+--- a/astroplan/tests/test_scheduling.py
++++ b/astroplan/tests/test_scheduling.py
+@@ -83,7 +83,7 @@
+ end_time = start + duration
+ block = TransitionBlock.from_duration(duration)
+ schedule.insert_slot(end_time - duration, block)
+- assert end_time - duration == start
++ #assert end_time - duration == start
+ assert len(schedule.slots) == 2
+ assert schedule.slots[0].start == start
+
diff --git a/fix_doctest_failures.patch b/fix_doctest_failures.patch
new file mode 100644
index 00000000000..daeebac6c00
--- /dev/null
+++ b/fix_doctest_failures.patch
@@ -0,0 +1,22 @@
+Author: Vincent Prat <vinceprat@free.fr>
+Description: Fix trivial doctest failures
+--- a/astroplan/constraints.py
++++ b/astroplan/constraints.py
+@@ -1217,7 +1217,7 @@
+ >>> import numpy as np
+ >>> airmasses = np.array([1, 1.5, 2, 3, 0])
+ >>> min_best_rescale(airmasses, 1, 2.25, less_than_min = 0)
+- array([ 1. , 0.6, 0.2, 0. , 0. ])
++ array([1. , 0.6, 0.2, 0. , 0. ])
+ """
+ rescaled = (vals - max_val) / (min_val - max_val)
+ below = vals < min_val
+@@ -1262,7 +1262,7 @@
+ >>> import numpy as np
+ >>> altitudes = np.array([20, 30, 40, 45, 55, 70])
+ >>> max_best_rescale(altitudes, 35, 60)
+- array([ 0. , 0. , 0.2, 0.4, 0.8, 1. ])
++ array([0. , 0. , 0.2, 0.4, 0.8, 1. ])
+ """
+ rescaled = (vals - min_val) / (max_val - min_val)
+ below = vals < min_val