summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4789411dd8675a2942bab0315e4bed1c7cd95d02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# shellcheck shell=bash
# -*- mode: sh -*-

#  Maintainer: Klaus Alexander Seistrup <$(echo 0x1fd+d59decfa=40 | tr 0-9+a-f=x ka-i@p-u.l)>
# contributor: Mark Wagie <mark dot wagie at proton dot me>
# Contributor: Chih-Hsuan Yen <yan12125@archlinux.org>
# Contributor: Thomas Andrejak <thomas.andrejak@gmail.com>

_pkgname=python-croniter
pkgname="$_pkgname-git"
_name="${_pkgname#python-}"
pkgdesc='Parses cron schedules to iterate over datetime objects (development version)'
pkgver=6.2.4.r3.g70564f2
pkgrel=2
changelog="$_pkgname.changelog"
url='https://github.com/pallets-eco/croniter'
arch=('any')
license=('MIT')
checkdepends=(
  'python-pytest-cov'
  'python-setuptools'
)
makedepends=(
  'git'
  'python-build'
  'python-hatchling'
  'python-installer'
  'python-packaging'
  'python-pathspec'
  'python-pluggy'
  'python-trove-classifiers'
  'python-wheel'
)
depends=(
  'python'
  'python-dateutil'
  'python-pytz'
)
provides=("$_pkgname")
conflicts=("$_pkgname")
options=('!strip')
source=("git+$url.git")
sha256sums=('SKIP')

prepare() {
  cd "$_name"

  # Relax requirements
  sed -i 's/==/>=/g' pyproject.toml
  sed -i 's/hatchling>=1.31.0/hatchling>=1.30.1/g' pyproject.toml
}

pkgver() {
  cd "$_name"

  git describe --tags --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "$_name"

  sed -i 's/hatchling>=1.31.0/hatchling>=1.30.1/g' pyproject.toml
  export PYTHONWARNINGS=ignore
  python -m build --wheel --no-isolation
}

check() {
  cd "$_name"

  pytest src
}

package() {
  cd "$_name"

  python -m installer --destdir="$pkgdir" dist/*.whl

  local _site_packages='<VOID>'
  _site_packages=$(
    python -c 'import site; print(site.getsitepackages()[0])'
  )
  rm -rf "$pkgdir/$_site_packages/$_name/tests"

  install -Dm0644 -t "$pkgdir/usr/share/doc/$pkgname" ./*.rst
  install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE

  for _dir in doc licenses; do
    cd "$pkgdir/usr/share/$_dir" >/dev/null 2>&1 \
      && ln -sr $pkgname "$_pkgname"
  done
}

# eof