python-prometheus-api-client

CLEAN
maintainer Smoolak 0 votes scanned 2026-09-21 00:26:32.109917
View on AUR

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
3pkgname=python-prometheus-api-client
4pkgver=0.7.2
5pkgrel=1
6pkgdesc='Python client for the Prometheus HTTP API'
7arch=('any')
8url='https://github.com/4n4nd/prometheus-api-client-python'
9license=('MIT')
10depends=(
11 'python'
12 'python-dateparser'
13 'python-requests'
14)
15optdepends=(
16 'python-pandas>=1.4: metric objects and DataFrame conversions'
17 'python-numpy: NumPy-formatted aggregation results'
18 'python-matplotlib: metric plotting'
19)
20makedepends=(
21 'python-build'
22 'python-installer'
23 'python-setuptools'
24 'python-wheel'
25)
26checkdepends=(
27 'python-httmock'
28 'python-matplotlib'
29 'python-numpy'
30 'python-pandas'
31 'python-pytest'
32)
33source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
34sha256sums=('a295ffaa2177d8b04507ed23efa89970a4b1b6e05dfcc676aff8a95e2a9d06bc')
35
36prepare() {
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
43build() {
44 cd "prometheus-api-client-python-${pkgver}"
45 python -m build --wheel --no-isolation
46}
47
48check() {
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'
60import os
61from pathlib import Path
62
63import prometheus_api_client
64from prometheus_api_client import PrometheusConnect
65
66root = Path(os.environ["PROMETHEUS_API_CLIENT_STAGED_ROOT"]).resolve()
67assert Path(prometheus_api_client.__file__).resolve().is_relative_to(root)
68assert PrometheusConnect(url="http://127.0.0.1:9090").url == "http://127.0.0.1:9090"
69PY
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
81package() {
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)SeverityRules
2026-09-21 00:26:32 Clean 2
2026-09-20 23:33:19 Low 1

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion