only support python3 for creating binaries (#669)

Also explicitly use python3 in creating virtualenv for make commands.
This commit is contained in:
tamarrow
2016-07-06 18:33:33 -07:00
committed by GitHub
parent 18e80ebc13
commit 77afc61fc6
14 changed files with 32 additions and 46 deletions

View File

@@ -4,7 +4,7 @@ BASEDIR=`dirname $0`/..
if [ ! -d "$BASEDIR/env" ]; then
virtualenv -q $BASEDIR/env --prompt='(dcos) '
virtualenv -p python3 -q $BASEDIR/env --prompt='(dcos) '
echo "Virtualenv created."
if [ -f "$BASEDIR/env/bin/activate" ]; then

View File

@@ -10,7 +10,7 @@ test: env
bin/test.sh
binary: clean env packages
pyinstaller binary/binary.spec
bin/create-binary.sh
test-binary: binary
bin/test-binary.sh

16
cli/bin/create-binary.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash -e
BASEDIR=`dirname $0`/..
cd $BASEDIR
if [ -f "$BASEDIR/env/bin/activate" ]; then
source $BASEDIR/env/bin/activate
else
$BASEDIR/env/Scripts/activate
fi
pip install pyinstaller==3.1.1
pyinstaller $BASEDIR/binary/binary.spec
deactivate

View File

@@ -4,7 +4,7 @@ BASEDIR=`dirname $0`/..
if [ ! -d "$BASEDIR/env" ]; then
virtualenv -q $BASEDIR/env --prompt='(dcoscli) '
virtualenv -p python3 -q $BASEDIR/env --prompt='(dcoscli) '
echo "Virtualenv created."
if [ -f "$BASEDIR/env/bin/activate" ]; then

View File

@@ -4,7 +4,6 @@ BASEDIR=`dirname $0`/..
cd $BASEDIR
PATH=$(pwd)/dist:$PATH
if [ -f "$BASEDIR/env/bin/activate" ]; then
cp tests/data/dcos.toml $DCOS_CONFIG
source $BASEDIR/env/bin/activate
@@ -12,5 +11,7 @@ else
export DCOS_CONFIG=tests/data/dcos.toml
$BASEDIR/env/Scripts/activate
fi
export PATH=$BASEDIR/dist:$PATH
py.test tests/integrations
deactivate

View File

@@ -11,10 +11,9 @@ RUN apt-get update && apt-get install -y \
git \
sudo \
&& sudo apt-get update --fix-missing \
&& sudo apt-get install -y python-dev build-essential \
&& sudo apt-get install -y python-pip python-virtualenv \
&& pip install pip --upgrade \
&& pip install pyinstaller
&& sudo apt-get install -y python-dev build-essential python-virtualenv python3-pip python3-virtualenv \
&& pip3 install pip --upgrade \
&& python3 -m pip install pyinstaller==3.1.1
ADD . /dcos-cli
WORKDIR /dcos-cli

View File

@@ -6,8 +6,8 @@ block_cipher = None
a = Analysis(['../dcoscli/main.py'],
pathex=[os.path.dirname(os.getcwd()),
os.getcwd(),
'env/lib/python2.7/site-packages',
'../env/lib/python2.7/site-packages',
'env/lib/python3.4/site-packages',
'../env/lib/python3.4/site-packages',
],
binaries=None,
datas=[('../dcoscli/data/help/*', 'dcoscli/data/help'),

View File

@@ -113,4 +113,4 @@ def signal_handler(signal, frame):
sys.exit(0)
if __name__ == "__main__":
main()
sys.exit(main())

View File

@@ -47,8 +47,6 @@ setup(
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
],
@@ -70,8 +68,7 @@ setup(
'pkginfo==1.2.1',
'toml>=0.9, <1.0',
'virtualenv>=13.0, <14.0',
'rollbar>=0.9, <1.0',
'futures>=3.0, <4.0'
'rollbar>=0.9, <1.0'
],
# If there are data files included in your packages that need to be

View File

@@ -1,5 +1,5 @@
[tox]
envlist = py34-syntax, py{27,34}-unit, py{27,34}-integration
envlist = py34-syntax, py34-unit, py34-integration
[testenv]
deps =
@@ -20,18 +20,10 @@ commands =
flake8 --verbose {env:CI_FLAGS:} dcoscli tests setup.py
isort --recursive --check-only --diff --verbose dcoscli tests setup.py
[testenv:py27-integration]
commands =
py.test -p no:cacheprovider -vv -x {env:CI_FLAGS:} tests/integrations{posargs}
[testenv:py34-integration]
commands =
py.test -p no:cacheprovider -vv -x {env:CI_FLAGS:} tests/integrations{posargs}
[testenv:py27-unit]
commands =
py.test -p no:cacheprovider -vv {env:CI_FLAGS:} tests/unit{posargs}
[testenv:py34-unit]
commands =
py.test -p no:cacheprovider -vv {env:CI_FLAGS:} tests/unit{posargs}

View File

@@ -1,5 +1,5 @@
[tox]
envlist = py{27,34}-unit, py{27,34}-integration
envlist = py34-unit, py34-integration
[testenv]
setenv =
@@ -22,18 +22,10 @@ commands =
flake8 --verbose {env:CI_FLAGS:} dcoscli tests setup.py
isort --recursive --check-only --diff --verbose dcoscli tests setup.py
[testenv:py27-integration]
commands =
py.test -vv {env:CI_FLAGS:} tests/integrations{posargs}
[testenv:py34-integration]
commands =
py.test -vv {env:CI_FLAGS:} tests/integrations{posargs}
[testenv:py27-unit]
commands =
py.test -vv {env:CI_FLAGS:} tests/unit{posargs}
[testenv:py34-unit]
commands =
py.test -vv {env:CI_FLAGS:} tests/unit{posargs}

View File

@@ -47,8 +47,6 @@ setup(
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
],
@@ -65,7 +63,6 @@ setup(
# requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=[
'futures>=3.0, <4.0',
'gitpython>=1.0, <2.0',
'jsonschema==2.4', # pin the exact version, jsonschema 2.5 broke py3
'pager>=3.3, <4.0',

View File

@@ -1,5 +1,5 @@
[tox]
envlist = py34-syntax, py{27,34}-unit
envlist = py34-syntax, py34-unit
[testenv]
deps =
@@ -16,10 +16,6 @@ commands =
flake8 --verbose {env:CI_FLAGS:} dcos tests setup.py
isort --recursive --check-only --diff --verbose dcos tests setup.py
[testenv:py27-unit]
commands =
py.test -p no:cacheprovider -vv {env:CI_FLAGS:} --cov {envsitepackagesdir}/dcos tests
[testenv:py34-unit]
commands =
py.test -p no:cacheprovider -vv {env:CI_FLAGS:} --cov {envsitepackagesdir}/dcos tests

View File

@@ -1,5 +1,5 @@
[tox]
envlist = py{27,34}-unit
envlist = py34-unit
[testenv]
setenv =
@@ -18,10 +18,6 @@ commands =
flake8 --verbose {env:CI_FLAGS:} dcos tests setup.py
isort --recursive --check-only --diff --verbose dcos tests setup.py
[testenv:py27-unit]
commands =
py.test -vv {env:CI_FLAGS:} --cov {envsitepackagesdir}/dcos tests
[testenv:py34-unit]
commands =
py.test -vv {env:CI_FLAGS:} --cov {envsitepackagesdir}/dcos tests