Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
resource_class: large
docker:
# The primary container is an instance of the first list image listed. Your build commands run in this container.
- image: circleci/python:2.7
- image: circleci/python:3.6
working_directory: ~/st2-packages
environment:
DISTROS: "xenial bionic el7 el8"
Expand Down
12 changes: 8 additions & 4 deletions packages/st2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ endif
ifeq ($(DEB_DISTRO),bionic)
PYTHON_BINARY := /usr/bin/python3
PIP_BINARY := pip
else ifeq ($(DEB_DISTRO),xenial)
PYTHON_BINARY := /usr/bin/python3.6
PIP_BINARY := /usr/local/bin/pip3.6
else ifeq ($(EL_VERSION),8)
PYTHON_BINARY := /usr/bin/python3
PIP_BINARY := /usr/local/bin/pip3
Expand All @@ -32,12 +35,12 @@ else ifeq ($(EL_VERSION),7)
PIP_BINARY := /usr/local/bin/pip3
PYTHON_ALT_BINARY := python3
else
PYTHON_BINARY := python
PIP_BINARY := pip
PYTHON_ALT_BINARY := python
PYTHON_BINARY := /usr/bin/python3
PIP_BINARY := pip3
PYTHON_ALT_BINARY := python3
endif

RUNNERS := $(shell ls ../contrib/runners)
RUNNERS := $(shell ls ../contrib/runners)

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

install: wheelhouse changelog

Expand Down
12 changes: 7 additions & 5 deletions packages/st2/component.makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,19 @@ endif
ifeq ($(DEB_DISTRO),bionic)
PYTHON_BINARY := /usr/bin/python3
PIP_BINARY := /usr/bin/pip3
else ifeq ($(DEB_DISTRO),xenial)
PYTHON_BINARY := /usr/bin/python3.6
PIP_BINARY := /usr/local/bin/pip3.6
else ifeq ($(EL_VERSION),8)
PYTHON_BINARY := /usr/bin/python3
PIP_BINARY := /usr/local/bin/pip3
else ifeq ($(EL_VERSION),7)
PYTHON_BINARY := /usr/bin/python3
PIP_BINARY := /usr/local/bin/pip3
else
PYTHON_BINARY := python
PIP_BINARY := pip
PYTHON_BINARY := /usr/bin/python3
PIP_BINARY := pip3
PYTHON_ALT_BINARY := python3
endif

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

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

wheelhouse: .stamp-wheelhouse
Expand Down
11 changes: 5 additions & 6 deletions packages/st2/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@ IS_SYSTEMD = $(shell command -v dh_systemd_enable > /dev/null 2>&1 && echo true)
DEB_DISTRO := $(shell lsb_release -cs)

# Xenial and Bionic depend on different libraries.
# Most important, Bionic uses Python 3 and others use Python 2.7.
ifeq ($(DEB_DISTRO),bionic)
BUILD_PRE_DEPENDS := python3 (>= 3.6)
BUILD_DEPENDS := python3-distutils, python3-dev
else
BUILD_PRE_DEPENDS := python2.7
BUILD_DEPENDS := libpython-dev | python-dev
else ifeq ($(DEB_DISTRO),xenial)
BUILD_PRE_DEPENDS := python3.6 (>= 3.6)
BUILD_DEPENDS := python3.6-dev
endif

%:
# Use Python 3 binary on Ubuntu Bionic
ifeq ($(DEB_DISTRO),bionic)
dh $@ --with python-virtualenv --python /usr/bin/python3
else
dh $@ --with python-virtualenv
else ifeq ($(DEB_DISTRO),xenial)
dh $@ --with python-virtualenv --python /usr/bin/python3.6
endif

override_dh_installdirs:
Expand Down
1 change: 1 addition & 0 deletions rake/spec/default/50-installed-cli-versions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
describe 'st2 cli version checks' do
describe command("st2 --version") do
its(:exit_status) { is_expected.to eq 0 }
its(:stdout) { should match /on Python 3.6/ }
# show version number in Rspec output
after(:all) do
puts puts " " + described_class.stderr
Expand Down