blob: 39f3a7ac5573673d427663069d3dd40bb197225f (
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
|
# Maintainer: dreieck (https://aur.archlinux.org/account/dreieck)
_pkgname=python-replicate
pkgname="${_pkgname}-git"
pkgver=1.0.3+3.r273.20241115.07c8fbb
pkgrel=1
pkgdesc="A library to run machine learning models in the cloud from your own code, without having to set up any servers."
arch=(
'any'
)
url="https://replicate.com/"
_giturl="https://github.com/replicate/replicate-python"
license=('Apache')
depends=(
'python>=3.6'
'python-numpy'
'python-packaging'
'python-pydantic'
'python-requests'
)
makedepends=(
'git'
'python-build'
'python-installer'
'python-setuptools'
'python-wheel'
)
checkdepends=(
'python-packaging>=21.3'
'python-pytest>=7.1.2'
'python-responses>=0.21.0'
)
provides=(
"${_pkgname}=${pkgver}"
)
conflicts=(
"${_pkgname}"
)
replaces=()
source=(
"${_pkgname}::git+${_giturl}.git"
)
sha256sums=(
'SKIP'
)
pkgver() {
cd "${srcdir}/${_pkgname}"
_ver="$(git describe --tags | sed -E -e 's|^[vV]||' -e 's|\-g[0-9a-f]*$||' | tr '-' '+')"
_rev="$(git rev-list --count HEAD)"
_date="$(git log -1 --date=format:"%Y%m%d" --format="%ad")"
_hash="$(git rev-parse --short HEAD)"
if [ -z "${_ver}" ]; then
error "Could not determine version."
return 1
else
printf '%s' "${_ver}.r${_rev}.${_date}.${_hash}"
fi
}
prepare() {
cd "${srcdir}/${_pkgname}"
git log > "${srcdir}/git.log"
}
build() {
cd "${srcdir}/${_pkgname}"
python -m build --wheel --no-isolation
}
check() {
cd "${srcdir}/${_pkgname}"
python -m pytest
}
package() {
cd "${srcdir}/${_pkgname}"
export PYTHONHASHSEED=0
python -m installer --destdir="${pkgdir}" dist/*.whl
install -D -v -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
for _docfile in CONTRIBUTING.md README.md; do
install -D -v -m644 "${_docfile}" "${pkgdir}/usr/share/doc/${_pkgname}/${_docfile}"
done
install -D -v -m644 "${srcdir}/git.log" "${pkgdir}/usr/share/doc/${_pkgname}/git.log"
ln -svf "/usr/share/licenses/${pkgname}/LICENSE" "${pkgdir}/usr/share/doc/${_pkgname}/LICENSE"
}
|