diff --git a/.circleci/config.yml b/.circleci/config.yml index a321671f..22f1b667 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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" diff --git a/packages/st2/Makefile b/packages/st2/Makefile index 7e3d2f2c..2cfe9617 100644 --- a/packages/st2/Makefile +++ b/packages/st2/Makefile @@ -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 @@ -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__),") @@ -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 diff --git a/packages/st2/component.makefile b/packages/st2/component.makefile index e2e2a205..7a752f60 100644 --- a/packages/st2/component.makefile +++ b/packages/st2/component.makefile @@ -22,6 +22,9 @@ 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 @@ -29,8 +32,9 @@ 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 @@ -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 diff --git a/packages/st2/debian/rules b/packages/st2/debian/rules index e494c7ab..d954c072 100755 --- a/packages/st2/debian/rules +++ b/packages/st2/debian/rules @@ -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: diff --git a/rake/spec/default/50-installed-cli-versions_spec.rb b/rake/spec/default/50-installed-cli-versions_spec.rb index 475edd1b..2780748b 100644 --- a/rake/spec/default/50-installed-cli-versions_spec.rb +++ b/rake/spec/default/50-installed-cli-versions_spec.rb @@ -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