python-cel-python
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 a pure Python library from a legitimate upstream GitHub source, with minor patching of metadata; all operations are transparent and within expected AUR packaging practices.
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-cel-python
4
_pkgname=cel-python
5
pkgver=0.5.0
6
_tagver=0.5
7
pkgrel=2
8
pkgdesc="Pure Python implementation of Google Common Expression Language"
9
arch=('any')
10
url="https://github.com/cloud-custodian/cel-python"
11
license=('Apache-2.0')
12
depends=(
13
'python'
14
'python-google-re2>=1.1.20240702'
15
'python-jmespath>=1.0.1'
16
'python-lark-parser>=1.2.2'
17
'python-packaging'
18
'python-pendulum>=3.1'
19
'python-yaml>=6.0.2'
20
)
21
makedepends=(
22
'python-build'
23
'python-installer'
24
'python-hatchling'
25
'python-wheel'
26
)
27
checkdepends=(
28
'python-behave'
29
'python-pytest'
30
)
31
_archive="cel-python-$_tagver"
32
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$_tagver.tar.gz")
33
sha256sums=('b370b2494e838a05e9a0d3bdabe045640fb2cc46c4fb9d853cb0559f513eeed9')
34
35
prepare() {
36
cd "$_archive"
37
# Upstream 0.5.0 points the console script at a non-existent module.
38
# The actual CLI entry point is defined in celpy.__main__.
39
sed -i 's/cel_python:main/celpy.__main__:main/' pyproject.toml
40
}
41
42
build() {
43
cd "$_archive"
44
python -m build --wheel --no-isolation
45
}
46
47
check() {
48
rm -rf "$srcdir/test-install"
49
cd "$_archive"
50
python -m installer --destdir="$srcdir/test-install" dist/*.whl
51
local site_packages
52
site_packages=$(python -c 'import site; print(site.getsitepackages()[0])')
53
local staged="$srcdir/test-install$site_packages"
54
local test_path="$staged:$srcdir/$_archive/src"
55
56
# Run the complete unit suite against celpy from the built wheel. The source
57
# path remains second only for the unshipped developer-only xlate helpers.
58
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
59
PYTHONPATH="$test_path${PYTHONPATH:+:$PYTHONPATH}" \
60
python -m pytest -c /dev/null -p no:cacheprovider \
61
--rootdir="$srcdir/$_archive" -v tests \
62
--deselect=tests/test_c7nlib.py::test_value_from
63
# This parametrized test temporarily replaces the process-wide os.path
64
# module. Pytest 9's terminal reporter now calls os.path.commonpath before
65
# fixture teardown, so run it separately without that reporter.
66
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
67
PYTHONPATH="$test_path${PYTHONPATH:+:$PYTHONPATH}" \
68
python -m pytest -c /dev/null -p no:cacheprovider -p no:terminal \
69
--rootdir="$srcdir/$_archive" tests/test_c7nlib.py::test_value_from
70
71
# Upstream's module and documentation doctests are entirely offline.
72
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
73
PYTHONPATH="$test_path${PYTHONPATH:+:$PYTHONPATH}" \
74
python -m pytest -c /dev/null -p no:cacheprovider -v \
75
--rootdir="$srcdir/$_archive" \
76
--doctest-modules "$staged/celpy"
77
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
78
PYTHONPATH="$test_path${PYTHONPATH:+:$PYTHONPATH}" \
79
python -m pytest -c /dev/null -p no:cacheprovider -v \
80
--rootdir="$srcdir/$_archive" \
81
--doctest-glob='README.rst' README.rst
82
PYTHONPATH="$test_path${PYTHONPATH:+:$PYTHONPATH}" \
83
python -m doctest \
84
docs/source/api.rst \
85
docs/source/cli.rst \
86
docs/source/index.rst \
87
docs/source/integration.rst
88
89
# Exercise all shipped Behave scenarios with both upstream execution engines.
90
PYTHONPATH="$test_path${PYTHONPATH:+:$PYTHONPATH}" \
91
behave --tags='not @wip' --tags='not @future' \
92
-D env=arch -D runner=interpreted -D PYTHONPATH="$test_path" \
93
--logging-level=CRITICAL -f progress
94
PYTHONPATH="$test_path${PYTHONPATH:+:$PYTHONPATH}" \
95
behave --tags='not @wip' --tags='not @future' \
96
-D env=arch -D runner=compiled -D PYTHONPATH="$test_path" \
97
--logging-level=CRITICAL -f progress
98
99
# tools/test_gherkinize.py requires generated CEL conformance protobuf
100
# packages that are not published in the Arch repositories or AUR.
101
102
# Representative calculator and JSON-query workflows through the wheel's
103
# patched console entry point.
104
local cli="$srcdir/test-install/usr/bin/cel-python"
105
local result
106
result=$(PYTHONPATH="$staged${PYTHONPATH:+:$PYTHONPATH}" \
107
"$cli" -n '6 * 7')
108
[[ "$result" == "42" ]]
109
result=$(printf '%s\n' '{"account":{"balance":500},"withdrawal":125}' |
110
PYTHONPATH="$staged${PYTHONPATH:+:$PYTHONPATH}" \
111
"$cli" '.account.balance - .withdrawal')
112
[[ "$result" == "375" ]]
113
}
114
115
package() {
116
cd "$_archive"
117
python -m installer --destdir="$pkgdir" dist/*.whl
118
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
119
}
120
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-09-21 00:26:32 | Clean | 2 |
| 2026-09-20 23:33:19 | Low | 1 |