Marcel Telka
2022-12-02 a76c896b291d16944ce443b29cf601a6f9194daf
setup.py.mk: evaluate tox deps

2 files modified
13 ■■■■ changed files
make-rules/setup.py.mk 4 ●●● patch | view | raw | blame | history
tools/python-requires 9 ●●●●● patch | view | raw | blame | history
make-rules/setup.py.mk
@@ -324,9 +324,7 @@
        | $(WS_TOOLS)/python-resolve-deps \
            PYTHONPATH=$(PROTO_DIR)/$(PYTHON_DIR)/site-packages:$(PROTO_DIR)/$(PYTHON_LIB) \
            $(PYTHON) $(WS_TOOLS)/python-requires $(COMPONENT_NAME) \
        | $(GSED) -e 's/\#.*//' -e $$'s/^[ \t]*//' -e '/^$$/d' \
            -e 's/^\([a-zA-Z0-9]\([a-zA-Z0-9._-]*[a-zA-Z0-9]\)\{0,1\}\).*/\1/' \
        | tr '[A-Z]' '[a-z]' | $(GSED) -e 's/[._-]\{1,\}/-/g' ; \
        | $(PYTHON) $(WS_TOOLS)/python-requires - ; \
    for e in $$($(COMPONENT_TEST_CMD) -qq --print-extras-to=- $(COMPONENT_TEST_TARGETS)) ; do \
        PYTHONPATH=$(PROTO_DIR)/$(PYTHON_DIR)/site-packages:$(PROTO_DIR)/$(PYTHON_LIB) \
            $(PYTHON) $(WS_TOOLS)/python-requires $(COMPONENT_NAME) $$e ; \
tools/python-requires
@@ -15,9 +15,10 @@
#
#
# Print requirements for a package.
# Print requirements for a package (first argument).
# Evaluated and normalized.
# With optional EXTRA parameter passed print requirements for such extra only.
# If the package specified is - evaluate and normalize stdin.
# With optional EXTRA argument passed print requirements for such extra only.
#
import sys
@@ -44,8 +45,10 @@
# in environment when we do not want any extra.
noe = {'extra': ''}
reqs = requires(sys.argv[1]) if sys.argv[1] != "-" else sys.stdin.readlines()
try:
    for req in requires(sys.argv[1]):
    for req in reqs:
        r = Requirement(req)
        m = r.marker
        if (not m and not e) or m and ((not e and m.evaluate(noe)) or (e and not m.evaluate(noe) and m.evaluate(e))):