Skip to content

Commit

Permalink
testing removal of python2 testing
Browse files Browse the repository at this point in the history
  • Loading branch information
asktheaxis committed Sep 10, 2021
1 parent e5a9a95 commit baee216
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 40 deletions.
58 changes: 20 additions & 38 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ PY_FILES := $(shell git ls-files '*.py')
ROOT_VIRTUALENV ?= ""

### python 2/3 specific stuff
PYTHON_EXE ?= python
PYTHON_VERSION = $(shell $(PYTHON_EXE) --version 2>&1 | awk '{ print $$2 }')
PYTHON_NAME = python$(PYTHON_VERSION)
PYTHON_CI_DIR = $(ROOT_DIR)/$(PYTHON_NAME)
VIRTUALENV_NAME ?= virtualenv
VIRTUALENV_DIR ?= $(PYTHON_CI_DIR)/$(VIRTUALENV_NAME)
# PYTHON_EXE ?= python
# PYTHON_VERSION = $(shell $(PYTHON_EXE) --version 2>&1 | awk '{ print $$2 }')
# PYTHON_NAME = python$(PYTHON_VERSION)
# PYTHON_CI_DIR = $(ROOT_DIR)/$(PYTHON_NAME)
# VIRTUALENV_NAME ?= virtualenv
# VIRTUALENV_DIR ?= $(PYTHON_CI_DIR)/$(VIRTUALENV_NAME)

ST2_VIRTUALENV_DIR ?= "/tmp/st2-pack-tests-virtualenvs"
ST2_REPO_PATH ?= $(CI_DIR)/st2
Expand All @@ -38,13 +38,13 @@ COMPONENTS := $(wildcard /tmp/st2/st2*)
.PHONY: all
# don't register right now (requires us to install stackstorm)
#all: requirements lint packs-resource-register packs-tests
all: virtualenv requirements lint packs-tests
all: .pythonvars virtualenv requirements lint packs-tests

.PHONY: python2
python2: .python2 .pythonvars all
# .PHONY: python2
# python2: .python2 .pythonvars all

.PHONY: python3
python3: .python3 .pythonvars all
# .PHONY: python3
# python3: .python3 .pythonvars all

.PHONY: pack-name
pack-name:
Expand Down Expand Up @@ -253,10 +253,6 @@ test: packs-tests
@echo
@echo "Start Time = `date --iso-8601=ns`"
. $(VIRTUALENV_DIR)/bin/activate; \
if [ "$(PYTHON_EXE)" = "python" ]; then \
rm -f $(ST2_REPO_PATH)/test-requirements.txt; \
mv $(ST2_REPO_PATH)/test-requirements-py27.txt $(ST2_REPO_PATH)/test-requirements.txt; \
fi; \
ST2_REPO_PATH=${ST2_REPO_PATH} $(ST2_REPO_PATH)/st2common/bin/st2-run-pack-tests -x -p $(PACK_DIR) || exit 1;
@echo "End Time = `date --iso-8601=ns`"

Expand Down Expand Up @@ -322,11 +318,7 @@ virtualenv:
if [ -d "$(ROOT_VIRTUALENV)" ]; then \
$(ROOT_DIR)/bin/clonevirtualenv.py $(ROOT_VIRTUALENV) $(VIRTUALENV_DIR);\
else \
if [ "$(PYTHON_EXE)" = "python3" ]; then \
$(PYTHON_EXE) -m venv $(VIRTUALENV_DIR); \
else \
virtualenv --python=$(PYTHON_EXE) $(VIRTUALENV_DIR);\
fi; \
$(PYTHON_EXE) -m venv $(VIRTUALENV_DIR); \
fi; \
fi;
@echo "End Time = `date --iso-8601=ns`"
Expand All @@ -342,24 +334,14 @@ virtualenv:
rm -rf $(CI_DIR)/python*
@echo "End Time = `date --iso-8601=ns`"


# setup python2 executable
.PHONY: .python2
.python2:
@echo
@echo "==================== python2 ===================="
@echo
$(eval PYTHON_EXE=python2)
@echo "PYTHON_EXE=$(PYTHON_EXE)"

# setup python3 executable
.PHONY: .python3
.python3:
@echo
@echo "==================== python3 ===================="
@echo
$(eval PYTHON_EXE=python3)
@echo "PYTHON_EXE=$(PYTHON_EXE)"
# # setup python3 executable
# .PHONY: .python3
# .python3:
# @echo
# @echo "==================== python3 ===================="
# @echo
# $(eval PYTHON_EXE=python3)
# @echo "PYTHON_EXE=$(PYTHON_EXE)"

# initialize PYTHON_EXE dependent variables
.PHONY: .pythonvars
Expand Down
4 changes: 2 additions & 2 deletions circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
jobs:
build_and_test:
docker:
- image: circleci/python:2.7
- image: circleci/python:3.6
- image: rabbitmq:3
- image: mongo:3.4

Expand All @@ -17,4 +17,4 @@ workflows:
version: 2
build_test_deploy:
jobs:
- build_and_test
- build_and_test_python36

0 comments on commit baee216

Please sign in to comment.