make: Streamline test and check targets for all directories #52

Merged
Jan Lindemann merged 16 commits from jan/feature/20260724-make-streamline-test-and-check-targets-for-all-directories into master 2026-07-24 13:54:43 +02:00 AGit
23 changed files with 260 additions and 170 deletions

View file

@ -282,7 +282,6 @@ ifeq ($(VCS),cvs)
endif endif
REV_SUBDIRS = $(call reverse $(SUBDIRS)) REV_SUBDIRS = $(call reverse $(SUBDIRS))
FRESH_CVSDIR = $(HOME)/local/src/cvs.fresh
PCKG_DEFS_DIR = $(JWBDIR)/make/defs.d PCKG_DEFS_DIR = $(JWBDIR)/make/defs.d
HDRDIR_SCOPE_SUFFIX ?= $(PROJECT) HDRDIR_SCOPE_SUFFIX ?= $(PROJECT)
@ -405,7 +404,8 @@ INSTALLED_INIT += $(addprefix $(INSTALL_INITDIR)/,$(INIT_SCRIPTS))
# -- MAKE # -- MAKE
INSTALLATION_FILE_TYPES += MAKE INSTALLATION_FILE_TYPES += MAKE
BUILD_MAKEDIR = $(TOPDIR)/make #BUILD_MAKEDIR is currently not used anywhere and costs performance. Disabled for the time being.
#BUILD_MAKEDIR = $(TOPDIR)/make
MKFILES += $(filter-out pckg-defs.mk pckg-deps.mk local.mk,$(filter-out $(DONT_INSTALL),$(wildcard *.mk))) MKFILES += $(filter-out pckg-defs.mk pckg-deps.mk local.mk,$(filter-out $(DONT_INSTALL),$(wildcard *.mk)))
INSTALL_MAKEDIR ?= $(PREFIX)/make INSTALL_MAKEDIR ?= $(PREFIX)/make
INSTALLED_MAKE += $(addprefix $(INSTALL_MAKEDIR)/,$(MKFILES)) INSTALLED_MAKE += $(addprefix $(INSTALL_MAKEDIR)/,$(MKFILES))

View file

@ -25,6 +25,7 @@ all:
install: install.done install: install.done
clean: done.clean clean: done.clean
distclean: distclean:
test:
done.clean: done.clean:
$(RM) -f *.done $(RM) -f *.done

View file

@ -16,5 +16,3 @@ ifeq ($(origin JW_PKG_EXE_PATH),undefined)
JW_PKG_EXE_PATH := $(call proj_query, exepath --delimiter ' ' $(PROJECT) $(PREREQ_RUN)) JW_PKG_EXE_PATH := $(call proj_query, exepath --delimiter ' ' $(PROJECT) $(PREREQ_RUN))
endif endif
export PATH := $(subst $(space),:,$(JW_PKG_EXE_PATH)):$(EXE_SEARCH_PATH_ENV) export PATH := $(subst $(space),:,$(JW_PKG_EXE_PATH)):$(EXE_SEARCH_PATH_ENV)
include $(JWBDIR)/make/py-path.mk

View file

