Skip to content

Commit 816fc79

Browse files
authored
Merge pull request #201 from StackStorm/run-tests-with-python36
Fix CircleCI tests
2 parents 5fdda21 + 85b8eec commit 816fc79

File tree

5 files changed

+105
-28
lines changed

5 files changed

+105
-28
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
parallelism: 1
77
shell: /bin/bash --login
88
docker:
9-
- image: circleci/python:2.7
9+
- image: circleci/python:3.6
1010
steps:
1111
- checkout
1212
- run: git clone -b master [email protected]:StackStorm/st2.git /tmp/st2

Makefile

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,36 @@ space_char +=
1414
comma := ,
1515
COMPONENT_PYTHONPATH = $(subst $(space_char),:,$(realpath $(COMPONENTS)))
1616

17-
PYTHON_TARGET := 2.7
17+
PYTHON_TARGET := 3.6
1818

1919
REQUIREMENTS := test-requirements.txt requirements.txt
20+
# Grab the version of pip from the Makefile in the st2 repository
21+
#
22+
# 1. Grab the st2 branch name from ST2_BRANCH
23+
# | 2. Grab the st2 branch from CIRCLE_BRANCH if ST2_BRANCH
24+
# isn't set or is empty
25+
# | | 3. Default branch name, if CIRCLE_BRANCH
26+
# | | and ST2_BRANCH aren't set or are empty
27+
# vvvvvvvvvv vvvvvvvvvvvvv vvvvvv
28+
# $${ST2_BRANCH:-$${CIRCLE_BRANCH:-master}}
29+
#
30+
# This line grabs the version of pip specified in the
31+
#
32+
# PIP_VERSION ?= xx.yy.zz
33+
#
34+
# line of the st2/Makefile, grabs the third column of it, and then installs
35+
# that exact version of pip into the virtualenv.
36+
#
37+
# If the branch is specified in either ST2_BRANCH or CIRCLE_BRANCH, but there
38+
# is no corresponding branch in st2, then curl will error out, and the master
39+
# branch of st2 will be used.
40+
#
41+
ST2_BRANCH := $(shell echo $${ST2_BRANCH:-$${CIRCLE_BRANCH:-master}})
42+
PIP_VERSION := $(shell curl --silent https://raw.githubusercontent.com/StackStorm/st2/$(ST2_BRANCH)/Makefile | grep 'PIP_VERSION ?= ' | awk '{ print $$3 }')
43+
ifeq ($(PIP_VERSION),)
44+
ST2_BRANCH := master
45+
PIP_VERSION := $(shell curl --silent https://raw.githubusercontent.com/StackStorm/st2/$(ST2_BRANCH)/Makefile | grep 'PIP_VERSION ?= ' | awk '{ print $$3 }')
46+
endif
2047
PIP_OPTIONS := $(ST2_PIP_OPTIONS)
2148

2249
NOSE_OPTS := --rednose --immediate
@@ -27,7 +54,7 @@ ifdef NOSE_TIME
2754
endif
2855

2956
ifndef PIP_OPTIONS
30-
PIP_OPTIONS := -U -q
57+
PIP_OPTIONS := -U
3158
endif
3259

3360
.PHONY: all
@@ -74,7 +101,8 @@ requirements: virtualenv
74101
@echo
75102

76103
# Make sure we use latest version of pip
77-
$(VIRTUALENV_DIR)/bin/pip install --upgrade "pip>=8.1.2,<8.2"
104+
echo "Installing pip $(PIP_VERSION) (found from st2 branch $(ST2_BRANCH))"
105+
$(VIRTUALENV_DIR)/bin/pip install --upgrade "pip==$(PIP_VERSION)"
78106
$(VIRTUALENV_DIR)/bin/pip install virtualenv # Required for packs.install in dev envs.
79107

80108
# Install requirements

packs/fixtures/actions/pythonactions/datastore_test_action.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# This is to test imports within actions folder to check
55
# if we messed up sys.path for actions.
6-
from base import DummyClass
6+
from base import DummyClass # pylint: disable=import-error,no-name-in-module
77

88
from st2actions.runners.pythonrunner import Action
99
from st2client.client import Client

test-requirements.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
configparser==5.0.2
2+
enum34==1.1.10
3+
flake8==3.8.4
4+
pylint==2.7.2
5+
slackclient==2.9.3
6+
wheel==0.36.2

test-requirements.txt

Lines changed: 66 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,67 @@
1-
astroid==1.4.5
2-
certifi==2019.3.9
1+
#
2+
# This file is autogenerated by pip-compile
3+
# To update, run:
4+
#
5+
# pip-compile --output-file=test-requirements.txt test-requirements.in
6+
#
7+
aiohttp==3.7.4
8+
# via slackclient
9+
astroid==2.5.1
10+
# via pylint
11+
async-timeout==3.0.1
12+
# via aiohttp
13+
attrs==20.3.0
14+
# via aiohttp
315
chardet==3.0.4
4-
colorama==0.4.1
5-
configparser==3.7.4
6-
enum34==1.1.6
7-
flake8==3.0.4
8-
idna==2.8
9-
lazy-object-proxy==1.3.1
10-
linecache2==1.0.0
11-
mccabe==0.5.3
12-
pep8==1.7.0
13-
pycodestyle==2.0.0
14-
pyflakes==1.2.3
15-
pylint==1.5.5
16-
requests==2.21.0
17-
six==1.12.0
18-
slackclient==1.3.1
19-
traceback2==1.4.0
20-
unittest2==1.1.0
21-
urllib3==1.24.2
22-
websocket-client==0.54.0
23-
wheel==0.36.0
24-
wrapt==1.11.1
16+
# via aiohttp
17+
configparser==5.0.2
18+
# via -r test-requirements.in
19+
enum34==1.1.10
20+
# via -r test-requirements.in
21+
flake8==3.8.4
22+
# via -r test-requirements.in
23+
idna-ssl==1.1.0
24+
# via aiohttp
25+
idna==3.1
26+
# via
27+
# idna-ssl
28+
# yarl
29+
importlib-metadata==3.7.0
30+
# via flake8
31+
isort==5.7.0
32+
# via pylint
33+
lazy-object-proxy==1.5.2
34+
# via astroid
35+
mccabe==0.6.1
36+
# via
37+
# flake8
38+
# pylint
39+
multidict==5.1.0
40+
# via
41+
# aiohttp
42+
# yarl
43+
pycodestyle==2.6.0
44+
# via flake8
45+
pyflakes==2.2.0
46+
# via flake8
47+
pylint==2.7.2
48+
# via -r test-requirements.in
49+
slackclient==2.9.3
50+
# via -r test-requirements.in
51+
toml==0.10.2
52+
# via pylint
53+
typed-ast==1.4.2
54+
# via astroid
55+
typing-extensions==3.7.4.3
56+
# via
57+
# aiohttp
58+
# importlib-metadata
59+
# yarl
60+
wheel==0.36.2
61+
# via -r test-requirements.in
62+
wrapt==1.12.1
63+
# via astroid
64+
yarl==1.6.3
65+
# via aiohttp
66+
zipp==3.4.0
67+
# via importlib-metadata

0 commit comments

Comments
 (0)