python-prometheus-api-client
CLEAN
maintainer Smoolak
0 votes
scanned 2026-09-21 00:26:32.109917
Triggered rules
Clean
AI review downgraded a static finding
llm_review
The static rules flagged this LOW, but an AI model (qwen/qwen3-235b-a22b-2507) reviewed the full PKGBUILD and judged it CLEAN (confidence 95%): The package builds from a legitimate source tarball hosted on GitHub, uses standard Python packaging tools, and runs tests against the built package; the flagged low-vote/recent-upload is a metadata concern, not a security risk.
1 higher static finding superseded - not the current verdict (shown for transparency)
Low
Few votes, recently uploaded
zero_votes_recent
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
PKGBUILD
1
# Maintainer: Smoolak <smoolak@gmail.com>
2
3
pkgname=python-prometheus-api-client
4
pkgver=0.7.2
5
pkgrel=1
6
pkgdesc='Python client for the Prometheus HTTP API'
7
arch=('any')
8
url='https://github.com/4n4nd/prometheus-api-client-python'
9
license=('MIT')
10
depends=(
11
'python'
12
'python-dateparser'
13
'python-requests'
14
)
15
optdepends=(
16
'python-pandas>=1.4: metric objects and DataFrame conversions'
17
'python-numpy: NumPy-formatted aggregation results'
18
'python-matplotlib: metric plotting'
19
)
20
makedepends=(
21
'python-build'
22
'python-installer'
23
'python-setuptools'
24
'python-wheel'
25
)
26
checkdepends=(
27
'python-httmock'
28
'python-matplotlib'
29
'python-numpy'
30
'python-pandas'
31
'python-pytest'
32
)
33
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
34
sha256sums=('a295ffaa2177d8b04507ed23efa89970a4b1b6e05dfcc676aff8a95e2a9d06bc')
35
36
prepare() {
37
cd "prometheus-api-client-python-${pkgver}"
38
# Avoid installing upstream's generic top-level `tests` package. The source
39
# tests still run in check() against the staged wheel.
40
sed -i 's/setuptools.find_packages()/setuptools.find_packages(exclude=("tests", "tests.*"))/' setup.py
41
}
42
43
build() {
44
cd "prometheus-api-client-python-${pkgver}"
45
python -m build --wheel --no-isolation
46
}
47
48
check() {
49
local site_packages
50
local test_root="${srcdir}/test-install"
51
site_packages="$(python -c 'import sysconfig; print(sysconfig.get_path("purelib"))')"
52
53
rm -rf "$test_root"
54
python -m installer --destdir="$test_root" \
55
"prometheus-api-client-python-${pkgver}"/dist/*.whl
56
57
cd "$srcdir"
58
PROMETHEUS_API_CLIENT_STAGED_ROOT="$test_root" \
59
PYTHONPATH="$test_root$site_packages" python - <<'PY'
60
import os
61
from pathlib import Path
62
63
import prometheus_api_client
64
from prometheus_api_client import PrometheusConnect
65
66
root = Path(os.environ["PROMETHEUS_API_CLIENT_STAGED_ROOT"]).resolve()
67
assert Path(prometheus_api_client.__file__).resolve().is_relative_to(root)
68
assert PrometheusConnect(url="http://127.0.0.1:9090").url == "http://127.0.0.1:9090"
69
PY
70
# Upstream's public-demo integration class needs a running Prometheus with
71
# more than an hour of historical samples. Keep every bundled offline test,
72
# including its mocked-network class and input-validation-only cases.
73
cd "prometheus-api-client-python-${pkgver}"
74
PROM_URL='http://127.0.0.1:9/' \
75
MPLBACKEND=Agg PYTHONPATH="$test_root$site_packages" \
76
python -m pytest -v --import-mode=importlib \
77
-k 'not TestPrometheusConnect or TestPrometheusConnectWithMockedNetwork or incorrect_input_types or method_argument_accepts_get_and_post' \
78
tests
79
}
80
81
package() {
82
cd "prometheus-api-client-python-${pkgver}"
83
PYTHONPYCACHEPREFIX="${PWD}/.cache/cpython" \
84
python -m installer --destdir="$pkgdir" dist/*.whl
85
install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
86
}
87
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-09-21 00:26:32 | Clean | 2 |
| 2026-09-20 23:33:19 | Low | 1 |