Skip to content

Commit

Permalink
Specify useful variables for Rally CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dliappis committed Feb 17, 2020
1 parent 47ffe65 commit 657d7f1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .ci/variables.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"python_versions": {
"PY38": "3.8.0",
"PY37": "3.7.5",
"PY36": "3.6.9",
"PY35": "3.5.8"
}
}
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand Down
4 changes: 0 additions & 4 deletions make-requirements.txt

This file was deleted.

0 comments on commit 657d7f1

Please sign in to comment.