@@ -45,17 +45,33 @@ play:
4545 @echo " ` cat /etc/os-release` "
4646 @echo
4747
48+ .PHONY : clean
49+ clean :
50+ @echo
51+ @echo " ==================== clean cache files and virtualenv ===================="
52+ @echo
53+ rm -rf ./.pytest_cache ./virtualenv ./st2_auth_ldap.egg-info
54+ find . -iname ' *.pyc' -delete
55+ find . -iname ' __pycache__' -delete
56+
4857.PHONY : requirements
4958requirements : .clone_st2_repo virtualenv
5059 @echo
5160 @echo " ==================== requirements ===================="
5261 @echo
53- $(eval PIP_VERSION := $(shell grep 'PIP_VERSION ?= ' /tmp/st2/Makefile | awk '{ print $$3}') )
54- $(VIRTUALENV_DIR ) /bin/pip install --upgrade " pip==$( PIP_VERSION) "
55- $(VIRTUALENV_DIR ) /bin/pip install --cache-dir $(HOME ) /.pip-cache $(PIP_OPTIONS ) -r $(ST2_REPO_PATH ) /requirements.txt
56- $(VIRTUALENV_DIR ) /bin/pip install --cache-dir $(HOME ) /.pip-cache $(PIP_OPTIONS ) -r $(ST2_REPO_PATH ) /test-requirements.txt
57- $(VIRTUALENV_DIR ) /bin/pip install --cache-dir $(HOME ) /.pip-cache $(PIP_OPTIONS ) -r requirements.txt
58- $(VIRTUALENV_DIR ) /bin/pip install --cache-dir $(HOME ) /.pip-cache $(PIP_OPTIONS ) -r test-requirements.txt
62+ $(eval PIP_VERSION ?= $(shell awk '/^PIP_VERSION/ {print $$3}' /tmp/st2/Makefile) )
63+ $(eval SETUPTOOLS_VERSION ?= $(shell awk '/^SETUPTOOLS_VERSION/ {print $$3}' /tmp/st2/Makefile) )
64+ @echo
65+ @echo
66+ @echo Install pip $(PIP_VERSION ) and setuptools $(SETUPTOOLS_VERSION ) to match st2 core.
67+ @echo
68+ @echo
69+ $(VIRTUALENV_DIR ) /bin/$(PYBIN ) -m pip install --upgrade " pip==$( PIP_VERSION) "
70+ $(VIRTUALENV_DIR ) /bin/$(PYBIN ) -m pip install --upgrade " setuptools==$( SETUPTOOLS_VERSION) "
71+ $(VIRTUALENV_DIR ) /bin/$(PYBIN ) -m pip install --cache-dir $(HOME ) /.pip-cache $(PIP_OPTIONS ) -r $(ST2_REPO_PATH ) /requirements.txt
72+ $(VIRTUALENV_DIR ) /bin/$(PYBIN ) -m pip install --cache-dir $(HOME ) /.pip-cache $(PIP_OPTIONS ) -r $(ST2_REPO_PATH ) /test-requirements.txt
73+ $(VIRTUALENV_DIR ) /bin/$(PYBIN ) -m pip install --cache-dir $(HOME ) /.pip-cache $(PIP_OPTIONS ) -r requirements.txt
74+ $(VIRTUALENV_DIR ) /bin/$(PYBIN ) -m pip install --cache-dir $(HOME ) /.pip-cache $(PIP_OPTIONS ) -r test-requirements.txt
5975
6076 @echo ""
6177 @echo "================== register st2auth ======================"
@@ -127,10 +143,12 @@ unit-tests: requirements .clone_st2_repo .unit-tests
127143.PHONY : .clone_st2_repo
128144.clone_st2_repo :
129145 @echo
130- @echo " ==================== cloning st2 repo ===================="
146+ @echo " ==================== cloning st2 repo [ $( ST2_REPO_BRANCH ) ] ===================="
131147 @echo
132148 @rm -rf /tmp/st2
133- @git clone https://github.com/StackStorm/st2.git --depth 1 --single-branch --branch $(ST2_REPO_BRANCH ) /tmp/st2
149+ # ~ @git clone https://github.com/StackStorm/st2.git --depth 1 --single-branch --branch $(ST2_REPO_BRANCH) /tmp/st2
150+ # debug branch
151+ @git clone https://github.com/nzlosh/st2.git --depth 1 --single-branch --branch $(ST2_REPO_BRANCH) /tmp/st2
134152
135153.PHONY : .flake8
136154.flake8 :
0 commit comments