2026-04-20 22:38:45 +00:00

66 lines
1.6 KiB
Plaintext

maintainer="Hoang Nguyen <folliekazetani@protonmail.com>"
pkgname=py3-dateparser
_pyname=${pkgname#py3-}
pkgver=1.4.0
pkgrel=0
pkgdesc="Python parser for human readable dates"
url="https://github.com/scrapinghub/dateparser"
arch="noarch"
license="BSD-3-Clause"
depends="
python3
py3-dateutil
py3-regex
py3-tz
py3-tzlocal
"
makedepends="
py3-gpep517
py3-setuptools
py3-wheel
"
checkdepends="
py3-fasttext
py3-gitpython
py3-langdetect
py3-parameterized
py3-parsel
py3-pytest
py3-requests
py3-ruamel.yaml
"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/scrapinghub/dateparser/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"
build() {
gpep517 build-wheel \
--wheel-dir .dist \
--output-fd 3 3>&1 >&2
}
check() {
# test_relative_base_setting_2_en fails due to tzinfo mismatch
# test_custom_language_detect_fast_text fails due to wrong file format
_test_filter="not test_parsing_date_should_fail_using_datetime_strptime_if_locale_is_non_english \
and not test_relative_base_setting_2_en and not test_custom_language_detect_fast_text"
python3 -m venv --clear --without-pip --system-site-packages .testenv
.testenv/bin/python3 -m installer .dist/*.whl
# test_hijri.py: needs hijri_converter, test_jalali.py: convertdate
.testenv/bin/python3 -m pytest tests \
-k "$_test_filter" \
--ignore tests/test_hijri.py \
--ignore tests/test_jalali.py
}
package() {
python3 -m installer -d "$pkgdir" \
.dist/*.whl
}
sha512sums="
d9871421555209bb302f3fa65ffe9d9c45ee421f0fe20bc040370e2a80832cbea884555c259eb0efed911033bd3e539fd045ee9f30c5d89e53c381d2e1ec0d8e py3-dateparser-1.4.0.tar.gz
"