summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorUniversebenzene2022-08-22 16:34:32 +0800
committerUniversebenzene2022-08-22 16:34:32 +0800
commit666d147aa2812e85f0eb0a168fd005ec90bc80fb (patch)
treefc041baded4f36bfe03495a777c209091cbd528c
parentaac45757655821f50d5de33d1fa4da46db925492 (diff)
downloadaur-666d147aa2812e85f0eb0a168fd005ec90bc80fb.tar.gz
Fix collection.Iterable
-rw-r--r--.SRCINFO11
-rw-r--r--PKGBUILD70
-rw-r--r--fix-collection-py3.10.patch23
3 files changed, 65 insertions, 39 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d0c32a34edcb..a21e28aacca6 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,13 +1,20 @@
pkgbase = python-astrodendro
pkgdesc = Python package for computation of astronomical dendrograms
pkgver = 0.2.0
- pkgrel = 1
- url = https://dendrograms.readthedocs.io/
+ pkgrel = 2
+ url = https://dendrograms.readthedocs.io
arch = any
license = MIT
+ checkdepends = python-pytest
+ checkdepends = python-astropy
+ checkdepends = python-matplotlib
+ checkdepends = python-mock
+ checkdepends = python-h5py
makedepends = python-setuptools
source = https://files.pythonhosted.org/packages/source/a/astrodendro/astrodendro-0.2.0.tar.gz
+ source = fix-collection-py3.10.patch
md5sums = 6f4155b1d4a4b2d9cb9ae154f88c5710
+ md5sums = 1b5d8b8c5d0387a09b15c02fc1b40714
pkgname = python-astrodendro
depends = python
diff --git a/PKGBUILD b/PKGBUILD
index dcc89607236e..7c33ebabd69d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,56 +5,51 @@ pkgname=("python-${_pyname}")
#"python2-${_pyname}")
#"python-${_pyname}-doc")
pkgver=0.2.0
-pkgrel=1
+pkgrel=2
pkgdesc="Python package for computation of astronomical dendrograms"
arch=('any')
-url="https://dendrograms.readthedocs.io/"
+url="https://dendrograms.readthedocs.io"
license=('MIT')
makedepends=('python-setuptools')
-#checkdepends=('python-pytest' 'python2-pytest' 'python2-matplotlib' 'python-matplotlib' 'python2-mock' 'python-mock' 'python2-astropy' 'python-astropy')
-source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz")
-md5sums=('6f4155b1d4a4b2d9cb9ae154f88c5710')
+# 'python-wheel'
+# 'python-build'
+# 'python-installer'
+# 'python-sphinx'
+# 'python-matplotlib'
+# 'python-astropy')
+checkdepends=('python-pytest'
+ 'python-astropy'
+ 'python-matplotlib'
+ 'python-mock'
+ 'python-h5py')
+#'python2-matplotlib' 'python-matplotlib' 'python2-mock' 'python-mock' 'python2-astropy' 'python-astropy')
+source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz"
+ 'fix-collection-py3.10.patch')
+md5sums=('6f4155b1d4a4b2d9cb9ae154f88c5710'
+ '1b5d8b8c5d0387a09b15c02fc1b40714')
-#prepare() {
-# cd ${srcdir}/${_pyname}-${pkgver}
-#
-# cp -a ${srcdir}/${_pyname}-${pkgver}{,-py2}
-#}
+prepare() {
+ cd ${srcdir}/${_pyname}-${pkgver}
-build() {
-# msg "Building Python2"
-# cd ${srcdir}/${_pyname}-${pkgver}-py2
-# python2 setup.py build
+ patch -Np1 -i "${srcdir}/fix-collection-py3.10.patch"
+}
-# msg "Building Python3"
+build() {
cd ${srcdir}/${_pyname}-${pkgver}
python setup.py build
+# python -m build --wheel --no-isolation
-# msg "Building Docs"
-# python setup.py build_sphinx
+# msg "Building Docs"
+# cd ${srcdir}/${_pyname}-${pkgver}/docs
+## python setup.py build_sphinx
+# PYTHONPATH="../build/lib" make html
}
-#check() {
-# msg "Checking Python3"
-# cd ${srcdir}/${_pyname}-${pkgver}
-# python setup.py test
-#
-# msg "Checking Python2"
-# cd ${srcdir}/${_pyname}-${pkgver}-py2
-# python2 setup.py test
-#}
+check() {
+ cd ${srcdir}/${_pyname}-${pkgver}
-#package_python2-astrodendro() {
-# depends=('python2>=2.6' 'python2-numpy>=1.4.1' 'python2-astropy>=0.2.0' 'python2-h5py>=0.2.0')
-# optdepends=('python2-matplotlib: For plotting'
-# 'python2-pytest: For testing'
-# 'python2-mock: For testing')
-# cd ${srcdir}/${_pyname}-${pkgver}-py2
-#
-# install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
-## install -D -m644 README -t "${pkgdir}/usr/share/doc/${pkgname}"
-# python2 setup.py install --root=${pkgdir} --prefix=/usr --optimize=1
-#}
+ pytest || warning "Tests failed"
+}
package_python-astrodendro() {
depends=('python' 'python-numpy>=1.4.1' 'python-astropy>=0.2.0' 'python-h5py>=0.2.0')
@@ -66,6 +61,7 @@ package_python-astrodendro() {
install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
# install -D -m644 README -t "${pkgdir}/usr/share/doc/${pkgname}"
python setup.py install --root=${pkgdir} --prefix=/usr --optimize=1
+# python -m installer --destdir="${pkgdir}" dist/*.whl
}
#package_python-astrodendro-doc() {
diff --git a/fix-collection-py3.10.patch b/fix-collection-py3.10.patch
new file mode 100644
index 000000000000..ac3a3738dab9
--- /dev/null
+++ b/fix-collection-py3.10.patch
@@ -0,0 +1,23 @@
+--- a/astrodendro/dendrogram.py 2016-09-29 17:23:53.000000000 +0800
++++ b/astrodendro/dendrogram.py 2022-08-22 16:14:19.114340172 +0800
+@@ -5,7 +5,12 @@
+ # - An ancestor is the largest structure that a structure is part of
+
+ import numpy as np
+-from collections import Iterable
++try:
++ # Python > 3.9
++ from collections.abc import Iterable
++except ImportError:
++ # Python <= 3.9
++ from collections import Iterable
+ import copy
+ import warnings
+
+@@ -847,4 +852,4 @@
+ # To make the structure.level property fast, we ensure all the structures in the
+ # trunk have their level cached as "0"
+ for structure in dendrogram.trunk:
+- structure._level = 0 # See the definition of level() in structure.py
+\ No newline at end of file
++ structure._level = 0 # See the definition of level() in structure.py