diff options
-rw-r--r-- | .SRCINFO | 24 | ||||
-rw-r--r-- | PKGBUILD | 64 | ||||
-rw-r--r-- | fix-doc-underline-length.patch | 38 | ||||
-rw-r--r-- | setup.cfg | 12 |
4 files changed, 108 insertions, 30 deletions
@@ -1,23 +1,27 @@ pkgbase = python-stsci.skypac pkgdesc = Sky matching for image mosaic - pkgver = 1.0.8 + pkgver = 1.0.10 pkgrel = 1 url = https://stsci-skypac.readthedocs.io - arch = i686 - arch = x86_64 - license = BSD + arch = any + license = BSD-3-Clause checkdepends = python-pytest-doctestplus makedepends = python-setuptools-scm - makedepends = python-pytest-runner + makedepends = python-wheel + makedepends = python-build + makedepends = python-installer + makedepends = python-numpydoc + makedepends = python-stsci_rtd_theme makedepends = python-stwcs makedepends = python-stsci.imagestats makedepends = python-spherical_geometry>=1.2.2 - makedepends = python-stsci_rtd_theme - makedepends = python-sphinx_rtd_theme - makedepends = python-numpydoc makedepends = texlive-latexextra - source = https://github.com/spacetelescope/stsci.skypac/archive/1.0.8.tar.gz - md5sums = 30e5e2724de005f44a008d6c6e8cfaae + source = https://files.pythonhosted.org/packages/source/s/stsci_skypac/stsci_skypac-1.0.10.tar.gz + source = fix-doc-underline-length.patch + source = setup.cfg + md5sums = 3b330075f9bad82e802c93ec17e5db17 + md5sums = 4f6d5bbf0720af0687f560e8ae97762b + md5sums = b9f7309fbf09f7a05455a1d176b9e492 pkgname = python-stsci.skypac depends = python>=3.5 @@ -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}" diff --git a/fix-doc-underline-length.patch b/fix-doc-underline-length.patch new file mode 100644 index 000000000000..2203bc6a15b3 --- /dev/null +++ b/fix-doc-underline-length.patch @@ -0,0 +1,38 @@ +--- a/stsci/skypac/region.py 2024-05-07 03:03:03.000000000 +0800 ++++ b/stsci/skypac/region.py 2024-05-10 15:57:00.630415748 +0800 +@@ -41,7 +41,7 @@ + Base class for regions. + + Parameters +- ------------- ++ ---------- + rid: int or string + region ID + coordinate_system: astropy.wcs.CoordinateSystem instance or a string +--- a/stsci/skypac/skystatistics.py 2024-05-07 03:03:03.000000000 +0800 ++++ b/stsci/skypac/skystatistics.py 2024-05-10 15:57:46.118042948 +0800 +@@ -28,7 +28,7 @@ + """ Initializes the SkyStats object. + + Parameters +- ----------- ++ ---------- + skystat: str + Sets the statistics that will be returned by the + `~SkyStats.calc_sky`. The following statistics are supported: +@@ -78,13 +78,13 @@ + """ Computes statistics on data. + + Parameters +- ----------- ++ ---------- + data: numpy.ndarray + A numpy array of values for which the statistics needs to be + computed. + + Returns +- -------- ++ ------- + statistics: tuple + A tuple of two values: (``skyvalue``, ``npix``), where ``skyvalue`` + is the statistics specified by the `skystat` parameter during diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 000000000000..132fdff2eb8b --- /dev/null +++ b/setup.cfg @@ -0,0 +1,12 @@ +[metadata] +package_name = stsci.skypac +description = Sky matching on image mosaic +long_description = README.md +author = Mihai Cara, Warren Hack, Pey Lian Lim +author_email = help@stsci.edu +license = BSD-3-Clause +edit_on_github = False +github_project = spacetelescope/stsci.skypac +description-file = README.md +url = https://github.com/spacetelescope/stsci.skypac +homepage = https://github.com/spacetelescope/stsci.skypac |