summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO35
-rw-r--r--.gitignore8
-rw-r--r--PKGBUILD52
-rw-r--r--add-tests-subdir-to-copy.patch20
-rw-r--r--use_system_xpa.patch87
5 files changed, 154 insertions, 48 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 16fe7239588d..cbe5a06d236e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,36 +1,39 @@
-# Generated by mksrcinfo v8
-# Sat Jan 19 17:46:45 UTC 2019
pkgbase = python-imexam
pkgdesc = A package for functionality like IRAF's imexamine
- pkgver = 0.8.1
+ pkgver = 0.9.1
pkgrel = 1
- url = https://imexam.readthedocs.io/
+ url = https://imexam.readthedocs.io
arch = i686
arch = x86_64
license = BSD
license = MIT
- checkdepends = python-pytest-astropy
- checkdepends = python-photutils
+ checkdepends = python-pytest
makedepends = cython
- makedepends = python-ginga
- makedepends = python-astropy-helpers>=3.1
- makedepends = python-sphinx-astropy
+ makedepends = python-setuptools-scm
makedepends = xpa
- source = https://files.pythonhosted.org/packages/source/i/imexam/imexam-0.8.1.tar.gz
+ makedepends = python-sphinx-astropy
+ makedepends = python-matplotlib
+ makedepends = python-ginga
+ makedepends = python-photutils
+ makedepends = python-scipy
+ source = https://files.pythonhosted.org/packages/source/i/imexam/imexam-0.9.1.tar.gz
source = use_system_xpa.patch
- md5sums = 009489ebdcd6f3a66736b4035b7aa313
- md5sums = 2d4bc5f01b53f02a384dbc802d1d3ee5
+ source = add-tests-subdir-to-copy.patch
+ md5sums = 07aae0abbbe4983665fd31fa2aa3b07f
+ md5sums = 66b06d6b0ef7fee444e1ffb5adb15b15
+ md5sums = 05b3136e0437fae80962efafe6de3636
pkgname = python-imexam
- depends = python>=3.5
- depends = python-astropy
+ depends = python>=3.6
+ depends = python-astropy>=3.0
depends = python-matplotlib
+ depends = python-scipy>=0.18
+ depends = xpa
optdepends = python-ginga: For Ginga viewer support
- optdepends = xpa: For connection with DS9
optdepends = ds9: For DS9 viewer support
optdepends = python-photutils: For photometry features
optdepends = python-imexam-doc: Documentation for imexam
pkgname = python-imexam-doc
pkgdesc = Documentation for Python imexam module
-
+ arch = any
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..e896dcd6056d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+src
+pkg
+*.src.tar.gz
+*.tar.gz
+*.tar.bz2
+*.part
+*.pkg.tar.*
+*.log
diff --git a/PKGBUILD b/PKGBUILD
index afecd97b28a1..775a66177e58 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,59 +1,83 @@
# Maintainer: Astro Benzene <universebenzene at sina dot com>
+
pkgbase=python-imexam
_pyname=${pkgbase#python-}
pkgname=("python-${_pyname}" "python-${_pyname}-doc")
-pkgver=0.8.1
+pkgver=0.9.1
pkgrel=1
pkgdesc="A package for functionality like IRAF's imexamine"
arch=('i686' 'x86_64')
-url="https://imexam.readthedocs.io/"
+url="https://imexam.readthedocs.io"
license=('BSD' 'MIT')
-makedepends=('cython' 'python-ginga' 'python-astropy-helpers>=3.1' 'python-sphinx-astropy' 'xpa')
-checkdepends=('python-pytest-astropy' 'python-photutils')
+makedepends=('cython'
+ 'python-setuptools-scm'
+# 'python-wheel'
+# 'python-build'
+# 'python-installer'
+ 'xpa'
+ 'python-sphinx-astropy'
+ 'python-matplotlib'
+ 'python-ginga'
+ 'python-photutils'
+ 'python-scipy')
+checkdepends=('python-pytest') # 'python-photutils' 'python-matplotlib' 'python-scipy'
source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz"
- 'use_system_xpa.patch')
-md5sums=('009489ebdcd6f3a66736b4035b7aa313'
- '2d4bc5f01b53f02a384dbc802d1d3ee5')
+ 'use_system_xpa.patch'
+ 'add-tests-subdir-to-copy.patch')
+md5sums=('07aae0abbbe4983665fd31fa2aa3b07f'
+ '66b06d6b0ef7fee444e1ffb5adb15b15'
+ '05b3136e0437fae80962efafe6de3636')
+
+get_pyver() {
+ python -c "import sys; print('$1'.join(map(str, sys.version_info[:2])))"
+}
prepare() {
cd ${srcdir}/${_pyname}-${pkgver}
- sed -i -e '/auto_use/s/True/False/' setup.cfg
patch -Np1 -i "${srcdir}/use_system_xpa.patch"
+ patch -Np1 -i "${srcdir}/add-tests-subdir-to-copy.patch"
+ sed -i "/doctest/s/sphinx_astropy.ext.doctest/pytest_doctestplus.sphinx.doctestplus/" docs/conf.py
}
build() {
cd ${srcdir}/${_pyname}-${pkgver}
- python setup.py build --use-system-libraries --offline
+ python setup.py build
+# python -m build --wheel --no-isolation
+ cp ${_pyname}/*.so build/lib*/${_pyname}
msg "Building Docs"
- python setup.py build_docs
+ cd ${srcdir}/${_pyname}-${pkgver}/docs
+ PYTHONPATH="../build/lib.linux-${CARCH}-cpython-$(get_pyver)" make html
}
check() {
cd ${srcdir}/${_pyname}-${pkgver}
- python setup.py test
+ pytest || warning "Tests failed"
}
package_python-imexam() {
- depends=('python>=3.5' 'python-astropy' 'python-matplotlib')
+ depends=('python>=3.6' 'python-astropy>=3.0' 'python-matplotlib' 'python-scipy>=0.18' 'xpa')
optdepends=('python-ginga: For Ginga viewer support'
- 'xpa: For connection with DS9'
'ds9: For DS9 viewer support'
'python-photutils: For photometry features'
'python-imexam-doc: Documentation for imexam')
+# 'python-pytest-astropy: For testing'
cd ${srcdir}/${_pyname}-${pkgver}
install -D -m644 -t "${pkgdir}/usr/share/licenses/${pkgname}" licenses/{LICENSE.rst,LICENSE_MIT.txt}
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
+ python setup.py install --root=${pkgdir} --prefix=/usr --optimize=1
+# python -m installer --destdir="${pkgdir}" dist/*.whl
}
package_python-imexam-doc() {
pkgdesc="Documentation for Python imexam module"
+ arch=('any')
cd ${srcdir}/${_pyname}-${pkgver}/docs/_build
+ install -D -m644 -t "${pkgdir}/usr/share/licenses/${pkgname}" ../../licenses/{LICENSE.rst,LICENSE_MIT.txt}
install -d -m755 "${pkgdir}/usr/share/doc/${pkgbase}"
cp -a html "${pkgdir}/usr/share/doc/${pkgbase}"
}
diff --git a/add-tests-subdir-to-copy.patch b/add-tests-subdir-to-copy.patch
new file mode 100644
index 000000000000..2323358d61a2
--- /dev/null
+++ b/add-tests-subdir-to-copy.patch
@@ -0,0 +1,20 @@
+From: Ole Streicher <olebole@debian.org>
+Date: Thu, 16 Apr 2020 13:24:10 +0200
+Subject: Add tests subdir to copy
+
+---
+ setup.cfg | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/setup.cfg b/setup.cfg
+index 9a22f76..b6aed77 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -27,6 +27,7 @@ setup_requires =
+ setuptools >= 30.3.0
+ packages =
+ imexam
++ imexam/tests
+ install_requires =
+ numpy>=1.14
+ scipy>=0.18
diff --git a/use_system_xpa.patch b/use_system_xpa.patch
index a0fcbffa3df9..b6cf4048828c 100644
--- a/use_system_xpa.patch
+++ b/use_system_xpa.patch
@@ -1,42 +1,93 @@
---- a/setup.py 2018-12-15 04:45:58.000000000 +0800
-+++ b/setup.py 2019-01-19 23:43:53.493115239 +0800
-@@ -121,24 +121,20 @@
+From: Ole Streicher <ole@aip.de>
+Date: Fri, 21 Apr 2017 13:40:06 +0200
+Subject: Use external xpa
+
+---
+ setup.py | 39 ++++++---------------------------------
+ 1 file changed, 6 insertions(+), 33 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index dbd93f5..0915595 100644
+--- a/setup.py
++++ b/setup.py
+@@ -154,19 +154,14 @@ if not sys.platform.startswith('win'):
xpaio.c
""".split()
+- package_data[PACKAGENAME].extend(XPA_FILES)
+- suffix_lib = importlib.machinery.EXTENSION_SUFFIXES[0]
+- package_data[PACKAGENAME].append(XPA_LIBNAME+suffix_lib)
+-
- XPA_SOURCES = [os.path.join(XPALIB_DIR, c) for c in XPA_FILES]
- XPALIB_DEFINES = [("HAVE_CONFIG_H", "1")]
+ XPA_SOURCES = []
+ XPALIB_DEFINES = []
XPA_SOURCES.append(CYTHON_SOURCE)
- xpa_module = Extension("xpa",
+ xpa_module = Extension("imexam."+XPA_LIBNAME,
sources=XPA_SOURCES,
- include_dirs=[XPALIB_DIR],
define_macros=XPALIB_DEFINES,
- depends=[CONF_H_NAME],
-+ libraries=['xpa'],
++ libraries = ['xpa'],
)
if use_cython:
ext = cythonize(xpa_module)
+@@ -195,23 +190,11 @@ if not sys.platform.startswith('win'):
+ ('bdist_base', 'bdist_base'))
- class my_clean(clean):
def run(self):
-- import subprocess
-- subprocess.call(["make", "clean"],
-- cwd=XPALIB_DIR)
+- try:
+- if os.access(XPALIB_DIR + "Makefile", os.F_OK):
+- check_call(["make", "clean"], cwd=XPALIB_DIR)
+- except CalledProcessError as e:
+- print(e)
+- exit(1)
if os.access(CONF_H_NAME, os.F_OK):
os.remove(CONF_H_NAME)
os.remove("wrappers/xpa.c")
-@@ -147,11 +143,6 @@
- class build_ext_with_configure(build_ext):
+- xpa_bins = ["xpaaccess",
+- "xpaget",
+- "xpainfo",
+- "xpamb",
+- "xpans",
+- "xpaset",
+- ]
++ xpa_bins = []
+ for file in xpa_bins:
+ myfile = current_env + "/bin/" + file
+ if os.access(myfile, os.F_OK):
+@@ -233,7 +216,7 @@ if not sys.platform.startswith('win'):
+ def initialize_options(self):
+ super().initialize_options()
+ self.noremake = None
+- self.remake = True
++ self.remake = False
+
+ def finalize_options(self):
+ super().finalize_options()
+@@ -264,16 +247,6 @@ if not sys.platform.startswith('win'):
def build_extensions(self):
-- import subprocess
-- subprocess.call(["make", "-f", "Makefile", "clean"],
-- cwd=XPALIB_DIR)
-- subprocess.call(["sh", "./configure"], cwd=XPALIB_DIR)
-- subprocess.call(["make", "-f", "Makefile"], cwd=XPALIB_DIR)
- build_ext.build_extensions(self)
+ super().build_extensions()
+
+- def run(self):
+- try:
+- check_call(["sh", "./configure","--prefix="+current_env], cwd=XPALIB_DIR)
+- check_call(["make", "clean"],cwd=XPALIB_DIR)
+- check_call(["make", "install"], cwd=XPALIB_DIR)
+- except CalledProcessError as e:
+- print(e)
+- exit(1)
+- build_ext.run(self)
+-
+
- cmdclass.update({'build_ext': build_ext_with_configure,
+ cmdclass.update({'install' : InstallWithRemake,
+@@ -301,4 +274,4 @@ setup(
+ package_data=package_data,
+ package_dir={'imexam': 'imexam'},
+ ext_modules=ext,
+-)
+\ No newline at end of file
++)