python: Add build system integration
Add support for creating cockpit-bridge.pyz as a zipapp, containing the Python bridge, systemd_ctypes, plus a full set of packages from dist/. Add a target `make pycheck` to run the QUnit tests against this new bridge package.
This commit is contained in:
parent
9f00a79711
commit
bbccd8f8a2
|
@ -31,6 +31,7 @@ Makefile.in
|
|||
/cockpit-*.xz
|
||||
/cockpit-askpass
|
||||
/cockpit-bridge
|
||||
/cockpit-bridge.pyz
|
||||
/cockpit-certificate-ensure
|
||||
/cockpit-pcp
|
||||
/cockpit-session
|
||||
|
@ -73,6 +74,7 @@ Makefile.in
|
|||
/src/systemd/cockpit*.service
|
||||
/src/systemd/cockpit*.socket
|
||||
/src/systemd/cockpit-tempfiles.conf
|
||||
/src/systemd_ctypes/
|
||||
/src/tls/cockpit-certificate-helper
|
||||
/src/ws/cockpit-desktop
|
||||
/src/ws/cockpit.appdata.xml
|
||||
|
@ -83,4 +85,5 @@ Makefile.in
|
|||
/tools/depcomp
|
||||
/tools/install-sh
|
||||
/tools/missing
|
||||
/tools/py-compile
|
||||
/tools/test-driver
|
||||
|
|
|
@ -75,7 +75,7 @@ EXTRA_DIST += \
|
|||
check: export VERBOSE=1
|
||||
|
||||
TEST_EXTENSIONS = .html .sh
|
||||
HTML_LOG_COMPILER = $(top_srcdir)/test/common/tap-cdp --strip=$(abs_top_srcdir)/ ./test-server
|
||||
HTML_LOG_COMPILER = $(top_srcdir)/test/common/tap-cdp --strip=$(abs_top_srcdir)/ ./test-server $(COCKPIT_BRIDGE)
|
||||
|
||||
VALGRIND_ARGS = --trace-children=yes --quiet --error-exitcode=33 --gen-suppressions=all \
|
||||
$(foreach file,$(wildcard $(srcdir)/tools/*.supp),--suppressions=$(file)) \
|
||||
|
|
|
@ -4,6 +4,88 @@ libexec_PROGRAMS =
|
|||
libexec_SCRIPTS =
|
||||
sbin_PROGRAMS =
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Python
|
||||
|
||||
pyTESTS_PASSING = \
|
||||
dist/base1/test-base64.html \
|
||||
dist/base1/test-browser-storage.html \
|
||||
dist/base1/test-cache.html \
|
||||
dist/base1/test-chan.html \
|
||||
dist/base1/test-events.html \
|
||||
dist/base1/test-format.html \
|
||||
dist/base1/test-framed-cache.html \
|
||||
dist/base1/test-journal-renderer.html \
|
||||
dist/base1/test-locale.html \
|
||||
dist/base1/test-location.html \
|
||||
dist/base1/test-metrics.html \
|
||||
dist/base1/test-no-jquery.html \
|
||||
dist/base1/test-permissions.html \
|
||||
dist/base1/test-promise.html \
|
||||
dist/base1/test-protocol.html \
|
||||
dist/base1/test-series.html \
|
||||
dist/base1/test-spawn.html \
|
||||
dist/base1/test-user.html \
|
||||
dist/base1/test-utf8.html \
|
||||
dist/networkmanager/test-utils.html \
|
||||
dist/storaged/test-util.html \
|
||||
$(NULL)
|
||||
|
||||
pyTESTS_FAILING = \
|
||||
dist/base1/test-external.html \
|
||||
dist/base1/test-dbus-framed.html \
|
||||
dist/base1/test-framed.html \
|
||||
dist/base1/test-websocket.html \
|
||||
$(NULL)
|
||||
|
||||
pyTESTS_HANGING = \
|
||||
dist/base1/test-echo.html \
|
||||
dist/base1/test-dbus-address.html \
|
||||
dist/base1/test-dbus.html \
|
||||
dist/base1/test-file.html \
|
||||
dist/base1/test-spawn-proc.html \
|
||||
dist/kdump/test-config-client.html \
|
||||
dist/base1/test-http.html \
|
||||
$(NULL)
|
||||
|
||||
pyTESTS = $(pyTESTS_PASSING) $(pyTESTS_FAILING)
|
||||
|
||||
pycheck: cockpit-bridge.pyz
|
||||
$(MAKE) check XFAIL_TESTS='$(pyTESTS_FAILING)' TESTS='$(pyTESTS)' COCKPIT_BRIDGE=./cockpit-bridge.pyz
|
||||
|
||||
PYTHON_BRIDGE_FILES = \
|
||||
src/cockpit/__init__.py \
|
||||
src/cockpit/asyncstdio.py \
|
||||
src/cockpit/bridge.py \
|
||||
src/cockpit/channel.py \
|
||||
src/cockpit/channels/dbus.py \
|
||||
src/cockpit/channels/stream.py \
|
||||
src/cockpit/channeltypes.py \
|
||||
src/cockpit/packages.py \
|
||||
src/cockpit/peer.py \
|
||||
src/cockpit/protocol.py \
|
||||
src/cockpit/router.py \
|
||||
$(NULL)
|
||||
|
||||
SYSTEMD_CTYPES_STAMP = src/systemd_ctypes/__init__.py
|
||||
SYSTEMD_CTYPES_REPO_URL = https://github.com/allisonkarlitskaya/systemd_ctypes
|
||||
SYSTEMD_CTYPES_REPO_COMMIT = f08eafe8e542772de66f82d047160f0d391b9e2f
|
||||
|
||||
SYSTEMD_CTYPES_REPO_TREE = '$(strip $(SYSTEMD_CTYPES_REPO_COMMIT))^{tree}'
|
||||
$(SYSTEMD_CTYPES_STAMP):
|
||||
@git -C '$(srcdir)' rev-list --quiet --objects $(SYSTEMD_CTYPES_REPO_TREE) -- 2>/dev/null || \
|
||||
git -C '$(srcdir)' fetch --no-tags --no-write-fetch-head --depth=1 $(SYSTEMD_CTYPES_REPO_URL) $(SYSTEMD_CTYPES_REPO_COMMIT)
|
||||
@rm -rf src/systemd_ctypes
|
||||
@mkdir -p src
|
||||
$(AM_V_GEN) git -C '$(srcdir)' archive $(SYSTEMD_CTYPES_REPO_TREE) -- systemd_ctypes | tar --extract -C src
|
||||
|
||||
CLEANFILES += cockpit-bridge.pyz
|
||||
cockpit-bridge.pyz: $(MANIFESTS) $(PYTHON_BRIDGE_FILES) $(SYSTEMD_CTYPES_STAMP)
|
||||
@rm -rf tmp/pyz
|
||||
@mkdir -p tmp/pyz
|
||||
@cp -r $(srcdir)/dist $(srcdir)/src/cockpit src/systemd_ctypes/ tmp/pyz
|
||||
$(AM_V_GEN) python3 -m zipapp --python /usr/bin/python3 --output $@ --main cockpit.bridge:main tmp/pyz
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# C
|
||||
|
||||
|
|
Loading…
Reference in New Issue