From 657d7f1c5b65d57203df2d1b630fe226c45faab0 Mon Sep 17 00:00:00 2001 From: Dimitrios Liappis Date: Mon, 17 Feb 2020 17:47:45 +0200 Subject: [PATCH 1/2] Specify useful variables for Rally CI --- .ci/variables.json | 8 ++++++++ Makefile | 9 ++++++--- make-requirements.txt | 4 ---- 3 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 .ci/variables.json delete mode 100644 make-requirements.txt diff --git a/.ci/variables.json b/.ci/variables.json new file mode 100644 index 000000000..453e53bab --- /dev/null +++ b/.ci/variables.json @@ -0,0 +1,8 @@ +{ + "python_versions": { + "PY38": "3.8.0", + "PY37": "3.7.5", + "PY36": "3.6.9", + "PY35": "3.5.8" + } +} diff --git a/Makefile b/Makefile index b7e9699a3..730ff300f 100644 --- a/Makefile +++ b/Makefile @@ -17,9 +17,12 @@ SHELL = /bin/bash # We assume an active virtualenv for development -include make-requirements.txt PYENV_REGEX = .pyenv/shims PY_BIN = python3 +PY35 = $(shell jq '.python_versions.PY35' .ci/variables.json) +PY36 = $(shell jq '.python_versions.PY36' .ci/variables.json) +PY37 = $(shell jq '.python_versions.PY37' .ci/variables.json) +PY38 = $(shell jq '.python_versions.PY38' .ci/variables.json) VENV_NAME ?= .venv VENV_ACTIVATE_FILE = $(VENV_NAME)/bin/activate VENV_ACTIVATE = . $(VENV_ACTIVATE_FILE) @@ -30,14 +33,14 @@ PYENV_PATH_ERROR = "\033[0;31mIMPORTANT\033[0m: Please add $(HOME)/$(PYENV_REGEX PYENV_PREREQ_HELP = "\033[0;31mIMPORTANT\033[0m: please add \033[0;31meval \"\$$(pyenv init -)\"\033[0m to your bash profile and restart your terminal before proceeding any further.\n" VE_MISSING_HELP = "\033[0;31mIMPORTANT\033[0m: Couldn't find $(PWD)/$(VENV_NAME); have you executed make venv-create?\033[0m\n" -prereq: make-requirements.txt +prereq: pyenv install --skip-existing $(PY35) pyenv install --skip-existing $(PY36) pyenv install --skip-existing $(PY37) pyenv install --skip-existing $(PY38) pyenv global system $(PY35) $(PY36) $(PY37) $(PY38) @# Ensure all Python versions are registered for this project - @awk -F'=' '{print $$2}' make-requirements.txt > .python-version + jq -r '.python_versions | [.[] | tostring] | join("\n")' .ci/variables.json > .python-version -@ printf $(PYENV_PREREQ_HELP) venv-create: diff --git a/make-requirements.txt b/make-requirements.txt deleted file mode 100644 index 3c099cc07..000000000 --- a/make-requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -PY35=3.5.8 -PY36=3.6.9 -PY37=3.7.5 -PY38=3.8.0 From 0bd2b616ae5d30e0e8c09aab9c2106a2f0dbc356 Mon Sep 17 00:00:00 2001 From: Dimitrios Liappis Date: Mon, 17 Feb 2020 18:33:24 +0200 Subject: [PATCH 2/2] Address PR comment --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 730ff300f..3198fe615 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ prereq: pyenv install --skip-existing $(PY38) pyenv global system $(PY35) $(PY36) $(PY37) $(PY38) @# Ensure all Python versions are registered for this project - jq -r '.python_versions | [.[] | tostring] | join("\n")' .ci/variables.json > .python-version + @ jq -r '.python_versions | [.[] | tostring] | join("\n")' .ci/variables.json > .python-version -@ printf $(PYENV_PREREQ_HELP) venv-create: