summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD89
1 files changed, 60 insertions, 29 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 58c35342948d..31b1a20a5543 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,42 +1,73 @@
# Maintainer: Gaute Hope <eg@gaute.vetsj.com>
+# Maintainer: Blair Bonnett <blair dot bonnett at gmail dot com>
# Contributor: Rich Li <rich@dranek.com>
+
pkgname=python-cartopy
-pkgver=0.17.0
-pkgrel=2
-pkgdesc="A cartographic python library with matplotlib support for visualisation"
-url="https://scitools.org.uk/cartopy/docs/latest/"
-depends=('python-numpy' 'python-six' 'python-shapely' 'python-pyshp' 'python-pyproj' 'python-matplotlib' 'python-pillow' 'python-scipy')
-optdepends=('python-fiona: faster shapefile reading'
- 'python-gdal: for use with SRTM data'
- 'python-owslib: access OGC clients')
-makedepends=('python-setuptools' 'cython')
-checkdepends=('python-pytest' 'python-filelock')
-license=('LGPL3')
+pkgver=0.23.0
+pkgrel=1
+pkgdesc="A cartographic Python library with Matplotlib support for visualisation"
+url="https://scitools.org.uk/cartopy/"
+depends=(
+ 'python-matplotlib' 'python-numpy' 'python-pillow'
+ 'python-pyproj' 'python-pyshp' 'python-scipy' 'python-shapely'
+)
+optdepends=(
+ 'python-beautifulsoup4: for use with SRTM data'
+ 'python-fiona: faster shapefile reading'
+ 'python-gdal: for use with SRTM data'
+ 'python-pyepsg: interface to https://epsg.io'
+ 'python-pykdtree: faster warping of images'
+ 'python-owslib: access OGC clients'
+)
+makedepends=(
+ 'cython' 'python-build' 'python-installer' 'python-setuptools'
+ 'python-setuptools-scm' 'python-wheel'
+)
+checkdepends=('python-pytest' 'python-pytest-mpl' 'python-flufl-lock')
+license=('BSD-3-Clause')
arch=('x86_64')
-source=("$pkgname-$pkgver.tar.gz::https://github.com/SciTools/cartopy/archive/v${pkgver}.tar.gz")
-md5sums=('9fe063295a9fd854803d3c01a60720d0')
-sha1sums=('f9936ca8639d46a5c265652e383c6d7cabd20c58')
-sha256sums=('137642e63952404ec0841fa0333ad14c58fbbf19cca2a5ac6a38498c4b4998fb')
+
+_pypi=Cartopy
+source=(
+ "https://files.pythonhosted.org/packages/source/${_pypi::1}/$_pypi/$_pypi-$pkgver.tar.gz"
+)
+sha256sums=(
+ '231f37b35701f2ba31d94959cca75e6da04c2eea3a7f14ce1c75ee3b0eae7676'
+)
+
+prepare() {
+ cd "$_pypi-$pkgver"
+
+ # Remove pre-processed Cython extensions so we can generate a local version.
+ rm lib/cartopy/trace.cpp
+}
build() {
- cd "$srcdir/cartopy-${pkgver}"
- python setup.py build
+ cd "$_pypi-$pkgver"
+
+ # pyproject.toml specifies numpy>=2.0.0rc1, but states that this is for
+ # building the wheels they release and building against numpy 1.x is fine.
+ FORCE_CYTHON=1 python -m build --wheel --no-isolation --skip-dependency-check
}
check() {
- cd "$srcdir/cartopy-${pkgver}"
- # Ignore the warnings (mostly deprecations and such), and also this test
- # failed for me, so let's disable it for now.
- pytest --disable-warnings \
- -k "not test_gridliner" \
- "build/lib.linux-${CARCH}-3.7/cartopy"
-
- # Remove any bytecode files generated from pytest (otherwise they'll be
- # installed in the package)
- find "build/lib.linux-${CARCH}-3.7/cartopy/tests" -name '*-PYTEST.pyc' -delete
+ cd "$_pypi-$pkgver"
+ python -m venv --system-site-packages test-env
+ test-env/bin/python -m installer "dist/Cartopy-$pkgver-"*.whl
+
+ # The deselected tests fail an image comparison due to small changes in the
+ # size and position of text labels.
+ test-env/bin/python -m pytest --import-mode importlib lib/cartopy/tests \
+ -k "not test_gridliner and not test_contour_label and not test_annotate" \
+ --ignore-glob="*mpl/test_ticks.py"
}
package() {
- cd "$srcdir/cartopy-${pkgver}"
- python setup.py install --root="$pkgdir" --optimize=1 --skip-build
+ cd "$_pypi-$pkgver"
+ python -m installer --destdir="$pkgdir" "dist/Cartopy-$pkgver-"*.whl
+ install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
+
+ # Remove tests from final package.
+ local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
+ rm -r "$pkgdir/$site_packages/cartopy/tests"
}