Skip to content

Commit 719dd94

Browse files
committed
Remove Python 2.7 tests from Travis config and Makefile
1 parent 963f97f commit 719dd94

File tree

2 files changed

+26
-54
lines changed

2 files changed

+26
-54
lines changed

.travis.yml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ branches:
77
- master
88
- /^v[0-9]+\.[0-9]+$/
99

10+
python:
11+
- "3.6"
12+
- "3.7"
13+
- "3.8"
14+
- "3.9"
15+
1016
env:
1117
global:
1218
- IS_NIGHTLY_BUILD=$([ "${TRAVIS_EVENT_TYPE}" = "cron" ] && echo "yes" || echo "no")
@@ -22,8 +28,7 @@ env:
2228
- NOSE_TIME=$([ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${IS_NIGHTLY_BUILD}" = "no" ] && echo "yes" || echo "no")
2329
# Travis-specific st2.conf (with travis user instead of stanley)
2430
- ST2_CONF=conf/st2.travis.conf
25-
jobs:
26-
include:
31+
jobs:
2732
# NOTE: We combine builds because Travis offers a maximum of 5 concurrent
2833
# builds and having 6 tasks / builds means 1 tasks will need to wait for one
2934
# of the other 5 tasks to finish before it can start
@@ -36,25 +41,22 @@ jobs:
3641
# If you rename or reorder make targets in TASK, you may need to adjust:
3742
# scripts/travis/install-requirements.sh
3843
# scripts/travis/run-nightly-make-task-if-exists.sh
39-
- name: "Unit Tests (Python 2.7 MongoDB 4.0)"
40-
python: 2.7
41-
env: TASK=ci-unit CACHE_NAME=py2 PYTHON_VERSION=python2.7 COMMAND_THRESHOLD=700
44+
- TASK=ci-checks COMMAND_THRESHOLD=300
4245

43-
- name: "Integration Tests (Python 2.7)"
44-
python: 2.7
45-
env: TASK=ci-integration CACHE_NAME=py2 PYTHON_VERSION=python2.7 COMMAND_THRESHOLD=700
46+
- TASK=compilepy3 COMMAND_THRESHOLD=300
4647

47-
- name: "Lint Checks, Packs Tests (Python 3.6)"
48-
python: 3.6
49-
env: TASK="ci-checks ci-packs-tests" CACHE_NAME=py3 PYTHON_VERSION=python3.6 COMMAND_THRESHOLD=430
48+
- TASK=ci-packs-tests COMMAND_THRESHOLD=300
5049

51-
- name: "Unit Tests, Pack Tests (Python 3.6)"
52-
python: 3.6
53-
env: TASK="compilepy3 ci-py3-unit ci-py3-packs-tests" CACHE_NAME=py3 PYTHON_VERSION=python3.6 COMMAND_THRESHOLD=750
50+
- TASK=ci-unit COMMAND_THRESHOLD=300
5451

55-
- name: "Integration Tests (Python 3.6)"
56-
python: 3.6
57-
env: TASK="ci-py3-integration" CACHE_NAME=py3 PYTHON_VERSION=python3.6 COMMAND_THRESHOLD=770
52+
- TASK=ci-integration COMMAND_THRESHOLD=300
53+
54+
jobs:
55+
fast_finish: true
56+
allow_failures:
57+
- python: "3.7"
58+
- python: "3.8"
59+
- python: "3.9"
5860

5961
addons:
6062
apt:

Makefile

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ else
1515
VIRTUALENV_COMPONENTS_DIR ?= virtualenv-components
1616
endif
1717

18-
PYTHON_VERSION ?= $(shell if [ -z "`which python3.6`" ]; then echo "python2.7"; else echo "python3.6"; fi)
19-
2018
BINARIES := bin
2119

2220
# All components are prefixed by st2 and not .egg-info.
@@ -50,11 +48,7 @@ COMPONENTS_TEST_MODULES_COMMA := $(subst $(space_char),$(comma),$(COMPONENTS_TES
5048
COVERAGE_GLOBS := .coverage.unit.* .coverage.integration.*
5149
COVERAGE_GLOBS_QUOTED := $(foreach glob,$(COVERAGE_GLOBS),'$(glob)')
5250

53-
ifeq ($(PYTHON_VERSION),python2.7)
54-
REQUIREMENTS := test-requirements-py27.txt requirements.txt
55-
else
56-
REQUIREMENTS := test-requirements.txt requirements.txt
57-
endif
51+
REQUIREMENTS := test-requirements.txt requirements.txt
5852

5953
# Pin common pip version here across all the targets
6054
# Note! Periodic maintenance pip upgrades are required to be up-to-date with the latest pip security fixes and updates
@@ -112,7 +106,7 @@ all: requirements configgen check tests
112106
# Target for debugging Makefile variable assembly
113107
.PHONY: play
114108
play:
115-
@echo PYTHON_VERSION=$(PYTHON_VERSION)
109+
@echo PYTHON_VERSION=$$(python --version)
116110
@echo
117111
@echo COVERAGE_GLOBS=$(COVERAGE_GLOBS_QUOTED)
118112
@echo
@@ -233,7 +227,7 @@ check-python-packages:
233227
@echo ""
234228
@echo "================== CHECK PYTHON PACKAGES ===================="
235229
@echo ""
236-
test -f $(VIRTUALENV_COMPONENTS_DIR)/bin/activate || virtualenv --python=$(PYTHON_VERSION) $(VIRTUALENV_COMPONENTS_DIR) --no-download --system-site-packages
230+
test -f $(VIRTUALENV_COMPONENTS_DIR)/bin/activate || virtualenv $(VIRTUALENV_COMPONENTS_DIR) --no-download --system-site-packages
237231
@for component in $(COMPONENTS_WITHOUT_ST2TESTS); do \
238232
echo "==========================================================="; \
239233
echo "Checking component:" $$component; \
@@ -249,7 +243,7 @@ check-python-packages-nightly:
249243
@echo "================== CHECK PYTHON PACKAGES ===================="
250244
@echo ""
251245

252-
test -f $(VIRTUALENV_COMPONENTS_DIR)/bin/activate || virtualenv --python=$(PYTHON_VERSION) $(VIRTUALENV_COMPONENTS_DIR) --no-download
246+
test -f $(VIRTUALENV_COMPONENTS_DIR)/bin/activate || virtualenv $(VIRTUALENV_COMPONENTS_DIR) --no-download
253247
@for component in $(COMPONENTS_WITHOUT_ST2TESTS); do \
254248
echo "==========================================================="; \
255249
echo "Checking component:" $$component; \
@@ -381,7 +375,7 @@ flake8: requirements .flake8
381375
@echo
382376
@echo "==================== st2client install check ===================="
383377
@echo
384-
test -f $(VIRTUALENV_ST2CLIENT_DIR)/bin/activate || virtualenv --python=$(PYTHON_VERSION) $(VIRTUALENV_ST2CLIENT_DIR) --no-download --system-site-packages
378+
test -f $(VIRTUALENV_ST2CLIENT_DIR)/bin/activate || virtualenv $(VIRTUALENV_ST2CLIENT_DIR) --no-download --system-site-packages
385379

386380
# Setup PYTHONPATH in bash activate script...
387381
# Delete existing entries (if any)
@@ -591,7 +585,7 @@ virtualenv:
591585
@echo
592586
@echo "==================== virtualenv ===================="
593587
@echo
594-
test -f $(VIRTUALENV_DIR)/bin/activate || virtualenv --python=$(PYTHON_VERSION) $(VIRTUALENV_DIR) --no-download
588+
test -f $(VIRTUALENV_DIR)/bin/activate || virtualenv $(VIRTUALENV_DIR) --no-download
595589

596590
# Setup PYTHONPATH in bash activate script...
597591
# Delete existing entries (if any)
@@ -969,31 +963,7 @@ debs:
969963
ci: ci-checks ci-unit ci-integration ci-packs-tests
970964

971965
.PHONY: ci-checks
972-
ci-checks: compilepy3 .generated-files-check .pylint .flake8 check-requirements check-sdist-requirements .st2client-dependencies-check .st2common-circular-dependencies-check circle-lint-api-spec .rst-check .st2client-install-check check-python-packages
973-
974-
.PHONY: ci-py3-unit
975-
ci-py3-unit:
976-
@echo
977-
@echo "==================== ci-py3-unit ===================="
978-
@echo
979-
NOSE_WITH_TIMER=$(NOSE_WITH_TIMER) tox -e py36-unit -vv
980-
981-
.PHONY: ci-py3-packs-tests
982-
ci-py3-packs-tests:
983-
@echo
984-
@echo "==================== ci-py3-packs-tests ===================="
985-
@echo
986-
NOSE_WITH_TIMER=$(NOSE_WITH_TIMER) tox -e py36-packs -vv
987-
988-
.PHONY: ci-py3-integration
989-
ci-py3-integration: requirements .ci-prepare-integration .ci-py3-integration
990-
991-
.PHONY: .ci-py3-integration
992-
.ci-py3-integration:
993-
@echo
994-
@echo "==================== ci-py3-integration ===================="
995-
@echo
996-
NOSE_WITH_TIMER=$(NOSE_WITH_TIMER) tox -e py36-integration -vv
966+
ci-checks: .generated-files-check .pylint .flake8 check-requirements check-sdist-requirements .st2client-dependencies-check .st2common-circular-dependencies-check circle-lint-api-spec .rst-check .st2client-install-check check-python-packages
997967

998968
.PHONY: .rst-check
999969
.rst-check:

0 commit comments

Comments
 (0)