Skip to content

Commit b4a30c5

Browse files
authored
Merge pull request #679 from StackStorm/python3-u16
Build ST2 on Ubuntu 16 with Python 3
2 parents 260cb5a + 333486b commit b4a30c5

5 files changed

Lines changed: 22 additions & 16 deletions

File tree

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
resource_class: large
1515
docker:
1616
# The primary container is an instance of the first list image listed. Your build commands run in this container.
17-
- image: circleci/python:2.7
17+
- image: circleci/python:3.6
1818
working_directory: ~/st2-packages
1919
environment:
2020
DISTROS: "xenial bionic el7 el8"

packages/st2/Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ endif
2323
ifeq ($(DEB_DISTRO),bionic)
2424
PYTHON_BINARY := /usr/bin/python3
2525
PIP_BINARY := pip
26+
else ifeq ($(DEB_DISTRO),xenial)
27+
PYTHON_BINARY := /usr/bin/python3.6
28+
PIP_BINARY := /usr/local/bin/pip3.6
2629
else ifeq ($(EL_VERSION),8)
2730
PYTHON_BINARY := /usr/bin/python3
2831
PIP_BINARY := /usr/local/bin/pip3
@@ -32,12 +35,12 @@ else ifeq ($(EL_VERSION),7)
3235
PIP_BINARY := /usr/local/bin/pip3
3336
PYTHON_ALT_BINARY := python3
3437
else
35-
PYTHON_BINARY := python
36-
PIP_BINARY := pip
37-
PYTHON_ALT_BINARY := python
38+
PYTHON_BINARY := /usr/bin/python3
39+
PIP_BINARY := pip3
40+
PYTHON_ALT_BINARY := python3
3841
endif
3942

40-
RUNNERS := $(shell ls ../contrib/runners)
43+
RUNNERS := $(shell ls ../contrib/runners)
4144

4245
# Moved from top of file to handle when only py2 or py3 available
4346
ST2PKG_VERSION ?= $(shell $(PYTHON_BINARY) -c "from $(ST2_COMPONENT) import __version__; print(__version__),")
@@ -63,6 +66,7 @@ info:
6366
@echo "EL_VERSION=$(EL_VERSION)"
6467
@echo "DEB_DISTRO=$(DEB_DISTRO)"
6568
@echo "PYTHON_BINARY=$(PYTHON_BINARY)"
69+
@echo "PIP_BINARY=$(PIP_BINARY)"
6670

6771
install: wheelhouse changelog
6872

packages/st2/component.makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,19 @@ endif
2222
ifeq ($(DEB_DISTRO),bionic)
2323
PYTHON_BINARY := /usr/bin/python3
2424
PIP_BINARY := /usr/bin/pip3
25+
else ifeq ($(DEB_DISTRO),xenial)
26+
PYTHON_BINARY := /usr/bin/python3.6
27+
PIP_BINARY := /usr/local/bin/pip3.6
2528
else ifeq ($(EL_VERSION),8)
2629
PYTHON_BINARY := /usr/bin/python3
2730
PIP_BINARY := /usr/local/bin/pip3
2831
else ifeq ($(EL_VERSION),7)
2932
PYTHON_BINARY := /usr/bin/python3
3033
PIP_BINARY := /usr/local/bin/pip3
3134
else
32-
PYTHON_BINARY := python
33-
PIP_BINARY := pip
35+
PYTHON_BINARY := /usr/bin/python3
36+
PIP_BINARY := pip3
37+
PYTHON_ALT_BINARY := python3
3438
endif
3539

3640
# Moved from top of file to handle when only py2 or py3 available
@@ -62,9 +66,7 @@ populate_version: .stamp-populate_version
6266

6367
requirements: .stamp-requirements
6468
.stamp-requirements:
65-
# Don't include Mistral runner for now, replace with commented version when mistral removed from st2
66-
# $(PYTHON_BINARY) ../scripts/fixate-requirements.py -s in-requirements.txt -f ../fixed-requirements.txt
67-
$(PYTHON_BINARY) ../scripts/fixate-requirements.py --skip=stackstorm-runner-mistral-v2,python-mistralclient -s in-requirements.txt -f ../fixed-requirements.txt
69+
$(PYTHON_BINARY) ../scripts/fixate-requirements.py -s in-requirements.txt -f ../fixed-requirements.txt
6870
cat requirements.txt
6971

7072
wheelhouse: .stamp-wheelhouse

packages/st2/debian/rules

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,20 @@ IS_SYSTEMD = $(shell command -v dh_systemd_enable > /dev/null 2>&1 && echo true)
1616
DEB_DISTRO := $(shell lsb_release -cs)
1717

1818
# Xenial and Bionic depend on different libraries.
19-
# Most important, Bionic uses Python 3 and others use Python 2.7.
2019
ifeq ($(DEB_DISTRO),bionic)
2120
BUILD_PRE_DEPENDS := python3 (>= 3.6)
2221
BUILD_DEPENDS := python3-distutils, python3-dev
23-
else
24-
BUILD_PRE_DEPENDS := python2.7
25-
BUILD_DEPENDS := libpython-dev | python-dev
22+
else ifeq ($(DEB_DISTRO),xenial)
23+
BUILD_PRE_DEPENDS := python3.6 (>= 3.6)
24+
BUILD_DEPENDS := python3.6-dev
2625
endif
2726

2827
%:
2928
# Use Python 3 binary on Ubuntu Bionic
3029
ifeq ($(DEB_DISTRO),bionic)
3130
dh $@ --with python-virtualenv --python /usr/bin/python3
32-
else
33-
dh $@ --with python-virtualenv
31+
else ifeq ($(DEB_DISTRO),xenial)
32+
dh $@ --with python-virtualenv --python /usr/bin/python3.6
3433
endif
3534

3635
override_dh_installdirs:

rake/spec/default/50-installed-cli-versions_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
describe 'st2 cli version checks' do
44
describe command("st2 --version") do
55
its(:exit_status) { is_expected.to eq 0 }
6+
its(:stdout) { should match /on Python 3.6/ }
67
# show version number in Rspec output
78
after(:all) do
89
puts puts " " + described_class.stderr

0 commit comments

Comments
 (0)