@ -155,7 +155,8 @@ PROJECTS_WITH_PROJECT_CONF = $(patsubst %/make/project.conf,%,$(wildcard $(add
# --- mandatory targets # --- mandatory targets
all: $(filter-out $(UNAVAILABLE_TARGETS),pull.done) all:
all test check check-pre check-post: $(filter-out $(UNAVAILABLE_TARGETS),pull.done)
$(JW_PKG_PY_BUILD) $@ $(TARGET_PROJECTS) $(JW_PKG_PY_BUILD) $@ $(TARGET_PROJECTS)
clean: clean-dirs clean: clean-dirs
distclean: clean-all-dirs done.clean distclean: clean-all-dirs done.clean

93
make/py-check.mk Normal file
View file

@ -0,0 +1,93 @@
.PHONY: \
all \
check \
format \
check-syntax \
check-format \
py-check \
py-check-syntax \
py-check-format \
py-format \
py-format-assignments \
py-check-annotation-imports \
py-format-annotation-imports \
clean \
clean.py-check
ifndef PY_CHECK_ROOTS
PY_CHECK_ROOTS = .
endif
ifndef PY_CHECK_MYPY
PY_CHECK_MYPY := mypy
endif
ifndef PY_CHECK_RUFF
PY_CHECK_RUFF := $(shell which ruff 2>/dev/null)
ifneq ($(PY_CHECK_RUFF),)
PY_CHECK_RUFF += --config $(TOPDIR)/pyproject.toml
endif
endif
ifndef PY_CHECK_YAPF
PY_CHECK_YAPF := $(firstword $(wildcard /usr/bin/yapf /usr/bin/yapf3))
endif
ifndef PY_CHECK_PYRIGHT
PY_CHECK_PYRIGHT := $(shell which pyright 2>/dev/null)
TD_GENERATE_FILES += pyrightconfig.json
endif
all:
check: py-check
format: py-format
check-syntax: py-check-syntax
check-format: py-check-format
py-check: py-check-syntax py-check-format py-check-bad-patterns
py-check-syntax:
ifneq ($(PY_CHECK_RUFF),)
$(PY_CHECK_RUFF) check $(addprefix --exclude ,$(PY_CHECK_EXCLUDE)) $(PY_CHECK_ROOTS)
endif
$(PY_CHECK_MYPY) $(addprefix --exclude ,$(PY_CHECK_EXCLUDE)) $(PY_CHECK_ROOTS)
ifneq ($(PY_CHECK_PYRIGHT),)
$(PY_CHECK_PYRIGHT) $(PY_CHECK_ROOTS)
endif
py-check-bad-patterns:
if find $(PY_CHECK_ROOTS) -type f -name '*.py' -print0 | xargs -0 grep breakpoint; then exit 1; fi
if find $(PY_CHECK_ROOTS) -type f -name '*.py' -print0 | xargs -0 grep "^\s*).*#\s*export"; then exit 1; fi
py-check-format:
ifneq ($(PY_CHECK_YAPF),)
$(PY_CHECK_YAPF) --diff --recursive $(PY_CHECK_ROOTS)
endif
py-format:
find . -type f -name '*.py' -print0 | \
xargs -0 sed -i -E '1{/^# -\*- coding: utf-8 -\*-$$/{:a;N;/\n[[:space:]]*$$/ba;s/^# -\*- coding: utf-8 -\*-\n([[:space:]]*\n)*/ /;s/^ //}}'
ifneq ($(PY_CHECK_YAPF),)
$(PY_CHECK_YAPF) --in-place --recursive $(PY_CHECK_ROOTS)
endif
py-format-assignments:
find $(PY_CHECK_ROOTS) \
-path './.git' -prune -o \
-type f -name '*.py' \
-execdir /usr/bin/sed -i 's/^\(\s\+[a-zA-Z0-9_]\+\)=\([^,[:space:]]\+\)\([,(]\)*\s*$$/\1 = \2\3/g' {} '+'
git diff --exit-code
py-check-annotation-imports:
ifneq ($(PY_CHECK_RUFF),)
$(PY_CHECK_RUFF) check --select TC,FA --diff --unsafe-fixes $(PY_CHECK_ROOTS)
endif
py-format-annotation-imports:
ifneq ($(PY_CHECK_RUFF),)
$(PY_CHECK_RUFF) check --select TC,FA --fix --unsafe-fixes $(PY_CHECK_ROOTS)
endif
clean: clean.py-check
clean.py-check:
rm -rf .mypy_cache .ruff_cache .pytest_cache

View file

@ -19,8 +19,6 @@ else
PY_SITE_PACKAGES_PATH := $(shell $(PYTHON) -c "import site; print([d for d in site.getsitepackages() if d.find('/local/') == -1][0])") PY_SITE_PACKAGES_PATH := $(shell $(PYTHON) -c "import site; print([d for d in site.getsitepackages() if d.find('/local/') == -1][0])")
endif endif
PY_MYPY ?= mypy --ignore-missing-imports --no-namespace-packages
PY_SRC_PY ?= $(wildcard *.py) PY_SRC_PY ?= $(wildcard *.py)
PY_ALL_PY = $(PY_SRC_PY) PY_ALL_PY = $(PY_SRC_PY)
@ -37,6 +35,8 @@ endif
# deduce PY_INSTALL_DIR_PY from working directory below .. python/ # deduce PY_INSTALL_DIR_PY from working directory below .. python/
ifeq ($(PY_INSTALL_DIR_PY),) ifeq ($(PY_INSTALL_DIR_PY),)
ECHO ?= echo
SED ?= sed
PY_INSTALL_PKG_MOD ?= $(shell $(ECHO) $(CWD) | $(SED) 's%.*/python/%%; s%/.*%%') PY_INSTALL_PKG_MOD ?= $(shell $(ECHO) $(CWD) | $(SED) 's%.*/python/%%; s%/.*%%')
PY_INSTALL_SUB_MOD ?= $(shell $(ECHO) $(CWD) | $(SED) "s%.*/$(PY_INSTALL_PKG_MOD)\(/\|$$\)%%") PY_INSTALL_SUB_MOD ?= $(shell $(ECHO) $(CWD) | $(SED) "s%.*/$(PY_INSTALL_PKG_MOD)\(/\|$$\)%%")
ifneq ($(PY_INSTALL_SUB_MOD),) ifneq ($(PY_INSTALL_SUB_MOD),)
@ -93,4 +93,4 @@ endif
PY_DEFS_MK_INCLUDED := true PY_DEFS_MK_INCLUDED := true
include $(JWBDIR)/make/ldlibpath.mk include $(JWBDIR)/make/py-path.mk

View file

@ -11,3 +11,7 @@ all:
clean: py-tools.clean clean: py-tools.clean
py-tools.clean: py-tools.clean:
$(RM) -rf $(wildcard *.pyc) __pycache__ .mypy_cache .ruff_cache .pytest_cache $(RM) -rf $(wildcard *.pyc) __pycache__ .mypy_cache .ruff_cache .pytest_cache
py-path:
@echo "PYTHONPATH=$(PYTHONPATH)"
@#echo "MYPYPATH=$(MYPYPATH)"

View file

@ -29,8 +29,7 @@ $(PY_INSTALL_DIR_PY)/%.pyc: %.pyc
endif endif
$(INSTALL) -p -m $(PYMODMODE) -o $(PYMODOWNER) -g $(PYMODGROUP) $< $@ $(INSTALL) -p -m $(PYMODMODE) -o $(PYMODOWNER) -g $(PYMODGROUP) $< $@
check: include $(JWBDIR)/make/py-check.mk
$(PY_MYPY) $(shell /bin/bash $(JWB_SCRIPT_DIR)/scm.sh ls-files | grep '\.py$$')
$(PY_INSTALL_DIR_PY)/py.typed: py.typed $(PY_INSTALL_DIR_PY)/py.typed: py.typed
$(INSTALL) -p -m $(PYMODMODE) -o $(PYMODOWNER) -g $(PYMODGROUP) $< $@ $(INSTALL) -p -m $(PYMODMODE) -o $(PYMODOWNER) -g $(PYMODGROUP) $< $@

View file

@ -1,7 +1,5 @@
include $(JWBDIR)/make/defs.mk include $(JWBDIR)/make/defs.mk
include $(JWBDIR)/make/py-defs.mk include $(JWBDIR)/make/py-defs.mk
#include $(JWBDIR)/make/scripts-targets.mk
#include $(JWBDIR)/make/rules.mk
EXE ?= $(firstword $(wildcard main.py runme.py test.py *.py)) EXE ?= $(firstword $(wildcard main.py runme.py test.py *.py))
EXE_ARGS ?= EXE_ARGS ?=

View file

@ -11,71 +11,9 @@ ifndef PY_CHECK_ROOTS
PY_CHECK_ROOTS = $(wildcard $(TOPDIR)/src $(TOPDIR)/tools) PY_CHECK_ROOTS = $(wildcard $(TOPDIR)/src $(TOPDIR)/tools)
endif endif
ifndef PY_CHECK_RUFF
PY_CHECK_RUFF := $(shell which ruff 2>/dev/null)
ifneq ($(PY_CHECK_RUFF),)
PY_CHECK_RUFF += --config pyproject.toml
endif
endif
ifndef PY_CHECK_YAPF
PY_CHECK_YAPF := $(firstword $(wildcard /usr/bin/yapf /usr/bin/yapf3))
endif
ifndef PY_CHECK_PYRIGHT
PY_CHECK_PYRIGHT := $(shell which pyright 2>/dev/null)
TD_GENERATE_FILES += pyrightconfig.json
endif
all: all:
format: py-format
check-syntax: py-check-syntax
check-format: py-check-format
py-check: py-check-syntax py-check-format
py-check-syntax:
ifneq ($(PY_CHECK_RUFF),)
$(PY_CHECK_RUFF) check $(addprefix --exclude ,$(PY_CHECK_EXCLUDE)) $(PY_CHECK_ROOTS)
endif
mypy $(addprefix --exclude ,$(PY_CHECK_EXCLUDE)) $(PY_CHECK_ROOTS)
ifneq ($(PY_CHECK_PYRIGHT),)
pyright $(PY_CHECK_ROOTS)
endif
py-check-format:
ifneq ($(PY_CHECK_YAPF),)
$(PY_CHECK_YAPF) --diff --recursive $(PY_CHECK_ROOTS)
endif
py-format:
find . -type f -name '*.py' -print0 | \
xargs -0 sed -i -E '1{/^# -\*- coding: utf-8 -\*-$$/{:a;N;/\n[[:space:]]*$$/ba;s/^# -\*- coding: utf-8 -\*-\n([[:space:]]*\n)*/ /;s/^ //}}'
ifneq ($(PY_CHECK_YAPF),)
$(PY_CHECK_YAPF) --in-place --recursive $(PY_CHECK_ROOTS)
endif
py-format-assignments:
find $(PY_CHECK_ROOTS) \
-path './.git' -prune -o \
-type f -name '*.py' \
-execdir /usr/bin/sed -i 's/^\(\s\+[a-zA-Z0-9_]\+\)=\([^,[:space:]]\+\)\([,(]\)*\s*$$/\1 = \2\3/g' {} '+'
git diff --exit-code
py-check-annotation-imports:
ifneq ($(PY_CHECK_RUFF),)
$(PY_CHECK_RUFF) check --select TC,FA --diff --unsafe-fixes $(PY_CHECK_ROOTS)
endif
py-format-annotation-imports:
ifneq ($(PY_CHECK_RUFF),)
$(PY_CHECK_RUFF) check --select TC,FA --fix --unsafe-fixes $(PY_CHECK_ROOTS)
endif
clean: clean.topdir clean: clean.topdir
clean.topdir: clean.py-check clean.topdir: clean.py-check
clean.py-check:
rm -rf .mypy_cache .ruff_cache .pytest_cache
pyproject.toml: pyproject.toml:
$(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py -p $(PROJECTS_DIR) -t $(TOPDIR) --topdir-format unaltered projects create-file --format tmpl \ $(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py -p $(PROJECTS_DIR) -t $(TOPDIR) --topdir-format unaltered projects create-file --format tmpl \
@ -86,3 +24,5 @@ pyrightconfig.json:
$(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py -p $(PROJECTS_DIR) -t $(TOPDIR) --topdir-format unaltered projects create-file --format pyright \ $(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py -p $(PROJECTS_DIR) -t $(TOPDIR) --topdir-format unaltered projects create-file --format pyright \
--field base=$(JW_PKG_CONF_BASE_DIR)/project/pyrightconfig-base.json $(addprefix --field include=,$(wildcard src/python tools/python)) $(PROJECT) > $@.tmp --field base=$(JW_PKG_CONF_BASE_DIR)/project/pyrightconfig-base.json $(addprefix --field include=,$(wildcard src/python tools/python)) $(PROJECT) > $@.tmp
mv $@.tmp $@ mv $@.tmp $@
include $(JWBDIR)/make/py-check.mk

View file

@ -390,12 +390,14 @@ $$(TOPDIR)/dir_install_$(1).done:
mkdir -p $$(INSTALL_$(1)DIR) mkdir -p $$(INSTALL_$(1)DIR)
touch $$@ touch $$@
ifneq ($$(BUILD_$(1)DIR),)
$$(BUILD_$(1)DIR)/%: % | $$(TOPDIR)/dir_build_$(1).done $$(BUILD_$(1)DIR)/%: % | $$(TOPDIR)/dir_build_$(1).done
$(Q)if [ ! $$< -ef $$@ -a "`echo $$< | $(SED) 's/\..*//'`" != local ]; then \ $(Q)if [ ! $$< -ef $$@ -a "`echo $$< | $(SED) 's/\..*//'`" != local ]; then \
echo $(BIN_INSTALL) -D -p -m $($(1)MODE) $$< $$@ ;\ echo $(BIN_INSTALL) -D -p -m $($(1)MODE) $$< $$@ ;\
$(BIN_INSTALL) -D -p -m $($(1)MODE) $$< $$@ ;\ $(BIN_INSTALL) -D -p -m $($(1)MODE) $$< $$@ ;\
$(RM) -f $$(TOPDIR)/dirs-*.done ;\ $(RM) -f $$(TOPDIR)/dirs-*.done ;\
fi fi
endif
$$(INSTALL_$(1)DIR): $$(INSTALL_$(1)DIR):
ifeq ($(PACKAGE_INSTALL_DIR),true) ifeq ($(PACKAGE_INSTALL_DIR),true)

View file

@ -1,6 +1,7 @@
EXE ?= $(TOPDIR)/scripts/jw-pkg.py EXE ?= $(TOPDIR)/scripts/jw-pkg.py
LOG_LEVEL ?= info LOG_LEVEL ?= info
TEST_CMD_GLOBAL_OPTS ?= -t $(TOPDIR)
ifneq ($(LOG_LEVEL),) ifneq ($(LOG_LEVEL),)
TEST_OPTS_LOG_LEVEL := --log-level $(LOG_LEVEL) TEST_OPTS_LOG_LEVEL := --log-level $(LOG_LEVEL)
endif endif

View file

@ -5,7 +5,6 @@
from __future__ import annotations from __future__ import annotations
import os import os
import pwd
import re import re
import sys import sys
@ -115,6 +114,8 @@ class App(Base):
return self.__pretty_topdir return self.__pretty_topdir
return self.__topdir return self.__topdir
for d in [self.__projs_root, self.___opt_root]: for d in [self.__projs_root, self.___opt_root]:
if d is None:
continue
ret = d + '/' + name ret = d + '/' + name
if os.path.exists(ret): if os.path.exists(ret):
return ret return ret
@ -353,7 +354,7 @@ class App(Base):
# -- Members with default values # -- Members with default values
self.__topdir_fmt = 'absolute' self.__topdir_fmt = 'absolute'
self.__projs_root = pwd.getpwuid(os.getuid()).pw_dir + '/local/src/jw.dev/proj' self.__projs_root: str | None = None
self.___opt_root = '/opt' self.___opt_root = '/opt'
self.__pretty_projs_root = None self.__pretty_projs_root = None
@ -485,7 +486,9 @@ class App(Base):
return self.__top_name return self.__top_name
@property @property
def projs_root(self): def projs_root(self) -> str:
if self.__projs_root is None:
raise Exception('Tried to get unknown projects root directory')
return self.__projs_root return self.__projs_root
@property @property

View file

@ -53,6 +53,14 @@ class CmdBuild(Cmd): # export
'on the command line' 'on the command line'
), ),
) )
parser.add_argument(
'--dep-flavours',
default = 'auto',
help = (
'Dependency flavours to take into consideration for build, '
'comma or space separated'
)
)
parser.add_argument( parser.add_argument(
'--env-reinit', '--env-reinit',
action = 'store_true', action = 'store_true',
@ -247,9 +255,12 @@ class CmdBuild(Cmd): # export
# -- build # -- build
order: list[str] = [] order: list[str] = []
if args.dep_flavours != 'auto':
dep_flavours = re.split(r'[\s,]', args.dep_flavours)
else:
dep_flavours = ['build'] dep_flavours = ['build']
if re.match('pkg-.*', target) is not None: if re.match('pkg-.*', target) is not None:
dep_flavours = ['build', 'run', 'release', 'devel'] dep_flavours.extend(['run', 'release', 'devel'])
if target != 'order' and not args.build_order: if target != 'order' and not args.build_order:
log(NOTICE, 'Using prerequisite flavours ' + ' '.join(dep_flavours)) log(NOTICE, 'Using prerequisite flavours ' + ' '.join(dep_flavours))

View file

@ -292,8 +292,8 @@ class App: # export
self.__async_runner = None self.__async_runner = None
return ret return ret
def run_sub_commands( def run_sub_commands( # export
description = '', name_filter = '^Cmd.*', modules = None, argv = None description = '', name_filter = '^Cmd.*', modules = None, argv = None
): # export ):
app = App(description, name_filter, modules) app = App(description, name_filter, modules)
return app.run(argv = argv) return app.run(argv = argv)

View file

@ -109,9 +109,9 @@ class SSHClient(ExecContext):
def password(self) -> str | None: def password(self) -> str | None:
return self.uri.password return self.uri.password
def ssh_client( def ssh_client( # export
*args, type: str | list[str] | None = None, **kwargs *args, type: str | list[str] | None = None, **kwargs
) -> SSHClient: # export ) -> SSHClient:
from importlib import import_module from importlib import import_module
errors: list[str] = [] errors: list[str] = []

View file

@ -2,9 +2,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
import paramiko # type: ignore[import-untyped] # error: Library stubs not installed for "paramiko" # Tolerate missing paramiko imports. jw-pkg is designed to work with what it
import paramiko.agent # type: ignore[import-untyped] # finds.
import paramiko.SCPClient # type: ignore[import-untyped] import paramiko # type: ignore[import-untyped,import-not-found] # error: Library stubs not installed for "paramiko"
import paramiko.agent # type: ignore[import-untyped,import-not-found]
import paramiko.SCPClient # type: ignore[import-untyped,import-not-found]
from ...base import Result from ...base import Result
from ...log import ERR, log from ...log import ERR, log

View file

@ -33,20 +33,20 @@ async def _run(
if sudo else await run_cmd(cmd, ec = ec, cmd_input = InputMode.NonInteractive) if sudo else await run_cmd(cmd, ec = ec, cmd_input = InputMode.NonInteractive)
).stdout_str ).stdout_str
async def run_dpkg( async def run_dpkg( # export
args: list[str], args: list[str],
sudo: bool = False, sudo: bool = False,
ec: ExecContext | None = None ec: ExecContext | None = None
) -> str: # export ) -> str:
cmd = ['/usr/bin/dpkg'] cmd = ['/usr/bin/dpkg']
cmd.extend(args) cmd.extend(args)
return await _run(cmd, sudo, ec) return await _run(cmd, sudo, ec)
async def run_dpkg_query( async def run_dpkg_query( # export
args: list[str], args: list[str],
sudo: bool = False, sudo: bool = False,
ec: ExecContext | None = None ec: ExecContext | None = None
) -> str: # export ) -> str:
cmd = ['/usr/bin/dpkg-query'] cmd = ['/usr/bin/dpkg-query']
cmd.extend(args) cmd.extend(args)
return await _run(cmd, sudo, ec) return await _run(cmd, sudo, ec)

View file

@ -25,13 +25,13 @@ def meta_map():
) )
return _meta_map return _meta_map
async def run_rpm( async def run_rpm( # export
args: list[str], args: list[str],
sudo: bool = False, sudo: bool = False,
ec: ExecContext | None = None, ec: ExecContext | None = None,
mode: InputMode = InputMode.OptInteractive, mode: InputMode = InputMode.OptInteractive,
**kwargs, **kwargs,
) -> str: # export ) -> str:
cmd = ['/usr/bin/rpm'] cmd = ['/usr/bin/rpm']
cmd.extend(args) cmd.extend(args)
result = ( result = (
@ -40,10 +40,10 @@ async def run_rpm(
) )
return result.stdout_str return result.stdout_str
async def query_packages( async def query_packages( # export
names: Iterable[str] = [], names: Iterable[str] = [],
ec: ExecContext | None = None, ec: ExecContext | None = None,
) -> Iterable[Package]: # export ) -> Iterable[Package]:
fmt_str = ( fmt_str = (
'|'.join([(f'%{{{tag}}}' if tag else '') '|'.join([(f'%{{{tag}}}' if tag else '')
for tag in meta_map().values()]) + r'\n' for tag in meta_map().values()]) + r'\n'

View file

@ -209,12 +209,12 @@ async def copy(
return e return e
assert False, 'Unreachable code' assert False, 'Unreachable code'
async def get_username( async def get_username( # export
args: Namespace | None = None, args: Namespace | None = None,
url: str | None = None, url: str | None = None,
askpass_env: list[str] = [], askpass_env: list[str] = [],
ec: ExecContext | None = None, ec: ExecContext | None = None,
) -> str | None: # export ) -> str | None:
url_user = None if url is None else Uri(url).username url_user = None if url is None else Uri(url).username
if args is not None: if args is not None:
if args.username is not None: if args.username is not None:
@ -228,12 +228,12 @@ async def get_username(
return url_user return url_user
return await run_askpass(askpass_env, AskpassKey.Username, ec = ec) return await run_askpass(askpass_env, AskpassKey.Username, ec = ec)
async def get_password( async def get_password( # export
args: Namespace | None = None, args: Namespace | None = None,
url: str | None = None, url: str | None = None,
askpass_env: list[str] = [], askpass_env: list[str] = [],
ec: ExecContext | None = None, ec: ExecContext | None = None,
) -> str | None: # export ) -> str | None:
if args is None and url is None and not askpass_env: if args is None and url is None and not askpass_env:
raise Exception( raise Exception(
'Neither URL nor command-line arguments nor askpass environment variable ' 'Neither URL nor command-line arguments nor askpass environment variable '
@ -251,11 +251,11 @@ async def get_password(
return ret return ret
return await run_askpass(askpass_env, AskpassKey.Password, ec = ec) return await run_askpass(askpass_env, AskpassKey.Password, ec = ec)
async def get_profile_env( async def get_profile_env( # export
throw: bool = True, throw: bool = True,
keep: Iterable[str] | bool = False, keep: Iterable[str] | bool = False,
ec: ExecContext | None = None, ec: ExecContext | None = None,
) -> dict[str, str]: # export ) -> dict[str, str]:
""" """
Get a fresh environment from /etc/profile Get a fresh environment from /etc/profile

View file

@ -1,4 +1,4 @@
============= Running: jw-pkg.py --log-level info --help ============= Running: jw-pkg.py -t ../../../.. --log-level info --help
usage: jw-pkg.py [--log-flags LOG_FLAGS] [--log-level LOG_LEVEL] usage: jw-pkg.py [--log-flags LOG_FLAGS] [--log-level LOG_LEVEL]
[--log-file LOG_FILE] [--backtrace] [--log-file LOG_FILE] [--backtrace]
[--write-profile WRITE_PROFILE] [-t TOPDIR] [--write-profile WRITE_PROFILE] [-t TOPDIR]
@ -47,7 +47,7 @@ Available subcommands:
POSIX utility interface POSIX utility interface
projects Project metadata evaluation for building packages projects Project metadata evaluation for building packages
secrets Manage package secrets secrets Manage package secrets
============= Running: jw-pkg.py --log-level info packages --help ============= Running: jw-pkg.py -t ../../../.. --log-level info packages --help
usage: jw-pkg.py packages [-h] ... usage: jw-pkg.py packages [-h] ...
System package manager wrapper System package manager wrapper
@ -65,7 +65,7 @@ Available subcommands of packages:
reboot-required Check whether the machine needs rebooting reboot-required Check whether the machine needs rebooting
refresh Refresh the distribution's notion of available packages refresh Refresh the distribution's notion of available packages
select Select packages by filter select Select packages by filter
============= Running: jw-pkg.py --log-level info packages delete --help ============= Running: jw-pkg.py -t ../../../.. --log-level info packages delete --help
usage: jw-pkg.py packages delete [-h] [names ...] usage: jw-pkg.py packages delete [-h] [names ...]
Delete packages by name Delete packages by name
@ -75,7 +75,7 @@ positional arguments:
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
============= Running: jw-pkg.py --log-level info packages dup --help ============= Running: jw-pkg.py -t ../../../.. --log-level info packages dup --help
usage: jw-pkg.py packages dup [-h] [--download-only] usage: jw-pkg.py packages dup [-h] [--download-only]
Upgrade distribution Upgrade distribution
@ -84,7 +84,7 @@ options:
-h, --help show this help message and exit -h, --help show this help message and exit
--download-only Only download packages from the repos, don't install them, --download-only Only download packages from the repos, don't install them,
yet (default: False) yet (default: False)
============= Running: jw-pkg.py --log-level info packages install --help ============= Running: jw-pkg.py -t ../../../.. --log-level info packages install --help
usage: jw-pkg.py packages install [-h] [--only-update] [-F] [names ...] usage: jw-pkg.py packages install [-h] [--only-update] [-F] [names ...]
Install the distribution's notion of available packages Install the distribution's notion of available packages
@ -97,7 +97,7 @@ options:
--only-update Only update the listed packages, don't install them --only-update Only update the listed packages, don't install them
(default: False) (default: False)
-F, --fixed-strings Don't expand macros in <names> (default: False) -F, --fixed-strings Don't expand macros in <names> (default: False)
============= Running: jw-pkg.py --log-level info packages ls --help ============= Running: jw-pkg.py -t ../../../.. --log-level info packages ls --help
usage: jw-pkg.py packages ls [-h] [names ...] usage: jw-pkg.py packages ls [-h] [names ...]
List package contents List package contents
@ -107,7 +107,7 @@ positional arguments:
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
============= Running: jw-pkg.py --log-level info packages meta --help ============= Running: jw-pkg.py -t ../../../.. --log-level info packages meta --help
usage: jw-pkg.py packages meta [-h] [names ...] usage: jw-pkg.py packages meta [-h] [names ...]
List package metadata List package metadata
@ -117,21 +117,21 @@ positional arguments:
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
============= Running: jw-pkg.py --log-level info packages reboot-required --help ============= Running: jw-pkg.py -t ../../../.. --log-level info packages reboot-required --help
usage: jw-pkg.py packages reboot-required [-h] usage: jw-pkg.py packages reboot-required [-h]
Check whether the machine needs rebooting Check whether the machine needs rebooting
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
============= Running: jw-pkg.py --log-level info packages refresh --help ============= Running: jw-pkg.py -t ../../../.. --log-level info packages refresh --help
usage: jw-pkg.py packages refresh [-h] usage: jw-pkg.py packages refresh [-h]
Refresh the distribution's notion of available packages Refresh the distribution's notion of available packages
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
============= Running: jw-pkg.py --log-level info packages select --help ============= Running: jw-pkg.py -t ../../../.. --log-level info packages select --help
usage: jw-pkg.py packages select [-h] filter usage: jw-pkg.py packages select [-h] filter
Select packages by filter Select packages by filter
@ -141,7 +141,7 @@ positional arguments:
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
============= Running: jw-pkg.py --log-level info platform --help ============= Running: jw-pkg.py -t ../../../.. --log-level info platform --help
usage: jw-pkg.py platform [-h] ... usage: jw-pkg.py platform [-h] ...
Miscellaneous platform-related commands Miscellaneous platform-related commands
@ -152,7 +152,7 @@ options:
Available subcommands of platform: Available subcommands of platform:
info Retrieve information about target platform info Retrieve information about target platform
============= Running: jw-pkg.py --log-level info platform info --help ============= Running: jw-pkg.py -t ../../../.. --log-level info platform info --help
usage: jw-pkg.py platform info [-h] [--format FORMAT] usage: jw-pkg.py platform info [-h] [--format FORMAT]
Retrieve information about target platform Retrieve information about target platform
@ -162,7 +162,7 @@ options:
--format FORMAT Format string, expanding macros %{os}, %{id}, %{name}, --format FORMAT Format string, expanding macros %{os}, %{id}, %{name},
%{codename}, %{gnu-triplet}, %{os-cascade}, %{os-release}, %{codename}, %{gnu-triplet}, %{os-cascade}, %{os-release},
%{pkg-ext} (default: %{cascade}) %{pkg-ext} (default: %{cascade})
============= Running: jw-pkg.py --log-level info posix --help ============= Running: jw-pkg.py -t ../../../.. --log-level info posix --help
usage: jw-pkg.py posix [-h] ... usage: jw-pkg.py posix [-h] ...
Perform various operations on a distro through its POSIX utility interface Perform various operations on a distro through its POSIX utility interface
@ -174,7 +174,7 @@ Available subcommands of posix:
copy Copy files copy Copy files
tar Handle tar archives tar Handle tar archives
============= Running: jw-pkg.py --log-level info posix copy --help ============= Running: jw-pkg.py -t ../../../.. --log-level info posix copy --help
usage: jw-pkg.py posix copy [-h] [-o OWNER] [-g GROUP] [-m MODE] [-F] src dst usage: jw-pkg.py posix copy [-h] [-o OWNER] [-g GROUP] [-m MODE] [-F] src dst
Copy files Copy files
@ -189,7 +189,7 @@ options:
-g, --group GROUP Destination file group (default: None) -g, --group GROUP Destination file group (default: None)
-m, --mode MODE Destination file mode (default: None) -m, --mode MODE Destination file mode (default: None)
-F, --fixed-strings Don't expand macros in <src> and <dst> (default: False) -F, --fixed-strings Don't expand macros in <src> and <dst> (default: False)
============= Running: jw-pkg.py --log-level info posix tar --help ============= Running: jw-pkg.py -t ../../../.. --log-level info posix tar --help
usage: jw-pkg.py posix tar [-h] ... usage: jw-pkg.py posix tar [-h] ...
Handle tar archives Handle tar archives
@ -200,7 +200,7 @@ options:
Available subcommands of tar: Available subcommands of tar:
x Extract a tar archive x Extract a tar archive
============= Running: jw-pkg.py --log-level info posix tar x --help ============= Running: jw-pkg.py -t ../../../.. --log-level info posix tar x --help
usage: jw-pkg.py posix tar x [-h] -f ARCHIVE_PATH dst usage: jw-pkg.py posix tar x [-h] -f ARCHIVE_PATH dst
Extract a tar archive Extract a tar archive
@ -212,7 +212,7 @@ options:
-h, --help show this help message and exit -h, --help show this help message and exit
-f, --archive-path ARCHIVE_PATH -f, --archive-path ARCHIVE_PATH
Archive path Archive path
============= Running: jw-pkg.py --log-level info projects --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects --help
usage: jw-pkg.py projects [-h] ... usage: jw-pkg.py projects [-h] ...
Project metadata evaluation for building packages Project metadata evaluation for building packages
@ -252,9 +252,10 @@ Available subcommands of projects:
summary Print summary description of given modules summary Print summary description of given modules
test Test test Test
tmpl-dir Print directory containing templates of a given module tmpl-dir Print directory containing templates of a given module
============= Running: jw-pkg.py --log-level info projects build --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects build --help
usage: jw-pkg.py projects build [-h] [--exclude EXCLUDE] [-n] [-O] [-I] usage: jw-pkg.py projects build [-h] [--exclude EXCLUDE] [-n] [-O] [-I]
[--env-reinit] [--env-keep ENV_KEEP] [--dep-flavours DEP_FLAVOURS] [--env-reinit]
[--env-keep ENV_KEEP]
target modules [modules ...] target modules [modules ...]
janware software project build tool janware software project build tool
@ -273,13 +274,16 @@ options:
(default: False) (default: False)
-I, --ignore-deps Don't build dependencies, i.e. build only modules -I, --ignore-deps Don't build dependencies, i.e. build only modules
specified on the command line (default: False) specified on the command line (default: False)
--dep-flavours DEP_FLAVOURS
Dependency flavours to take into consideration for
build, comma or space separated (default: auto)
--env-reinit Source /etc/profile before each build step. Discard --env-reinit Source /etc/profile before each build step. Discard
environment unless --env-keep is specified (default: environment unless --env-keep is specified (default:
False) False)
--env-keep ENV_KEEP Comma seperated list of environment variables to keep, --env-keep ENV_KEEP Comma seperated list of environment variables to keep,
"all" or "none", only meaningful if --env-reinit is "all" or "none", only meaningful if --env-reinit is
specified (default: none) specified (default: none)
============= Running: jw-pkg.py --log-level info projects canonicalize-remotes --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects canonicalize-remotes --help
usage: jw-pkg.py projects canonicalize-remotes [-h] [-n] usage: jw-pkg.py projects canonicalize-remotes [-h] [-n]
Streamline janware Git remotes Streamline janware Git remotes
@ -287,7 +291,7 @@ Streamline janware Git remotes
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
-n, --dry-run Only log what would be done (default: False) -n, --dry-run Only log what would be done (default: False)
============= Running: jw-pkg.py --log-level info projects cflags --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects cflags --help
usage: jw-pkg.py projects cflags [-h] [module ...] usage: jw-pkg.py projects cflags [-h] [module ...]
cflags cflags
@ -297,7 +301,7 @@ positional arguments:
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
============= Running: jw-pkg.py --log-level info projects check --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects check --help
usage: jw-pkg.py projects check [-h] ... usage: jw-pkg.py projects check [-h] ...
Run miscellaneous code and project checks Run miscellaneous code and project checks
@ -308,7 +312,7 @@ options:
Available subcommands of check: Available subcommands of check:
deps Check for circular dependencies between given modules deps Check for circular dependencies between given modules
============= Running: jw-pkg.py --log-level info projects check deps --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects check deps --help
usage: jw-pkg.py projects check deps [-h] [-f [FLAVOUR]] [module ...] usage: jw-pkg.py projects check deps [-h] [-f [FLAVOUR]] [module ...]
Check for circular dependencies between given modules Check for circular dependencies between given modules
@ -319,14 +323,14 @@ positional arguments:
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
-f, --flavour [FLAVOUR] -f, --flavour [FLAVOUR]
============= Running: jw-pkg.py --log-level info projects commands --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects commands --help
usage: jw-pkg.py projects commands [-h] usage: jw-pkg.py projects commands [-h]
List available commands List available commands
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
============= Running: jw-pkg.py --log-level info projects create-file --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects create-file --help
usage: jw-pkg.py projects create-file [-h] [--format FORMAT] usage: jw-pkg.py projects create-file [-h] [--format FORMAT]
[--search-path SEARCH_PATH] [--search-path SEARCH_PATH]
[--template-name TEMPLATE_NAME] [--template-name TEMPLATE_NAME]
@ -351,7 +355,7 @@ options:
-f, --field KEY=VALUE -f, --field KEY=VALUE
Additional fields to insert into the output file Additional fields to insert into the output file
(default: []) (default: [])
============= Running: jw-pkg.py --log-level info projects create-pkg-config --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects create-pkg-config --help
usage: jw-pkg.py projects create-pkg-config [-h] [-F PROJECT_DESCR_FILE] usage: jw-pkg.py projects create-pkg-config [-h] [-F PROJECT_DESCR_FILE]
[-d DESCRIPTION] [-n NAME] [-d DESCRIPTION] [-n NAME]
[-s SUMMARY] [-p PREFIX] [-s SUMMARY] [-p PREFIX]
@ -375,7 +379,7 @@ options:
-r, --requires-run REQUIRES_RUN -r, --requires-run REQUIRES_RUN
-R, --requires-build REQUIRES_BUILD -R, --requires-build REQUIRES_BUILD
-V, --variables [VARIABLES ...] -V, --variables [VARIABLES ...]
============= Running: jw-pkg.py --log-level info projects exepath --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects exepath --help
usage: jw-pkg.py projects exepath [-h] [-d [DELIMITER]] [module ...] usage: jw-pkg.py projects exepath [-h] [-d [DELIMITER]] [module ...]
exepath exepath
@ -387,7 +391,7 @@ options:
-h, --help show this help message and exit -h, --help show this help message and exit
-d, --delimiter [DELIMITER] -d, --delimiter [DELIMITER]
Output words delimiter (default: :) Output words delimiter (default: :)
============= Running: jw-pkg.py --log-level info projects get-auth-info --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects get-auth-info --help
usage: jw-pkg.py projects get-auth-info [-h] [--only-values] [--username] usage: jw-pkg.py projects get-auth-info [-h] [--only-values] [--username]
[--password] [--remote-owner-base] [--password] [--remote-owner-base]
[--remote-base] [--remote-base]
@ -402,7 +406,7 @@ options:
--remote-owner-base Show remote base URL for owner jw-pkg was cloned from --remote-owner-base Show remote base URL for owner jw-pkg was cloned from
(default: False) (default: False)
--remote-base Show remote base URL (default: False) --remote-base Show remote base URL (default: False)
============= Running: jw-pkg.py --log-level info projects getval --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects getval --help
usage: jw-pkg.py projects getval [-h] [--project PROJECT] section key usage: jw-pkg.py projects getval [-h] [--project PROJECT] section key
Get value from project config Get value from project config
@ -415,7 +419,7 @@ options:
-h, --help show this help message and exit -h, --help show this help message and exit
--project PROJECT Project name, default is name of project's topdir --project PROJECT Project name, default is name of project's topdir
(default: None) (default: None)
============= Running: jw-pkg.py --log-level info projects htdocs-dir --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects htdocs-dir --help
usage: jw-pkg.py projects htdocs-dir [-h] [module ...] usage: jw-pkg.py projects htdocs-dir [-h] [module ...]
Print source directory containing document root of a given module Print source directory containing document root of a given module
@ -425,7 +429,7 @@ positional arguments:
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
============= Running: jw-pkg.py --log-level info projects ldflags --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects ldflags --help
usage: jw-pkg.py projects ldflags [-h] [--exclude EXCLUDE] [-s] [module ...] usage: jw-pkg.py projects ldflags [-h] [--exclude EXCLUDE] [-s] [module ...]
ldflags ldflags
@ -438,7 +442,7 @@ options:
--exclude EXCLUDE Exclude Modules (default: []) --exclude EXCLUDE Exclude Modules (default: [])
-s, --add-self Include libflags of specified modules, too, not only -s, --add-self Include libflags of specified modules, too, not only
their dependencies (default: False) their dependencies (default: False)
============= Running: jw-pkg.py --log-level info projects ldlibpath --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects ldlibpath --help
usage: jw-pkg.py projects ldlibpath [-h] [-d [DELIMITER]] [module ...] usage: jw-pkg.py projects ldlibpath [-h] [-d [DELIMITER]] [module ...]
ldlibpath ldlibpath
@ -450,7 +454,7 @@ options:
-h, --help show this help message and exit -h, --help show this help message and exit
-d, --delimiter [DELIMITER] -d, --delimiter [DELIMITER]
Output words delimiter (default: :) Output words delimiter (default: :)
============= Running: jw-pkg.py --log-level info projects libname --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects libname --help
usage: jw-pkg.py projects libname [-h] [module ...] usage: jw-pkg.py projects libname [-h] [module ...]
libname libname
@ -460,7 +464,7 @@ positional arguments:
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
============= Running: jw-pkg.py --log-level info projects list-repos --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects list-repos --help
usage: jw-pkg.py projects list-repos [-h] [--username USERNAME] usage: jw-pkg.py projects list-repos [-h] [--username USERNAME]
[--askpass ASKPASS] [--askpass ASKPASS]
[--from-owner FROM_OWNER] [--from-owner FROM_OWNER]
@ -480,7 +484,7 @@ options:
(default: None) (default: None)
--from-owner FROM_OWNER --from-owner FROM_OWNER
List from-owner's projects (default: janware) List from-owner's projects (default: janware)
============= Running: jw-pkg.py --log-level info projects modules --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects modules --help
usage: jw-pkg.py projects modules [-h] [-F [FILTER]] usage: jw-pkg.py projects modules [-h] [-F [FILTER]]
Query existing janware packages Query existing janware packages
@ -490,7 +494,7 @@ options:
-F, --filter [FILTER] -F, --filter [FILTER]
Key-value pairs, seperated by commas, to be searched Key-value pairs, seperated by commas, to be searched
for in project.conf (default: None) for in project.conf (default: None)
============= Running: jw-pkg.py --log-level info projects path --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects path --help
usage: jw-pkg.py projects path [-h] [module ...] usage: jw-pkg.py projects path [-h] [module ...]
path path
@ -500,7 +504,7 @@ positional arguments:
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
============= Running: jw-pkg.py --log-level info projects pkg-conflicts --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects pkg-conflicts --help
usage: jw-pkg.py projects pkg-conflicts [-h] [-S [SUBSECTIONS]] usage: jw-pkg.py projects pkg-conflicts [-h] [-S [SUBSECTIONS]]
[-d [DELIMITER]] [-p] [-d [DELIMITER]] [-p]
[--dont-strip-revision] [--dont-strip-revision]
@ -552,7 +556,7 @@ options:
(default: False) (default: False)
--quote Put double quotes around each listed dependency --quote Put double quotes around each listed dependency
(default: False) (default: False)
============= Running: jw-pkg.py --log-level info projects pkg-provides --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects pkg-provides --help
usage: jw-pkg.py projects pkg-provides [-h] [-S [SUBSECTIONS]] usage: jw-pkg.py projects pkg-provides [-h] [-S [SUBSECTIONS]]
[-d [DELIMITER]] [-p] [-d [DELIMITER]] [-p]
[--dont-strip-revision] [--dont-strip-revision]
@ -603,7 +607,7 @@ options:
(default: False) (default: False)
--quote Put double quotes around each listed dependency --quote Put double quotes around each listed dependency
(default: False) (default: False)
============= Running: jw-pkg.py --log-level info projects pkg-requires --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects pkg-requires --help
usage: jw-pkg.py projects pkg-requires [-h] [-S [SUBSECTIONS]] usage: jw-pkg.py projects pkg-requires [-h] [-S [SUBSECTIONS]]
[-d [DELIMITER]] [-p] [-d [DELIMITER]] [-p]
[--dont-strip-revision] [--dont-strip-revision]
@ -654,7 +658,7 @@ options:
(default: False) (default: False)
--quote Put double quotes around each listed dependency --quote Put double quotes around each listed dependency
(default: False) (default: False)
============= Running: jw-pkg.py --log-level info projects proj-dir --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects proj-dir --help
usage: jw-pkg.py projects proj-dir [-h] [module ...] usage: jw-pkg.py projects proj-dir [-h] [module ...]
Print directory of a given package Print directory of a given package
@ -664,7 +668,7 @@ positional arguments:
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
============= Running: jw-pkg.py --log-level info projects pythonpath --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects pythonpath --help
usage: jw-pkg.py projects pythonpath [-h] [--subdir SUBDIR] usage: jw-pkg.py projects pythonpath [-h] [--subdir SUBDIR]
[--delimiter DELIMITER] [--delimiter DELIMITER]
[--prefix PATH_COMPONENT_PREFIX] [--prefix PATH_COMPONENT_PREFIX]
@ -685,7 +689,7 @@ options:
--prefix PATH_COMPONENT_PREFIX --prefix PATH_COMPONENT_PREFIX
Prefix to prepend before every path component Prefix to prepend before every path component
(default: None) (default: None)
============= Running: jw-pkg.py --log-level info projects required-os-pkg --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects required-os-pkg --help
usage: jw-pkg.py projects required-os-pkg [-h] [--skip-excluded] [--quote] usage: jw-pkg.py projects required-os-pkg [-h] [--skip-excluded] [--quote]
flavours [modules ...] flavours [modules ...]
@ -701,7 +705,7 @@ options:
(default: False) (default: False)
--quote Put double quotes around each listed dependency (default: --quote Put double quotes around each listed dependency (default:
False) False)
============= Running: jw-pkg.py --log-level info projects summary --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects summary --help
usage: jw-pkg.py projects summary [-h] [module ...] usage: jw-pkg.py projects summary [-h] [module ...]
Print summary description of given modules Print summary description of given modules
@ -711,7 +715,7 @@ positional arguments:
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
============= Running: jw-pkg.py --log-level info projects test --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects test --help
usage: jw-pkg.py projects test [-h] blah usage: jw-pkg.py projects test [-h] blah
Test Test
@ -721,7 +725,7 @@ positional arguments:
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
============= Running: jw-pkg.py --log-level info projects tmpl-dir --help ============= Running: jw-pkg.py -t ../../../.. --log-level info projects tmpl-dir --help
usage: jw-pkg.py projects tmpl-dir [-h] [module ...] usage: jw-pkg.py projects tmpl-dir [-h] [module ...]
Print directory containing templates of a given module Print directory containing templates of a given module
@ -731,7 +735,7 @@ positional arguments:
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
============= Running: jw-pkg.py --log-level info secrets --help ============= Running: jw-pkg.py -t ../../../.. --log-level info secrets --help
usage: jw-pkg.py secrets [-h] ... usage: jw-pkg.py secrets [-h] ...
Manage package secrets Manage package secrets
@ -750,7 +754,7 @@ Available subcommands of secrets:
list-templates List package template files list-templates List package template files
rm-compilation-output rm-compilation-output
Remove package compilation output files Remove package compilation output files
============= Running: jw-pkg.py --log-level info secrets compile-templates --help ============= Running: jw-pkg.py -t ../../../.. --log-level info secrets compile-templates --help
usage: jw-pkg.py secrets compile-templates [-h] [--owner OWNER] usage: jw-pkg.py secrets compile-templates [-h] [--owner OWNER]
[--group GROUP] [--mode MODE] [--group GROUP] [--mode MODE]
[packages ...] [packages ...]
@ -765,7 +769,7 @@ options:
--owner, -o OWNER Default output file owner (default: None) --owner, -o OWNER Default output file owner (default: None)
--group, -g GROUP Default output file group (default: None) --group, -g GROUP Default output file group (default: None)
--mode, -m MODE Default output file mode (default: None) --mode, -m MODE Default output file mode (default: None)
============= Running: jw-pkg.py --log-level info secrets install --help ============= Running: jw-pkg.py -t ../../../.. --log-level info secrets install --help
usage: jw-pkg.py secrets install [-h] [--only-missing] src [packages ...] usage: jw-pkg.py secrets install [-h] [--only-missing] src [packages ...]
Install secrets from various sources as static secrets onto the target Install secrets from various sources as static secrets onto the target
@ -778,7 +782,7 @@ options:
-h, --help show this help message and exit -h, --help show this help message and exit
--only-missing Install only secrets not already on the target (default: --only-missing Install only secrets not already on the target (default:
False) False)
============= Running: jw-pkg.py --log-level info secrets list-compilation-output --help ============= Running: jw-pkg.py -t ../../../.. --log-level info secrets list-compilation-output --help
usage: jw-pkg.py secrets list-compilation-output [-h] [--all] [packages ...] usage: jw-pkg.py secrets list-compilation-output [-h] [--all] [packages ...]
List package compilation output files List package compilation output files
@ -790,7 +794,7 @@ options:
-h, --help show this help message and exit -h, --help show this help message and exit
--all Show all output targets, including non-existent files (default: --all Show all output targets, including non-existent files (default:
False) False)
============= Running: jw-pkg.py --log-level info secrets list-secrets --help ============= Running: jw-pkg.py -t ../../../.. --log-level info secrets list-secrets --help
usage: jw-pkg.py secrets list-secrets [-h] [--all] [packages ...] usage: jw-pkg.py secrets list-secrets [-h] [--all] [packages ...]
List package secret files List package secret files
@ -802,7 +806,7 @@ options:
-h, --help show this help message and exit -h, --help show this help message and exit
--all Show all secret paths, including non-existent files (default: --all Show all secret paths, including non-existent files (default:
False) False)
============= Running: jw-pkg.py --log-level info secrets list-templates --help ============= Running: jw-pkg.py -t ../../../.. --log-level info secrets list-templates --help
usage: jw-pkg.py secrets list-templates [-h] [packages ...] usage: jw-pkg.py secrets list-templates [-h] [packages ...]
List package template files List package template files
@ -812,7 +816,7 @@ positional arguments:
options: options:
-h, --help show this help message and exit -h, --help show this help message and exit
============= Running: jw-pkg.py --log-level info secrets rm-compilation-output --help ============= Running: jw-pkg.py -t ../../../.. --log-level info secrets rm-compilation-output --help
usage: jw-pkg.py secrets rm-compilation-output [-h] [packages ...] usage: jw-pkg.py secrets rm-compilation-output [-h] [packages ...]
Remove package compilation output files Remove package compilation output files

View file

@ -0,0 +1,4 @@
TOPDIR = ../../../..
include $(TOPDIR)/make/proj.mk
include $(JWBDIR)/make/dirs.mk

View file

@ -0,0 +1,29 @@
# This file runs commands typically used during initial Makefile caching.
#
# It's especially useful to run them in an explicit test, because they are used
# to fill Makefile variables, and if they fail, they leave an empty variable
# behind instead of failing the build entirely.
export JW_DEFAULT_SHOW_BACKTRACE = true
TOPDIR = ../../../../..
include $(TOPDIR)/make/proj.mk
include $(TOPDIR)/make/test-jw-pkg.mk
all:
test: test.integration.in-tree
test.integration.in-tree:
$(TEST_CMD_LINE) --topdir-format absolute platform info --format "%{gnu-triplet} %{cascade}"
$(TEST_CMD_LINE) --topdir-format absolute platform info --format %{id}-%{codename}
$(TEST_CMD_LINE) --topdir-format absolute projects pkg-requires --no-subpackages --subsections=jw --syntax names-only --delimiter " " "build devel" jw-pkg
$(TEST_CMD_LINE) --topdir-format absolute projects pkg-requires --no-subpackages --subsections=jw --syntax names-only --delimiter " " run jw-pkg
$(TEST_CMD_LINE) --topdir-format absolute projects proj-dir jw-pkg
$(TEST_CMD_LINE) --topdir-format absolute projects pythonpath --delimiter " " jw-pkg
$(TEST_CMD_LINE) --topdir-format relative projects pythonpath --prefix '$$MYPY_CONFIG_FILE_DIR/' jw-pkg
$(TEST_CMD_LINE) --topdir-format unaltered projects create-file --format tmpl --template-name pyproject.toml --search-path $(TOPDIR)/conf/templates --field "mypypath=mypy_path = "$MYPY_CONFIG_FILE_DIR/src/python"" jw-pkg > test-pyproject.toml
$(TEST_CMD_LINE) --topdir-format unaltered projects create-file --format pyright --field base=./conf/project/pyrightconfig-base.json --field include=src/python jw-pkg > test-pyrightconfig.json
clean: test.integration.in-tree.clean
test.integration.in-tree.clean:
rm -f test-*.*