python-jmespath: install jp as a non-byte-compiled command

Upstream ships its jp command-line tool as a plain "jp.py" script. Under
that name OpenWrt byte-compiles it into a non-executable /usr/bin/jp.pyc
(and the -src package keeps a "#!/usr/bin/env python" jp.py, which has no
interpreter on OpenWrt), so it fails the CI generic executable check.

Install it as /usr/bin/jp instead: the missing .py extension stops it from
being byte-compiled and Python3/FixShebang rewrites the shebang to
/usr/bin/python3. Add a test-version.sh override since jp takes a required
expression argument and has no version flag for the generic check to probe.

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
This commit is contained in:
Alexandru Ardelean
2026-06-07 14:37:59 +03:00
committed by Alexandru Ardelean
parent ba593bc0f3
commit e7aff35e97
3 changed files with 30 additions and 1 deletions
+6 -1
View File
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=python-jmespath
PKG_VERSION:=1.1.0
PKG_RELEASE:=1
PKG_RELEASE:=2
PYPI_NAME:=jmespath
PKG_HASH:=472c87d80f36026ae83c6ddd0f1d05d4e510134ed462851fd5f754c8c3cbb88d
@@ -29,6 +29,11 @@ JMESPath (pronounced “james path”) allows you to declaratively specify
how to extract elements from a JSON document.
endef
define Py3Package/python3-jmespath/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/jp.py $(1)/usr/bin/jp
endef
$(eval $(call Py3Package,python3-jmespath))
$(eval $(call BuildPackage,python3-jmespath))
$(eval $(call BuildPackage,python3-jmespath-src))