on master help sign in
Merge pull request #2517 from dalf/debug-ci

Update pyenv pyenvinstall Make targets

commit0a8799b8348fb005389ede1fe85cce21dd51bea1 authorAlexandre Flament <alex@al-f.net> dateMon 1 Feb 2021, 17:01 (6 years ago) parent806af508c45f11
3 files changed+30−8
.github/workflows/integration.yml+1−1 Makefile+5 utils/makefile.python+24−7
.github/workflows/integration.yml+1−1
@@ -34,7 +34,7 @@ jobs:
3434 make V=1 install
3535 make V=1 gecko.driver
3636 - name: Run tests
37− run: make V=1 test
37+ run: make V=1 ci.test
3838 - name: Test coverage
3939 run: make V=1 test.coverage
4040 - name: Store coverage result
Makefile+5
@@ -251,6 +251,11 @@ test.clean:
251251# travis
252252# ------
253253
254+PHONY += ci.test
255+ci.test:
256+ $(PY_ENV_BIN)/python -c "import yaml" || make clean
257+ $(MAKE) test
258+
254259travis.codecov:
255260 $(Q)$(PY_ENV_BIN)/python -m pip install codecov
256261
utils/makefile.python+24−7
@@ -87,6 +87,22 @@ python-exe:
8787 @:
8888endif
8989
90+msg-pip-exe:
91+ @echo "\n $(PIP) is required\n\n\
92+ Make sure you have updated pip installed, grab it from\n\
93+ https://pip.pypa.io or install it from your package\n\
94+ manager. On debian based OS these requirements are\n\
95+ installed by::\n\n\
96+ sudo -H apt-get install python$(PY)-pip\n" | $(FMT)
97+
98+ifeq ($(shell which $(PIP) >/dev/null 2>&1; echo $$?), 1)
99+pip-exe: msg-pip-exe
100+ $(error The '$(PIP)' command was not found)
101+else
102+pip-exe:
103+ @:
104+endif
105+
90106# ------------------------------------------------------------------------------
91107# commands
92108# ------------------------------------------------------------------------------
@@ -99,7 +115,8 @@ quiet_cmd_pyinstall = INSTALL $2
99115quiet_cmd_pyenvinstall = PYENV install $2
100116 cmd_pyenvinstall = \
101117 if ! cat $(PY_ENV)/requirements.sha256 2>/dev/null | sha256sum --check --status 2>/dev/null; then \
102− $(PY_ENV_BIN)/python -m pip $(PIP_VERBOSE) install -e $2$(PY_SETUP_EXTRAS) ;\
118+ rm -f $(PY_ENV)/requirements.sha256; \
119+ $(PY_ENV_BIN)/python -m pip $(PIP_VERBOSE) install -e $2$(PY_SETUP_EXTRAS) &&\
103120 sha256sum requirements*.txt > $(PY_ENV)/requirements.sha256 ;\
104121 else \
105122 echo "PYENV $2 already installed"; \
@@ -119,13 +136,13 @@ quiet_cmd_pyenvuninstall = PYENV uninstall $2
119136# $2 path to folder where virtualenv take place
120137quiet_cmd_virtualenv = PYENV usage: $ source ./$@/bin/activate
121138 cmd_virtualenv = \
122− if [ ! -d "./$(PY_ENV)" ];then \
123− $(PYTHON) -m venv $(VTENV_OPTS) $2; \
139+ if [ -d "./$(PY_ENV)" -a -x "./$(PY_ENV_BIN)/python" ]; then \
140+ echo "PYENV using virtualenv from $2"; \
141+ else \
142+ $(PYTHON) -m venv $(VTENV_OPTS) $2; \
124143 $(PY_ENV_BIN)/python -m pip install $(PIP_VERBOSE) -U pip wheel setuptools; \
125− $(PY_ENV_BIN)/python -m pip install $(PIP_VERBOSE) -r requirements.txt; \
126− else \
127− echo "PYENV using virtualenv from $2"; \
128− fi
144+ $(PY_ENV_BIN)/python -m pip install $(PIP_VERBOSE) -r requirements.txt; \
145+ fi
129146
130147# $2 path to lint
131148quiet_cmd_pylint = LINT $@