archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-agate / trunk / PKGBUILD
blob220849db6cfeac8d3998b2a85b72e4b7acc63ea7
1 # Maintainer: Caleb Maclennan <caleb@alerque.com>
2 # Contributor: Gabriel Magno <gabrielmagno1@gmail.com>
3 # Contributor: Michał Pałubicki <maln0ir@gmx.com>
5 _pyname=agate
6 pkgname=python-$_pyname
7 pkgver=1.7.1
8 pkgrel=3
9 pkgdesc='A data analysis library that is optimized for humans instead of machines'
10 arch=(any)
11 url='https://agate.readthedocs.org/'
12 license=(MIT)
13 _pydeps=(babel
14          isodate
15          leather
16          parsedatetime
17          pyicu
18          pytimeparse
19          six
20          slugify
21          sphinx_rtd_theme)
22 depends=(python "${_pydeps[@]/#/python-}")
23 makedepends=(python-setuptools
24              python-sphinx)
25 checkdepends=(python-cssselect
26               python-lxml
27               python-nose)
28 _archive="$_pyname-$pkgver"
29 source=("https://files.pythonhosted.org/packages/source/${_pyname::1}/$_pyname/$_archive.tar.gz")
30 sha256sums=('eadf46d980168b8922d5d396d6258eecd5e7dbef7e6f0c0b71e968545ea96389')
32 prepare() {
33         cd "$_archive"
34         # Note: Upstream test suite is currently badly broken; it depends on the
35         # system local and fails on some. Part of the trouble is tracable to
36         # parsedatetime bugs so they limit allowed versions. We're going to skip
37         # known problematic tests to allow Arch's packaged version.
38         sed -i -e "/parsedatetime/s/>.*'/'/" setup.py
41 build() {
42         cd "$_archive"
43         python setup.py build
44         make -C docs html
45         _rtd_theme_path="$(python -c 'import sphinx_rtd_theme; print(sphinx_rtd_theme.get_html_theme_path())')"
46         rm -rvf "docs/_build/html/_static"
47         ln -svf "$_rtd_theme_path/sphinx_rtd_theme/static" "docs/_build/html/_static"
50 check() {
51         cd "$_archive"
52         LC_ALL=POSIX nosetests --exclude=test_cast_format_locale
55 package() {
56         cd "$_archive"
57         python setup.py install --root="$pkgdir" --optimize=1 --skip-build
58         mkdir -p "$pkgdir/usr/share/doc"
59         cp -rv "docs/_build/html" "$pkgdir/usr/share/doc/$pkgname"
60         install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" COPYING