summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD64
1 files changed, 44 insertions, 20 deletions
diff --git a/PKGBUILD b/PKGBUILD
index aec6ec6ab216..c8fac705e87c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,38 +1,62 @@
# Maintainer: Astro Benzene <universebenzene at sina dot com>
pkgbase=python-stsci.skypac
-_pyname=${pkgbase#python-}
-pkgname=("python-${_pyname}" "python-${_pyname}-doc")
-pkgver=1.0.8
+_pname=${pkgbase#python-}
+_pyname=${_pname//./_}
+pkgname=("python-${_pname}" "python-${_pname}-doc")
+pkgver=1.0.10
pkgrel=1
pkgdesc="Sky matching for image mosaic"
-arch=('i686' 'x86_64')
+arch=('any')
url="https://stsci-skypac.readthedocs.io"
-license=('BSD')
-makedepends=('python-setuptools-scm' 'python-pytest-runner' 'python-stwcs' 'python-stsci.imagestats' 'python-spherical_geometry>=1.2.2' 'python-stsci_rtd_theme' 'python-sphinx_rtd_theme' 'python-numpydoc' 'texlive-latexextra')
-checkdepends=('python-pytest-doctestplus')
-source=("https://github.com/spacetelescope/stsci.skypac/archive/${pkgver}.tar.gz")
-md5sums=('30e5e2724de005f44a008d6c6e8cfaae')
+license=('BSD-3-Clause')
+makedepends=('python-setuptools-scm'
+ 'python-wheel'
+ 'python-build'
+ 'python-installer'
+ 'python-numpydoc'
+ 'python-stsci_rtd_theme'
+ 'python-stwcs'
+ 'python-stsci.imagestats'
+ 'python-spherical_geometry>=1.2.2'
+ 'texlive-latexextra') # latex.fmt: -latex; anyfontsize.sty: latexextra
+# 'python-pytest-runner'
+# 'python-sphinx_rtd_theme'
+checkdepends=('python-pytest-doctestplus') # stwcs, imagestats spherical_geometry already in makedepends
+#source=("https://github.com/spacetelescope/stsci.skypac/archive/${pkgver}.tar.gz")
+source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz"
+ 'fix-doc-underline-length.patch'
+ 'setup.cfg')
+md5sums=('3b330075f9bad82e802c93ec17e5db17'
+ '4f6d5bbf0720af0687f560e8ae97762b'
+ 'b9f7309fbf09f7a05455a1d176b9e492')
+
+get_pyver() {
+ python -c "import sys; print('$1'.join(map(str, sys.version_info[:2])))"
+}
+
prepare() {
- cd ${srcdir}/${_pyname}-${pkgver}/docs/source
+ cd ${srcdir}/${_pyname}-${pkgver}
- sed -i "/^release/c release = '${pkgver}'" conf.py
- export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
- export _pyver=$(python -c 'import sys; print("%d.%d" % sys.version_info[:2])')
+# export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
+ cat ${srcdir}/setup.cfg >> setup.cfg
+ patch -Np1 -i "${srcdir}/fix-doc-underline-length.patch"
}
build() {
cd ${srcdir}/${_pyname}-${pkgver}
- python setup.py build
+ python -m build --wheel --no-isolation
msg "Building Docs"
- PYTHONPATH="./build/lib" python setup.py build_sphinx
+ ln -rs ${srcdir}/${_pyname}-${pkgver}/${_pyname/_/.}*egg-info \
+ build/lib/${_pyname/_/.}-${pkgver}-py$(get_pyver).egg-info
+ PYTHONPATH="../build/lib" make -C docs html
}
check() {
cd ${srcdir}/${_pyname}-${pkgver}
- pytest || warning "Tests failed"
+ pytest || warning "Tests failed" # -vv -l -ra --color=yes -o console_output_style=count
}
package_python-stsci.skypac() {
@@ -42,14 +66,14 @@ package_python-stsci.skypac() {
install -D -m644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE.txt
install -D -m644 -t "${pkgdir}/usr/share/doc/${pkgname}" README.md
- python setup.py install --root=${pkgdir} --prefix=/usr --optimize=1
- rm "${pkgdir}/usr/lib/python${_pyver}/site-packages/stsci/__init__.py"
- rm "${pkgdir}/usr/lib/python${_pyver}/site-packages/stsci/__pycache__"/*
+ python -m installer --destdir="${pkgdir}" dist/*.whl
+ rm "${pkgdir}/usr/lib/python$(get_pyver .)/site-packages/stsci/__init__.py"
+ rm "${pkgdir}/usr/lib/python$(get_pyver .)/site-packages/stsci/__pycache__"/*
}
package_python-stsci.skypac-doc() {
pkgdesc="Documentation for STScI skypac"
- cd ${srcdir}/${_pyname}-${pkgver}/build/sphinx
+ cd ${srcdir}/${_pyname}-${pkgver}/docs/_build
install -D -m644 -t "${pkgdir}/usr/share/licenses/${pkgname}" ../../LICENSE.txt
install -d -m755 "${pkgdir}/usr/share/doc/${pkgbase}"