diff options
-rw-r--r-- | .SRCINFO | 27 | ||||
-rw-r--r-- | .gitignore | 6 | ||||
-rw-r--r-- | PKGBUILD | 78 | ||||
-rw-r--r-- | correct_ephem_name.patch | 11 | ||||
-rw-r--r-- | disable_failing_assertion.patch | 13 | ||||
-rw-r--r-- | fix_doctest_failures.patch | 22 |
6 files changed, 54 insertions, 103 deletions
@@ -1,23 +1,21 @@ pkgbase = python-astroplan pkgdesc = A python package to help astronomers plan observations - pkgver = 0.4 - pkgrel = 5 - url = https://astroplan.readthedocs.io/en/latest/ + pkgver = 0.5 + pkgrel = 1 + url = https://astroplan.readthedocs.io arch = i686 arch = x86_64 license = BSD - makedepends = cython + checkdepends = python-pytest-astropy + checkdepends = python-pytest-mpl + makedepends = python-setuptools 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 = correct_ephem_name.patch - source = disable_failing_assertion.patch - source = fix_doctest_failures.patch - md5sums = 8ac6dec44aadae0b98775658856a4f01 - md5sums = 46f97fe32bba5028f27628bdde8c9da3 - md5sums = 7b5c558e1b8f87b614913a0657623720 - md5sums = d74e4eaf50f34476d90476264354fbcc + makedepends = python-sphinx-astropy + makedepends = python-astroquery + source = https://files.pythonhosted.org/packages/source/a/astroplan/astroplan-0.5.tar.gz + md5sums = db3afc36fbe8458475c10cc32aab735c pkgname = python-astroplan depends = python>=3.5 @@ -25,6 +23,9 @@ pkgname = python-astroplan depends = python-astropy>=1.3 depends = python-pytz optdepends = python-matplotlib: Plotting support - optdepends = python-pytest-mpl: Testing the plot function optdepends = python-astroquery: Astroquery support + optdepends = python-astroplan-doc: Documentation for astroplan + +pkgname = python-astroplan-doc + pkgdesc = Documentation for Python astroplan module diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..e310b26b7f12 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +src +pkg +*.src.tar.gz +*.tar.gz +*.part +*.pkg.tar.xz @@ -1,71 +1,61 @@ # Maintainer: Astro Benzene <universebenzene at sina dot com> -#pkgbase=python-astroplan -pkgname=('python-astroplan') -#'python-astroplan-doc') -pkgver=0.4 -pkgrel=5 +pkgbase=python-astroplan +_pyname=${pkgbase#python-} +pkgname=("python-${_pyname}" "python-${_pyname}-doc") +pkgver=0.5 +pkgrel=1 pkgdesc="A python package to help astronomers plan observations" arch=('i686' 'x86_64') -url="https://astroplan.readthedocs.io/en/latest/" +url="https://astroplan.readthedocs.io" license=('BSD') -makedepends=('cython' +makedepends=('python-setuptools' 'python-astropy>=1.3' 'python-pytz' - 'python-astropy-helpers') -# 'python-sphinx' -# 'python-matplotlib' -# 'python-astroquery') -#checkdepends=('python-matplotlib' 'python-pytest-mpl') -source=("https://files.pythonhosted.org/packages/source/a/astroplan/astroplan-${pkgver}.tar.gz" - 'correct_ephem_name.patch' - 'disable_failing_assertion.patch' - 'fix_doctest_failures.patch') -md5sums=('8ac6dec44aadae0b98775658856a4f01' - '46f97fe32bba5028f27628bdde8c9da3' - '7b5c558e1b8f87b614913a0657623720' - 'd74e4eaf50f34476d90476264354fbcc') + 'python-astropy-helpers' + 'python-sphinx-astropy' + 'python-astroquery') +checkdepends=('python-pytest-astropy' 'python-pytest-mpl') +source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz") +md5sums=('db3afc36fbe8458475c10cc32aab735c') prepare() { - cd ${srcdir}/astroplan-${pkgver} + cd ${srcdir}/${_pyname}-${pkgver} 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() { - cd ${srcdir}/astroplan-${pkgver} + cd ${srcdir}/${_pyname}-${pkgver} python setup.py build --use-system-libraries --offline -# msg "Building Docs" -# python setup.py build_docs + msg "Building Docs" + python setup.py build_docs } -#check() { -# cd ${srcdir}/astroplan-${pkgver} -# -# python setup.py test -#} +check() { + cd ${srcdir}/${_pyname}-${pkgver} + + python setup.py test +} package_python-astroplan() { depends=('python>=3.5' 'python-numpy>=1.10' 'python-astropy>=1.3' 'python-pytz') optdepends=('python-matplotlib: Plotting support' - 'python-pytest-mpl: Testing the plot function' - 'python-astroquery: Astroquery support') -# 'python-astroplan-doc: Documentation for astroplan') - cd ${srcdir}/astroplan-${pkgver} +# 'python-pytest-mpl: Testing the plot function' + 'python-astroquery: Astroquery support' + 'python-astroplan-doc: Documentation for astroplan') + cd ${srcdir}/${_pyname}-${pkgver} install -D -m644 LICENSE.rst -t "${pkgdir}/usr/share/licenses/${pkgname}" - install -m644 -t "${pkgdir}/usr/share/licenses/${pkgname}/" licenses/* +# install -m644 -t "${pkgdir}/usr/share/licenses/${pkgname}/" licenses/* install -D -m644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}" python setup.py install --root=${pkgdir} --prefix=/usr --optimize=1 --use-system-libraries --offline } -#package_python-astroplan-doc() { -# pkgdesc="Documentation for Python astroplan module" -# cd ${srcdir}/astroplan-${pkgver}/build/sphinx -# -# install -d -m755 "${pkgdir}/usr/share/doc/${pkgbase}" -# cp -a html "${pkgdir}/usr/share/doc/${pkgbase}" -#} +package_python-astroplan-doc() { + pkgdesc="Documentation for Python astroplan module" + cd ${srcdir}/${_pyname}-${pkgver}/docs/_build + + install -d -m755 "${pkgdir}/usr/share/doc/${pkgbase}" + cp -a html "${pkgdir}/usr/share/doc/${pkgbase}" +} diff --git a/correct_ephem_name.patch b/correct_ephem_name.patch deleted file mode 100644 index 134b56e16fa3..000000000000 --- a/correct_ephem_name.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/astroplan/conftest.py 2018-02-08 20:25:42.248064331 +0800 -+++ b/astroplan/conftest.py 2018-02-08 20:22:39.068329472 +0800 -@@ -40,7 +40,7 @@ - try: - PYTEST_HEADER_MODULES['Astropy'] = 'astropy' - PYTEST_HEADER_MODULES['pytz'] = 'pytz' -- PYTEST_HEADER_MODULES['pyephem'] = 'pyephem' -+ PYTEST_HEADER_MODULES['pyephem'] = 'ephem' - PYTEST_HEADER_MODULES['matplotlib'] = 'matplotlib' - PYTEST_HEADER_MODULES['nose'] = 'nose' - PYTEST_HEADER_MODULES['pytest-mpl'] = 'pytest_mpl' diff --git a/disable_failing_assertion.patch b/disable_failing_assertion.patch deleted file mode 100644 index c3bf56973243..000000000000 --- a/disable_failing_assertion.patch +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index daeebac6c001..000000000000 --- a/fix_doctest_failures.patch +++ /dev/null @@ -1,22 +0,0 @@ -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 |